Private GIT

Skip to content
Snippets Groups Projects
Commit 82bfa752 authored by Gaëtan Muller's avatar Gaëtan Muller
Browse files

Add "Collapse" button on subtitles management

parent bb7430d2
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ Download missed subtitles for selected episodes <input class="btn btn-inline" ty ...@@ -55,7 +55,7 @@ Download missed subtitles for selected episodes <input class="btn btn-inline" ty
#for $cur_indexer_id in $sorted_show_ids: #for $cur_indexer_id in $sorted_show_ids:
<tr id="$cur_indexer_id"> <tr id="$cur_indexer_id">
<th><input type="checkbox" class="allCheck" id="allCheck-$cur_indexer_id" name="$cur_indexer_id-all" checked="checked" /></th> <th><input type="checkbox" class="allCheck" id="allCheck-$cur_indexer_id" name="$cur_indexer_id-all" checked="checked" /></th>
<th colspan="3" style="width: 100%; text-align: left;"><a class="whitelink" href="$sbRoot/home/displayShow?show=$cur_indexer_id">$show_names[$cur_indexer_id]</a> ($ep_counts[$cur_indexer_id]) <input type="button" class="get_more_eps btn" id="$cur_indexer_id" value="Expand" /></th> <th colspan="3" style="width: 100%; text-align: left;"><a class="whitelink" href="$sbRoot/home/displayShow?show=$cur_indexer_id">$show_names[$cur_indexer_id]</a> ($ep_counts[$cur_indexer_id]) <input type="button" class="pull-right get_more_eps btn" id="$cur_indexer_id" value="Expand" /></th>
</tr> </tr>
#end for #end for
</table> </table>
......
...@@ -7,13 +7,13 @@ $(document).ready(function() { ...@@ -7,13 +7,13 @@ $(document).ready(function() {
var checked = ''; var checked = '';
var row = ''; var row = '';
row += ' <tr class="good">'; row += ' <tr class="good show-' + indexer_id + '">';
row += ' <td align="center"><input type="checkbox" class="'+indexer_id+'-epcheck" name="'+indexer_id+'-'+season+'x'+episode+'"'+checked+'></td>'; row += ' <td align="center"><input type="checkbox" class="'+indexer_id+'-epcheck" name="'+indexer_id+'-'+season+'x'+episode+'"'+checked+'></td>';
row += ' <td style="width: 1%;">'+season+'x'+episode+'</td>'; row += ' <td style="width: 1%;">'+season+'x'+episode+'</td>';
row += ' <td>'+name+'</td>'; row += ' <td>'+name+'</td>';
row += ' <td style="float: right;">'; row += ' <td style="float: right;">';
subtitles = subtitles.split(',') subtitles = subtitles.split(',')
for (i in subtitles) for (var i in subtitles)
{ {
row += ' <img src="/images/subtitles/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" />&nbsp;'; row += ' <img src="/images/subtitles/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" />&nbsp;';
} }
...@@ -32,7 +32,10 @@ $(document).ready(function() { ...@@ -32,7 +32,10 @@ $(document).ready(function() {
var cur_indexer_id = $(this).attr('id'); var cur_indexer_id = $(this).attr('id');
var checked = $('#allCheck-'+cur_indexer_id).prop('checked'); var checked = $('#allCheck-'+cur_indexer_id).prop('checked');
var last_row = $('tr#'+cur_indexer_id); var last_row = $('tr#'+cur_indexer_id);
var clicked = $(this).attr('data-clicked');
var action = $(this).attr('value');
if (!clicked) {
$.getJSON(sbRoot + '/manage/showSubtitleMissed', $.getJSON(sbRoot + '/manage/showSubtitleMissed',
{ {
indexer_id: cur_indexer_id, indexer_id: cur_indexer_id,
...@@ -46,7 +49,18 @@ $(document).ready(function() { ...@@ -46,7 +49,18 @@ $(document).ready(function() {
}); });
}); });
}); });
$(this).hide(); $(this).attr('data-clicked', 1);
$(this).prop('value', 'Collapse');
} else {
if (action === 'Collapse') {
$('table tr').filter('.show-' + cur_indexer_id).hide();
$(this).prop('value', 'Expand');
}
else if (action === 'Expand') {
$('table tr').filter('.show-' + cur_indexer_id).show();
$(this).prop('value', 'Collapse');
}
}
}); });
// selects all visible episode checkboxes. // selects all visible episode checkboxes.
...@@ -68,5 +82,4 @@ $(document).ready(function() { ...@@ -68,5 +82,4 @@ $(document).ready(function() {
this.checked = false; this.checked = false;
}); });
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment