From 55eb408d189623a32320f48308ff9cda02666c2d Mon Sep 17 00:00:00 2001 From: Tim Hobbs Date: Thu, 13 Mar 2014 06:17:02 -0700 Subject: [PATCH] Enable movie format ribbons Per-user configuration to enable movie format ribbons --- dashboard-ui/css/posteritem.css | 1 - dashboard-ui/scripts/librarybrowser.js | 9 ++++++++- dashboard-ui/scripts/useredit.js | 3 +++ dashboard-ui/useredit.html | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css index 452bf09e11..d6535a8714 100644 --- a/dashboard-ui/css/posteritem.css +++ b/dashboard-ui/css/posteritem.css @@ -338,7 +338,6 @@ } /********************/ .ribbon-wrapper { - display: none; width: 50px; height: 50px; overflow: hidden; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 4e9c2cf122..9ee5b6a897 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -674,6 +674,13 @@ } } + var enableRibbons = false; + var user = Dashboard.getCurrentUser().done(function (data) { + if (data.Configuration) { + enableRibbons = data.Configuration.DisplayMovieFormatRibbons; + } + }); + for (var i = 0, length = items.length; i < length; i++) { var item = items[i]; @@ -878,7 +885,7 @@ html += ''; // Ribbon - if (options.context == "movies") { + if (item.MediaType == "Video" && enableRibbons) { // This would be much better if specified in the json payload // Another nice thing to have in the payload would be 720 vs 1080 // Then, rather than "HD" it could display the specific HD format diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js index 3bc3686722..91b7922d19 100644 --- a/dashboard-ui/scripts/useredit.js +++ b/dashboard-ui/scripts/useredit.js @@ -27,6 +27,8 @@ $('#chkManageLiveTv', page).checked(user.Configuration.EnableLiveTvManagement || false).checkboxradio("refresh"); $('#chkEnableLiveTvAccess', page).checked(user.Configuration.EnableLiveTvAccess || false).checkboxradio("refresh"); + $('#chkDisplayMovieFormatRibbons', page).checked(user.Configuration.DisplayMovieFormatRibbons || false).checkboxradio("refresh"); + Dashboard.hideLoadingMsg(); } @@ -59,6 +61,7 @@ user.Configuration.EnableLiveTvManagement = $('#chkManageLiveTv', page).checked(); user.Configuration.EnableMediaPlayback = $('#chkEnableMediaPlayback', page).checked(); user.Configuration.EnableLiveTvAccess = $('#chkEnableLiveTvAccess', page).checked(); + user.Configuration.DisplayMovieFormatRibbons = $('#chkDisplayMovieFormatRibbons', page).checked(); var userId = getParameterByName("userId"); diff --git a/dashboard-ui/useredit.html b/dashboard-ui/useredit.html index 098bb68295..a6fad858bd 100644 --- a/dashboard-ui/useredit.html +++ b/dashboard-ui/useredit.html @@ -44,6 +44,10 @@ +
+ + +