From b2f475e99f2d3395c654a90fa07a22f2e29d2359 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sat, 13 Dec 2014 15:47:58 +0000 Subject: [PATCH] Add a link from the footer number of snatched to episode snatched overview page. The link to the Episode Overview page is available on all pages except on the Episode Overview page. Change the default state for all check boxes on the Episode Overview page to not checked. Add validation to Go button to ensure at least one item is checked on Episode Overview page. Add highlight to current status text in header on Episode Overview page. Cleanup manageEpisodeStatuses Javascript. --- CHANGES.md | 5 +++ gui/slick/interfaces/default/inc_bottom.tmpl | 23 +++++++++- .../default/manage_episodeStatuses.tmpl | 6 +-- gui/slick/js/manageEpisodeStatuses.js | 44 +++++++++++-------- 4 files changed, 55 insertions(+), 23 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a0179e0c..bff1fc40 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,11 @@ * Change Display Show next/previous when show list is not split to loop around * Fix SQL statements that have dynamic table names to use proper syntax * Fix port checking code preventing startup directly after a SG restart +* Add a link from the footer number of snatched to episode snatched overview page. The link to the + Episode Overview page is available on all pages except on the Episode Overview page +* Change the default state for all check boxes on the Episode Overview page to not checked +* Add validation to Go button to ensure at least one item is checked on Episode Overview page +* Add highlight to current status text in header on Episode Overview page [develop changelog] * Add TVRage network name standardization diff --git a/gui/slick/interfaces/default/inc_bottom.tmpl b/gui/slick/interfaces/default/inc_bottom.tmpl index 8ec9cada..1f1b3df5 100644 --- a/gui/slick/interfaces/default/inc_bottom.tmpl +++ b/gui/slick/interfaces/default/inc_bottom.tmpl @@ -38,9 +38,30 @@ #set $ep_downloaded = 0 #set $ep_total = 0 #end if +#try + #set $localRoot = $sbRoot +#except NotFound + #set $localRoot = '' +#end try +#try + #set $localheader = $header +#except NotFound + #set $localheader = '' +#end try $shows_total shows ($shows_active active) - | <%= ep_downloaded %><%= ('', ' (+%s snatched)' % str(ep_snatched))[ep_snatched > 0] %> / $ep_total episodes downloaded + | <%= ep_downloaded %> + <%= ( + '',\ + ' (+%s snatched)' % \ + ( + str(ep_snatched), + '%s' % \ + (localRoot, str(ep_snatched)) + )['Episode Overview' != localheader] + )[0 < ep_snatched] + %> +  / $ep_total episodes downloaded | daily search: <%= str(sickbeard.dailySearchScheduler.timeLeft()).split('.')[0] %> | backlog search: $sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun()) diff --git a/gui/slick/interfaces/default/manage_episodeStatuses.tmpl b/gui/slick/interfaces/default/manage_episodeStatuses.tmpl index 78a67891..0cd7844d 100644 --- a/gui/slick/interfaces/default/manage_episodeStatuses.tmpl +++ b/gui/slick/interfaces/default/manage_episodeStatuses.tmpl @@ -40,7 +40,7 @@ Manage episodes with status -

Shows containing $common.statusStrings[$int($whichStatus)] episodes

+

Shows containing $common.statusStrings[$int($whichStatus)] episodes


@@ -65,7 +65,7 @@ $statusList.append($common.FAILED) #end for - +
@@ -76,7 +76,7 @@ $statusList.append($common.FAILED) #for $cur_indexer_id in $sorted_show_ids: - + #end for diff --git a/gui/slick/js/manageEpisodeStatuses.js b/gui/slick/js/manageEpisodeStatuses.js index cc97068b..b9354e1a 100644 --- a/gui/slick/js/manageEpisodeStatuses.js +++ b/gui/slick/js/manageEpisodeStatuses.js @@ -1,34 +1,40 @@ $(document).ready(function() { function make_row(indexer_id, season, episode, name, checked) { - if (checked) - var checked = ' checked'; - else - var checked = ''; - - var row_class = $('#row_class').val(); - - var row = ''; - row += ' '; - row += ' '; - row += ' '; - row += ' '; - row += ' ' - - return row; + var checkedbox = (checked ? ' checked' : ''), + row_class = $('#row_class').val(); + + return ' ' + + ' ' + + ' ' + + ' ' + + ' '; } + $('.go').click(function() { + var selected; + + if (selected = (0 === $('input[class*="-epcheck"]:checked').length)) + alert('Please select at least one episode'); + + return !selected + }); + $('.allCheck').click(function(){ var indexer_id = $(this).attr('id').split('-')[1]; - $('.'+indexer_id+'-epcheck').prop('checked', $(this).prop('checked')); + $('.' + indexer_id + '-epcheck').prop('checked', $(this).prop('checked')); }); $('.get_more_eps').click(function(){ var cur_indexer_id = $(this).attr('id'); - var checked = $('#allCheck-'+cur_indexer_id).prop('checked'); - var last_row = $('tr#'+cur_indexer_id); + var checked = $('#allCheck-' + cur_indexer_id).prop('checked'); + var last_row = $('tr#' + cur_indexer_id); - $.getJSON(sbRoot+'/manage/showEpisodeStatuses', + $.getJSON(sbRoot + '/manage/showEpisodeStatuses', { indexer_id: cur_indexer_id, whichStatus: $('#oldStatus').val()
$show_names[$cur_indexer_id] ($ep_counts[$cur_indexer_id])
'+season+'x'+episode+''+name+'
' + + '' + season + 'x' + episode + '' + name + '