Skip to content

Commit

Permalink
improved efficiency in edit track; finessed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Oct 4, 2024
1 parent 5ab7b95 commit d679562
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions ui/templates/default/list/editItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
{% block banner %}
<div class='playlistBanner'>&nbsp;Editing highlighted item</div>
<input type='hidden' id='track-id' value='{{ entry.getId() }}' />
{% if entry.getType() == constant('TYPE_SET_SEPARATOR', entry) %}
{% set type='set-separator' %}
{% elseif entry.getType() == constant('TYPE_COMMENT', entry) %}
{% set type='comment-entry' %}
{% set type = entry.getType() %}
{% if type is constant('TYPE_SPIN', entry) %}
{%~ set etype = 'manual-entry' %}
{%~ set album = entry.asArray() %}
{%~ for field in ['tag', 'artist', 'album', 'label', 'title'] %}
<input type='hidden' id='old-track-{{ field }}' value='{{ album[field == 'title' ? 'track' : field ] }}' />
{%~ endfor %}
{% elseif type is constant('TYPE_COMMENT', entry) %}
{%~ set etype = 'comment-entry' %}
<input type='hidden' id='old-comment-data' value='{{ entry.getComment() }}' />
{% elseif entry.getType() == constant('TYPE_LOG_EVENT', entry) %}
{% set type=NME_PREFIX ~ entry.getLogEventType() %}
{% elseif type is constant('TYPE_LOG_EVENT', entry) %}
{%~ set etype = NME_PREFIX ~ entry.getLogEventType() %}
<input type='hidden' id='old-event-code' value='{{ entry.getLogEventCode() }}' />
{% else %}
{% set type='manual-entry' %}
{% set album = entry.asArray() %}
{% for field in ['tag', 'artist', 'album', 'label', 'title'] %}
<input type='hidden' id='old-track-{{ field }}' value='{{ album[field == 'title' ? 'track' : field ] }}' />
{% endfor %}
{%~ set etype = 'set-separator' %}
{% endif %}

<input type='hidden' id='old-created' value='{{ entry.getCreatedTime() }}' />
<input type='hidden' id='edit-type' value='{{ type }}' />
<input type='hidden' id='edit-type' value='{{ etype }}' />
{% endblock %}
8 changes: 4 additions & 4 deletions ui/templates/default/list/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{% set djName = playlist.airname ?? "None" %}
{% set djLink = djId ? "<a href='?subaction=viewDJ&amp;seq=selUser&amp;viewuser=" ~ djId ~ "' class='nav2'>" ~ djName | e ~ "</a>" : djName | e %}

<div class='playlistBanner'><span id='banner-caption'>&nbsp;<span id='banner-description'>{{ showName }}</span> <span id='banner-dj'>with {{ djLink | raw }}</span></span><div>{{ showDateTime }}
<div class='playlistBanner'><span id='banner-caption'>&nbsp;<span id='banner-description'>{{ showName }}</span> <span id='banner-dj'>with {{ djLink | raw }}</span></span><div>{{ showDateTime }}
{%- if not editMode and app.session.isAuth('v') -%}
&nbsp;<a href='javascript:document.duplist.submit();' title='Duplicate Playlist'><span class='fas fa-clone dup-playlist'></span></a><form name='duplist' action='?' method='POST'><input type='hidden' name='subaction' value='editList'><input type='hidden' name='duplicate' value='1'><input type='hidden' name='playlist' value='{{ playlist.id }}'></form>"
{%- endif -%}
&nbsp;</div></div>

<script><!--
<script><!--
{#
Truncate the show name (banner-description) so that the combined
show name, DJ name, and date/time fit on one line.
Expand All @@ -30,12 +30,12 @@
});
});
// -->
</script>
</script>
{% endblock %}
{#--------------------------------------------------------------------------#}
{% block entry %}
{% set isLiveShow = not editTrack and isLive %}
<div class='pl-form-entry form-entry'>
<div class='pl-form-entry form-entry'>
<input id='show-time' type='hidden' value="{{ playlist.showtime }}" >
{#~ TZO is server equivalent of javascript Date.getTimezoneOffset() #}
<input id='timezone-offset' type='hidden' value="{{ TZO }}" >
Expand Down

0 comments on commit d679562

Please sign in to comment.