mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added an allow mode filter for tags
This commit is contained in:
parent
dea551e078
commit
ee34b9ee18
5 changed files with 49 additions and 18 deletions
|
@ -4,8 +4,8 @@
|
||||||
<title>${TitleSignIn}</title>
|
<title>${TitleSignIn}</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="serverlessPage">
|
<body class="serverlessPage">
|
||||||
<div class="backdropContainer" style="background-image:url(css/images/splash.png);top:0;"></div>
|
<div class="backdropContainer" style="background-image:url(css/images/splash.jpg);top:0;"></div>
|
||||||
<div id="connectLoginPage" data-role="page" class="page standalonePage connectLoginPage lightBackdropPage backdropPage staticBackdropPage" data-theme="b" style="background-color: rgba(20, 20,20, .75)!important;">
|
<div id="connectLoginPage" data-role="page" class="page standalonePage connectLoginPage lightBackdropPage backdropPage staticBackdropPage" data-theme="b" style="background-color: rgba(0, 0,0, .9)!important;">
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
|
|
||||||
|
|
BIN
dashboard-ui/css/images/splash.jpg
Normal file
BIN
dashboard-ui/css/images/splash.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 266 KiB |
Binary file not shown.
Before Width: | Height: | Size: 725 KiB |
|
@ -81,7 +81,7 @@
|
||||||
Dashboard.setPageTitle(user.Name);
|
Dashboard.setPageTitle(user.Name);
|
||||||
|
|
||||||
loadUnratedItems(page, user);
|
loadUnratedItems(page, user);
|
||||||
loadTags(page, user.Policy.BlockedTags);
|
loadTags(page, user.Policy.TagFilters);
|
||||||
|
|
||||||
populateRatings(allParentalRatings, page);
|
populateRatings(allParentalRatings, page);
|
||||||
|
|
||||||
|
@ -120,11 +120,17 @@
|
||||||
|
|
||||||
li += '<a href="#">';
|
li += '<a href="#">';
|
||||||
|
|
||||||
li += '<div style="font-weight:normal;">' + h + '</div>';
|
li += '<h3>' + h.Tag + '</h3>';
|
||||||
|
|
||||||
|
if (h.Mode == 'Allow') {
|
||||||
|
li += '<p style="color:green;">Allow</p>';
|
||||||
|
} else if (h.Mode == 'Block') {
|
||||||
|
li += '<p style="color:red;">Block</p>';
|
||||||
|
}
|
||||||
|
|
||||||
li += '</a>';
|
li += '</a>';
|
||||||
|
|
||||||
li += '<a class="blockedTag btnDeleteTag" href="#" data-tag="' + h + '"></a>';
|
li += '<a class="tagFilter btnDeleteTag" href="#" data-tag="' + h.Tag + '" data-mode="' + h.Mode + '"></a>';
|
||||||
|
|
||||||
li += '</li>';
|
li += '</li>';
|
||||||
|
|
||||||
|
@ -132,14 +138,15 @@
|
||||||
|
|
||||||
}).join('') + '</ul>';
|
}).join('') + '</ul>';
|
||||||
|
|
||||||
var elem = $('.blockedTags', page).html(html).trigger('create');
|
var elem = $('.tagFilters', page).html(html).trigger('create');
|
||||||
|
|
||||||
$('.btnDeleteTag', elem).on('click', function () {
|
$('.btnDeleteTag', elem).on('click', function () {
|
||||||
|
|
||||||
var tag = this.getAttribute('data-tag');
|
var tag = this.getAttribute('data-tag');
|
||||||
|
var mode = this.getAttribute('data-mode');
|
||||||
|
|
||||||
var newTags = tags.filter(function (t) {
|
var newTags = tags.filter(function (t) {
|
||||||
return t != tag;
|
return t.Tag != tag || t.Mode != mode;
|
||||||
});
|
});
|
||||||
|
|
||||||
loadTags(page, newTags);
|
loadTags(page, newTags);
|
||||||
|
@ -209,7 +216,7 @@
|
||||||
|
|
||||||
user.Policy.AccessSchedules = getSchedulesFromPage(page);
|
user.Policy.AccessSchedules = getSchedulesFromPage(page);
|
||||||
|
|
||||||
user.Policy.BlockedTags = getTagsFromPage(page);
|
user.Policy.TagFilters = getTagsFromPage(page);
|
||||||
|
|
||||||
ApiClient.updateUserPolicy(user.Id, user.Policy).done(function () {
|
ApiClient.updateUserPolicy(user.Id, user.Policy).done(function () {
|
||||||
onSaveComplete(page);
|
onSaveComplete(page);
|
||||||
|
@ -244,8 +251,8 @@
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onTagFormSubmit: function() {
|
onTagFormSubmit: function () {
|
||||||
|
|
||||||
var page = $(this).parents('.page');
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
saveTag(page);
|
saveTag(page);
|
||||||
|
@ -329,12 +336,15 @@
|
||||||
function saveTag(page) {
|
function saveTag(page) {
|
||||||
|
|
||||||
var tag = $('#txtTag', page).val();
|
var tag = $('#txtTag', page).val();
|
||||||
|
var mode = $('#selectTagMode', page).val();
|
||||||
var tags = getTagsFromPage(page);
|
var tags = getTagsFromPage(page);
|
||||||
|
|
||||||
if (tags.indexOf(tag) == -1) {
|
tags.push({
|
||||||
tags.push(tag);
|
Tag: tag,
|
||||||
loadTags(page, tags);
|
Mode: mode
|
||||||
}
|
});
|
||||||
|
|
||||||
|
loadTags(page, tags);
|
||||||
|
|
||||||
$('#popupTag', page).popup('close');
|
$('#popupTag', page).popup('close');
|
||||||
}
|
}
|
||||||
|
@ -354,9 +364,12 @@
|
||||||
|
|
||||||
function getTagsFromPage(page) {
|
function getTagsFromPage(page) {
|
||||||
|
|
||||||
return $('.blockedTag', page).map(function () {
|
return $('.tagFilter', page).map(function () {
|
||||||
|
|
||||||
return this.getAttribute('data-tag');
|
return {
|
||||||
|
Tag: this.getAttribute('data-tag'),
|
||||||
|
Mode: this.getAttribute('data-mode')
|
||||||
|
};
|
||||||
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
@ -365,6 +378,7 @@
|
||||||
|
|
||||||
$('#popupTag', page).popup('open');
|
$('#popupTag', page).popup('open');
|
||||||
$('#txtTag', page).val('').focus();
|
$('#txtTag', page).val('').focus();
|
||||||
|
$('#selectTagMode', page).val('Block').selectmenu('refresh').trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#userParentalControlPage", function () {
|
$(document).on('pageinit', "#userParentalControlPage", function () {
|
||||||
|
@ -383,6 +397,15 @@
|
||||||
showTagPopup(page);
|
showTagPopup(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#selectTagMode', page).on('change', function () {
|
||||||
|
|
||||||
|
if (this.value == 'Allow') {
|
||||||
|
$('.allowModeHelp', page).show();
|
||||||
|
} else {
|
||||||
|
$('.allowModeHelp', page).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
populateHours(page);
|
populateHours(page);
|
||||||
|
|
||||||
}).on('pageshow', "#userParentalControlPage", function () {
|
}).on('pageshow', "#userParentalControlPage", function () {
|
||||||
|
|
|
@ -32,10 +32,10 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<div class="ui-controlgroup-label" style="display:inline-block;">${LabelBlockItemsWithTags}</div>
|
<div class="ui-controlgroup-label" style="display:inline-block;">${LabelBlockOrAllowItemsWithTags}</div>
|
||||||
<button type="button" class="btnAddTag" data-inline="true" data-mini="true" data-iconpos="notext" data-icon="plus" style="vertical-align:middle;margin: -5px 0 0 1em;">${ButtonAdd}</button>
|
<button type="button" class="btnAddTag" data-inline="true" data-mini="true" data-iconpos="notext" data-icon="plus" style="vertical-align:middle;margin: -5px 0 0 1em;">${ButtonAdd}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="blockedTags" style="margin-top:.5em;">
|
<div class="tagFilters" style="margin-top:.5em;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,6 +81,14 @@
|
||||||
<label for="txtTag">${LabelTag}</label>
|
<label for="txtTag">${LabelTag}</label>
|
||||||
<input id="txtTag" type="text" required="required" />
|
<input id="txtTag" type="text" required="required" />
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<label for="selectTagMode">${LabelTagFilterMode}</label>
|
||||||
|
<select id="selectTagMode" data-mini="true">
|
||||||
|
<option value="Block">${OptionBlockItemWithTag}</option>
|
||||||
|
<option value="Allow">${OptionAllowItemWithTag}</option>
|
||||||
|
</select>
|
||||||
|
<div class="fieldDescription allowModeHelp">${LabelTagFilterAllowModeHelp}</div>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" data-icon="plus" data-theme="b" data-mini="true">${ButtonAdd}</button>
|
<button type="submit" data-icon="plus" data-theme="b" data-mini="true">${ButtonAdd}</button>
|
||||||
<button type="button" data-icon="delete" data-mini="true" onclick="$(this).parents('.popup').popup('close');">${ButtonCancel}</button>
|
<button type="button" data-icon="delete" data-mini="true" onclick="$(this).parents('.popup').popup('close');">${ButtonCancel}</button>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue