Make history filter multi-select on other pages

This commit is contained in:
JonnyWong16 2021-04-02 16:25:26 -07:00
commit 76e8523ae4
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 37 additions and 41 deletions

View file

@ -617,16 +617,13 @@ DOCUMENTATION :: END
% endif
<div class="btn-group" data-toggle="buttons" id="transcode_decision-selection">
<label class="btn btn-dark">
<input type="radio" name="transcode_decision-filter" id="history-transcode_decision-all" value="all" autocomplete="off"> All
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-direct_play" value="direct play" autocomplete="off"><i class="fa fa-play-circle"></i> Direct Play
</label>
<label class="btn btn-dark">
<input type="radio" name="transcode_decision-filter" id="history-transcode_decision-direct_play" value="direct play" autocomplete="off"> Direct Play
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-direct_stream" value="copy" autocomplete="off"><i class="fa fa-stream"></i> Direct Stream
</label>
<label class="btn btn-dark">
<input type="radio" name="transcode_decision-filter" id="history-transcode_decision-direct_stream" value="copy" autocomplete="off"> Direct Stream
</label>
<label class="btn btn-dark">
<input type="radio" name="transcode_decision-filter" id="history-transcode_decision-transcode" value="transcode" autocomplete="off"> Transcode
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-transcode" value="transcode" autocomplete="off"><i class="fa fa-server"></i> Transcode
</label>
</div>
<div class="btn-group">
@ -857,16 +854,18 @@ DOCUMENTATION :: END
$('#transcode_decision-selection > label').removeClass('active');
var selected_filter = $('input[name=transcode_decision-filter]:checked', '#transcode_decision-selection');
$(selected_filter).closest('label').addClass('active');
transcode_decision = $(selected_filter).val();
transcode_decision = $(selected_filter).map(function () { return $(this).val(); }).get().join(',');
setLocalStorage('info_${data["rating_key"]}_history_transcode_decision', transcode_decision);
history_table.draw();
});
}
var transcode_decision = getLocalStorage('info_${data["rating_key"]}_history_transcode_decision', 'all');
var history_transcode_decision = $('#history-transcode_decision-' + transcode_decision.replace(' ', '_'));
history_transcode_decision.prop('checked', true);
history_transcode_decision.closest('label').addClass('active');
$.each(transcode_decision.split(','), function (i, item) {
var history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_'));
history_transcode_decision.prop('checked', true);
history_transcode_decision.closest('label').addClass('active');
});
$(document).ready(function () {
loadHistoryTable(transcode_decision);