From 6e9cfd2a3eb760e2e4dc7243f841c06e09df1b1e Mon Sep 17 00:00:00 2001 From: sharkykh Date: Thu, 26 Jul 2018 12:18:14 +0300 Subject: [PATCH] Convert submenu to Vue (#4739) * Convert submenu to Vue * Update display conditions for submenu + Remove unused /home/testRename submenu code * Make `curShowSlug` reactive, make show-selector `showSlug` prop reactive * VueRouter: Disable `not-found` redirection for now * Restore the submenu visibility check on `main.mako` * Add TODO, remove unused Python conversions * Review * Update CHANGELOG.md * Fix padding bug --- CHANGELOG.md | 4 +- medusa/server/web/core/schedule.py | 33 +--- medusa/server/web/home/handler.py | 9 +- themes-default/slim/static/css/style.css | 30 ---- themes-default/slim/static/js/common/init.js | 33 ---- themes-default/slim/static/js/router.js | 7 +- .../static/js/templates/show-selector.vue | 11 +- themes-default/slim/views/layouts/main.mako | 3 +- .../slim/views/partials/submenu.mako | 42 ----- .../slim/views/vue-components/sub-menu.mako | 143 ++++++++++++++++++ themes/dark/assets/css/style.css | 30 ---- themes/dark/assets/js/common/init.js | 33 ---- themes/dark/assets/js/common/init.js.map | 2 +- themes/dark/assets/js/router.js | 7 +- themes/dark/assets/js/router.js.map | 2 +- .../assets/js/templates/show-selector.vue | 11 +- themes/dark/templates/layouts/main.mako | 3 +- themes/dark/templates/partials/submenu.mako | 42 ----- .../templates/vue-components/sub-menu.mako | 143 ++++++++++++++++++ themes/light/assets/css/style.css | 30 ---- themes/light/assets/js/common/init.js | 33 ---- themes/light/assets/js/common/init.js.map | 2 +- themes/light/assets/js/router.js | 7 +- themes/light/assets/js/router.js.map | 2 +- .../assets/js/templates/show-selector.vue | 11 +- themes/light/templates/layouts/main.mako | 3 +- themes/light/templates/partials/submenu.mako | 42 ----- .../templates/vue-components/sub-menu.mako | 143 ++++++++++++++++++ 28 files changed, 487 insertions(+), 374 deletions(-) delete mode 100644 themes-default/slim/views/partials/submenu.mako create mode 100644 themes-default/slim/views/vue-components/sub-menu.mako delete mode 100644 themes/dark/templates/partials/submenu.mako create mode 100644 themes/dark/templates/vue-components/sub-menu.mako delete mode 100644 themes/light/templates/partials/submenu.mako create mode 100644 themes/light/templates/vue-components/sub-menu.mako diff --git a/CHANGELOG.md b/CHANGELOG.md index 56ac0c7a49..0927da6f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,9 @@ - Added a simple "Loading..." message while the page is loading ([#4629](https://github.com/pymedusa/Medusa/pull/4629)) - Expanded episode status management capabilities, added support for Downloaded, Archived ([#4647](https://github.com/pymedusa/Medusa/pull/4647)) - Added ability to manually change episode quality ([#4658](https://github.com/pymedusa/Medusa/pull/4658)) -- Converted the header to Vue ([#4519](https://github.com/pymedusa/Medusa/pull/4519)) +- Converted to Vue components: + - header ([#4519](https://github.com/pymedusa/Medusa/pull/4519)) + - sub-menu ([#4739](https://github.com/pymedusa/Medusa/pull/4739)) - _Simple message describing the improvement, and a link to the pull request._ **Fixes** diff --git a/medusa/server/web/core/schedule.py b/medusa/server/web/core/schedule.py index 0c7c67442a..21141cdfb1 100644 --- a/medusa/server/web/core/schedule.py +++ b/medusa/server/web/core/schedule.py @@ -22,38 +22,9 @@ def index(self): results = ComingEpisodes.get_coming_episodes(ComingEpisodes.categories, app.COMING_EPS_SORT, False) today = datetime.datetime.now().replace(tzinfo=network_timezones.app_timezone) - submenu = [ - { - 'title': 'Sort by:', - 'path': { - 'Date': 'schedule/setScheduleSort/?sort=date', - 'Show': 'schedule/setScheduleSort/?sort=show', - 'Network': 'schedule/setScheduleSort/?sort=network', - } - }, - { - 'title': 'Layout:', - 'path': { - 'Banner': 'schedule/setScheduleLayout/?layout=banner', - 'Poster': 'schedule/setScheduleLayout/?layout=poster', - 'List': 'schedule/setScheduleLayout/?layout=list', - 'Calendar': 'schedule/setScheduleLayout/?layout=calendar', - } - }, - { - 'title': 'View Paused:', - 'path': { - 'Hide': 'schedule/toggleScheduleDisplayPaused' - } if app.COMING_EPS_DISPLAY_PAUSED else { - 'Show': 'schedule/toggleScheduleDisplayPaused' - } - }, - ] - t = PageTemplate(rh=self, filename='schedule.mako') - return t.render(submenu=submenu[::-1], next_week=next_week1, today=today, results=results, - layout=app.COMING_EPS_LAYOUT, - controller='schedule', action='index') + return t.render(next_week=next_week1, today=today, results=results, + layout=app.COMING_EPS_LAYOUT, controller='schedule', action='index') def toggleScheduleDisplayPaused(self): app.COMING_EPS_DISPLAY_PAUSED = not app.COMING_EPS_DISPLAY_PAUSED diff --git a/medusa/server/web/home/handler.py b/medusa/server/web/home/handler.py index c5c552aaa6..2b3f132b62 100644 --- a/medusa/server/web/home/handler.py +++ b/medusa/server/web/home/handler.py @@ -2081,14 +2081,7 @@ def testRename(self, indexername=None, seriesid=None): ep_obj_rename_list.reverse() t = PageTemplate(rh=self, filename='testRename.mako') - submenu = [{ - 'title': 'Edit', - 'path': 'home/editShow?indexername={series_obj.indexer_name}&seriesid={series_obj.series_id}'.format(series_obj=series_obj), - 'icon': 'ui-icon ui-icon-pencil' - }] - - return t.render(submenu=submenu[::-1], ep_obj_list=ep_obj_rename_list, - show=series_obj, + return t.render(ep_obj_list=ep_obj_rename_list, show=series_obj, controller='home', action='previewRename') def doRename(self, indexername=None, seriesid=None, eps=None): diff --git a/themes-default/slim/static/css/style.css b/themes-default/slim/static/css/style.css index 607b87e37e..281509407e 100644 --- a/themes-default/slim/static/css/style.css +++ b/themes-default/slim/static/css/style.css @@ -187,16 +187,6 @@ inc_top.mako clear: both; } -#sub-menu { - font-size: 12px; - padding-top: 2px; -} - -#sub-menu > a { - float: right; - margin-left: 4px; -} - .upgrade-notification { text-align: center; margin-top: 20px; @@ -1176,21 +1166,6 @@ div#col-show-summary { float: left; } -@media (min-width: 1281px) { - #sub-menu-container { - position: fixed; - width: 100%; - top: 51px; - } -} - -@media (max-width: 1281px) { - #sub-menu-container { - position: relative; - margin-top: -24px; - } -} - @media (max-width: 767px) and (min-width: 341px) { .container-navShow { margin-left: 305px; @@ -2997,11 +2972,6 @@ fieldset[disabled] .navbar-default .btn-link:focus { height: auto; } -#sub-menu-container { - z-index: 550; - min-height: 41px; -} - .shadow { box-shadow: 3px 3px 3px rgba(17, 17, 17, 0.5); } diff --git a/themes-default/slim/static/js/common/init.js b/themes-default/slim/static/js/common/init.js index de38ed9d11..24fae868f0 100644 --- a/themes-default/slim/static/js/common/init.js +++ b/themes-default/slim/static/js/common/init.js @@ -77,39 +77,6 @@ MEDUSA.common.init = function() { $(this).parent().find('.triggerhighlight').css('background-color', revertBackgroundColor); // Reverting back to original background-color }); - $.confirm.options = { - confirmButton: 'Yes', - cancelButton: 'Cancel', - dialogClass: 'modal-dialog', - post: false, - confirm(e) { - location.href = e[0].href; - } - }; - - $('a.removeshow').confirm({ - title: 'Remove Show', - text: 'Are you sure you want to remove ' + $('#showtitle').data('showname') + ' from the database?

Check to delete files as well. IRREVERSIBLE', - confirm(e) { - location.href = e[0].href + (document.getElementById('deleteFiles').checked ? '&full=1' : ''); - } - }); - - $('a.clearhistory').confirm({ - title: 'Clear History', - text: 'Are you sure you want to clear all download history?' - }); - - $('a.trimhistory').confirm({ - title: 'Trim History', - text: 'Are you sure you want to trim all download history older than 30 days?' - }); - - $('a.submiterrors').confirm({ - title: 'Submit Errors', - text: 'Are you sure you want to submit these errors ?

Make sure Medusa is updated and trigger
this error with debug enabled before submitting
' - }); - $('#config-components').tabs({ activate(event, ui) { let lastOpenedPanel = $(this).data('lastOpenedPanel'); diff --git a/themes-default/slim/static/js/router.js b/themes-default/slim/static/js/router.js index 0966e3561f..b1a970fae4 100644 --- a/themes-default/slim/static/js/router.js +++ b/themes-default/slim/static/js/router.js @@ -60,9 +60,10 @@ if (!window.router) { header: '404 - page not found' }, component: notFoundComponent - }, { - path: '*', - redirect: '/not-found' + // @NOTE: Redirect can only be added once all routes are vue + // }, { + // path: '*', + // redirect: '/not-found' }]) }); diff --git a/themes-default/slim/static/js/templates/show-selector.vue b/themes-default/slim/static/js/templates/show-selector.vue index af41cc36be..654b8f126e 100644 --- a/themes-default/slim/static/js/templates/show-selector.vue +++ b/themes-default/slim/static/js/templates/show-selector.vue @@ -22,7 +22,8 @@ module.exports = { }, data() { return { - selectedShowSlug: this.showSlug + selectedShowSlug: this.showSlug, + lock: false }; }, computed: Object.assign(Vuex.mapState(['config', 'shows']), { @@ -69,7 +70,15 @@ module.exports = { } }), watch: { + showSlug(newSlug) { + this.lock = true; + this.selectedShowSlug = newSlug; + }, selectedShowSlug(newSlug) { + if (this.lock) { + this.lock = false; + return; + } const { shows } = this; const selectedShow = shows.find(show => show.id.slug === newSlug); if (!selectedShow) { diff --git a/themes-default/slim/views/layouts/main.mako b/themes-default/slim/views/layouts/main.mako index 051e620136..87cf498f47 100644 --- a/themes-default/slim/views/layouts/main.mako +++ b/themes-default/slim/views/layouts/main.mako @@ -61,7 +61,7 @@ % if submenu: - <%include file="/partials/submenu.mako"/> + % endif <%include file="/partials/alerts.mako"/>
@@ -137,6 +137,7 @@ Vue.component('file-browser', httpVueLoader('js/templates/file-browser.vue')); Vue.component('plot-info', httpVueLoader('js/templates/plot-info.vue')); + <%include file="/vue-components/sub-menu.mako"/> <%include file="/vue-components/quality-chooser.mako"/> +<%! + import json +%> + + \ No newline at end of file diff --git a/themes/dark/assets/css/style.css b/themes/dark/assets/css/style.css index 607b87e37e..281509407e 100644 --- a/themes/dark/assets/css/style.css +++ b/themes/dark/assets/css/style.css @@ -187,16 +187,6 @@ inc_top.mako clear: both; } -#sub-menu { - font-size: 12px; - padding-top: 2px; -} - -#sub-menu > a { - float: right; - margin-left: 4px; -} - .upgrade-notification { text-align: center; margin-top: 20px; @@ -1176,21 +1166,6 @@ div#col-show-summary { float: left; } -@media (min-width: 1281px) { - #sub-menu-container { - position: fixed; - width: 100%; - top: 51px; - } -} - -@media (max-width: 1281px) { - #sub-menu-container { - position: relative; - margin-top: -24px; - } -} - @media (max-width: 767px) and (min-width: 341px) { .container-navShow { margin-left: 305px; @@ -2997,11 +2972,6 @@ fieldset[disabled] .navbar-default .btn-link:focus { height: auto; } -#sub-menu-container { - z-index: 550; - min-height: 41px; -} - .shadow { box-shadow: 3px 3px 3px rgba(17, 17, 17, 0.5); } diff --git a/themes/dark/assets/js/common/init.js b/themes/dark/assets/js/common/init.js index de38ed9d11..24fae868f0 100644 --- a/themes/dark/assets/js/common/init.js +++ b/themes/dark/assets/js/common/init.js @@ -77,39 +77,6 @@ MEDUSA.common.init = function() { $(this).parent().find('.triggerhighlight').css('background-color', revertBackgroundColor); // Reverting back to original background-color }); - $.confirm.options = { - confirmButton: 'Yes', - cancelButton: 'Cancel', - dialogClass: 'modal-dialog', - post: false, - confirm(e) { - location.href = e[0].href; - } - }; - - $('a.removeshow').confirm({ - title: 'Remove Show', - text: 'Are you sure you want to remove ' + $('#showtitle').data('showname') + ' from the database?

Check to delete files as well. IRREVERSIBLE', - confirm(e) { - location.href = e[0].href + (document.getElementById('deleteFiles').checked ? '&full=1' : ''); - } - }); - - $('a.clearhistory').confirm({ - title: 'Clear History', - text: 'Are you sure you want to clear all download history?' - }); - - $('a.trimhistory').confirm({ - title: 'Trim History', - text: 'Are you sure you want to trim all download history older than 30 days?' - }); - - $('a.submiterrors').confirm({ - title: 'Submit Errors', - text: 'Are you sure you want to submit these errors ?

Make sure Medusa is updated and trigger
this error with debug enabled before submitting
' - }); - $('#config-components').tabs({ activate(event, ui) { let lastOpenedPanel = $(this).data('lastOpenedPanel'); diff --git a/themes/dark/assets/js/common/init.js.map b/themes/dark/assets/js/common/init.js.map index 8d67978bf0..842d064bbe 100644 --- a/themes/dark/assets/js/common/init.js.map +++ b/themes/dark/assets/js/common/init.js.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["js/common/init.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i' + $('#showtitle').data('showname') + ' from the database?

Check to delete files as well. IRREVERSIBLE',\n confirm: function confirm(e) {\n location.href = e[0].href + (document.getElementById('deleteFiles').checked ? '&full=1' : '');\n }\n });\n\n $('a.clearhistory').confirm({\n title: 'Clear History',\n text: 'Are you sure you want to clear all download history?'\n });\n\n $('a.trimhistory').confirm({\n title: 'Trim History',\n text: 'Are you sure you want to trim all download history older than 30 days?'\n });\n\n $('a.submiterrors').confirm({\n title: 'Submit Errors',\n text: 'Are you sure you want to submit these errors ?

Make sure Medusa is updated and trigger
this error with debug enabled before submitting
'\n });\n\n $('#config-components').tabs({\n activate: function activate(event, ui) {\n var lastOpenedPanel = $(this).data('lastOpenedPanel');\n\n if (!lastOpenedPanel) {\n lastOpenedPanel = $(ui.oldPanel);\n }\n\n if (!$(this).data('topPositionTab')) {\n $(this).data('topPositionTab', $(ui.newPanel).position().top);\n }\n\n // Dont use the builtin fx effects. This will fade in/out both tabs, we dont want that\n // Fadein the new tab yourself\n $(ui.newPanel).hide().fadeIn(0);\n\n if (lastOpenedPanel) {\n // 1. Show the previous opened tab by removing the jQuery UI class\n // 2. Make the tab temporary position:absolute so the two tabs will overlap\n // 3. Set topposition so they will overlap if you go from tab 1 to tab 0\n // 4. Remove position:absolute after animation\n lastOpenedPanel.toggleClass('ui-tabs-hide').css('position', 'absolute').css('top', $(this).data('topPositionTab') + 'px').fadeOut(0, function () {\n $(this).css('position', '');\n });\n }\n\n // Saving the last tab has been opened\n $(this).data('lastOpenedPanel', $(ui.newPanel));\n }\n });\n\n if (MEDUSA.config.fuzzyDating) {\n $.timeago.settings.allowFuture = true;\n $.timeago.settings.strings = {\n prefixAgo: null,\n prefixFromNow: 'In ',\n suffixAgo: 'ago',\n suffixFromNow: '',\n seconds: 'a few seconds',\n minute: 'a minute',\n minutes: '%d minutes',\n hour: 'an hour',\n hours: '%d hours',\n day: 'a day',\n days: '%d days',\n month: 'a month',\n months: '%d months',\n year: 'a year',\n years: '%d years',\n wordSeparator: ' ',\n numbers: []\n };\n $('[datetime]').timeago();\n }\n\n $(document.body).on('click', 'a[data-no-redirect]', function (e) {\n e.preventDefault();\n $.get($(this).attr('href'));\n return false;\n });\n\n $(document.body).on('click', '.bulkCheck', function () {\n var bulkCheck = this;\n var whichBulkCheck = $(bulkCheck).attr('id');\n\n $('.' + whichBulkCheck + ':visible').each(function () {\n $(this).prop('checked', $(bulkCheck).prop('checked'));\n });\n });\n\n $('.enabler').each(function () {\n if (!$(this).prop('checked')) {\n $('#content_' + $(this).attr('id')).hide();\n }\n });\n\n $('.enabler').on('click', function () {\n if ($(this).prop('checked')) {\n $('#content_' + $(this).attr('id')).fadeIn('fast', 'linear');\n } else {\n $('#content_' + $(this).attr('id')).fadeOut('fast', 'linear');\n }\n });\n\n $('.addQTip').each(function () {\n $(this).css({\n 'cursor': 'help', // eslint-disable-line quote-props\n 'text-shadow': '0px 0px 0.5px #666'\n });\n\n var my = $(this).data('qtip-my') || 'left center';\n var at = $(this).data('qtip-at') || 'middle right';\n\n $(this).qtip({\n show: {\n solo: true\n },\n position: {\n my: my,\n at: at\n },\n style: {\n tip: {\n corner: true,\n method: 'polygon'\n },\n classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'\n }\n });\n });\n};\n\n},{}]},{},[1]);\n"],"file":"init.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["js/common/init.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i will be empty\n next();\n });\n\n window.router = router;\n}\n\n},{}]},{},[1]);\n"],"file":"router.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["js/router.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i will be empty\n next();\n });\n\n window.router = router;\n}\n\n},{}]},{},[1]);\n"],"file":"router.js"} \ No newline at end of file diff --git a/themes/dark/assets/js/templates/show-selector.vue b/themes/dark/assets/js/templates/show-selector.vue index af41cc36be..654b8f126e 100644 --- a/themes/dark/assets/js/templates/show-selector.vue +++ b/themes/dark/assets/js/templates/show-selector.vue @@ -22,7 +22,8 @@ module.exports = { }, data() { return { - selectedShowSlug: this.showSlug + selectedShowSlug: this.showSlug, + lock: false }; }, computed: Object.assign(Vuex.mapState(['config', 'shows']), { @@ -69,7 +70,15 @@ module.exports = { } }), watch: { + showSlug(newSlug) { + this.lock = true; + this.selectedShowSlug = newSlug; + }, selectedShowSlug(newSlug) { + if (this.lock) { + this.lock = false; + return; + } const { shows } = this; const selectedShow = shows.find(show => show.id.slug === newSlug); if (!selectedShow) { diff --git a/themes/dark/templates/layouts/main.mako b/themes/dark/templates/layouts/main.mako index 051e620136..87cf498f47 100644 --- a/themes/dark/templates/layouts/main.mako +++ b/themes/dark/templates/layouts/main.mako @@ -61,7 +61,7 @@ % if submenu: - <%include file="/partials/submenu.mako"/> + % endif <%include file="/partials/alerts.mako"/>
@@ -137,6 +137,7 @@ Vue.component('file-browser', httpVueLoader('js/templates/file-browser.vue')); Vue.component('plot-info', httpVueLoader('js/templates/plot-info.vue')); + <%include file="/vue-components/sub-menu.mako"/> <%include file="/vue-components/quality-chooser.mako"/> +<%! + import json +%> + + \ No newline at end of file diff --git a/themes/light/assets/css/style.css b/themes/light/assets/css/style.css index 607b87e37e..281509407e 100644 --- a/themes/light/assets/css/style.css +++ b/themes/light/assets/css/style.css @@ -187,16 +187,6 @@ inc_top.mako clear: both; } -#sub-menu { - font-size: 12px; - padding-top: 2px; -} - -#sub-menu > a { - float: right; - margin-left: 4px; -} - .upgrade-notification { text-align: center; margin-top: 20px; @@ -1176,21 +1166,6 @@ div#col-show-summary { float: left; } -@media (min-width: 1281px) { - #sub-menu-container { - position: fixed; - width: 100%; - top: 51px; - } -} - -@media (max-width: 1281px) { - #sub-menu-container { - position: relative; - margin-top: -24px; - } -} - @media (max-width: 767px) and (min-width: 341px) { .container-navShow { margin-left: 305px; @@ -2997,11 +2972,6 @@ fieldset[disabled] .navbar-default .btn-link:focus { height: auto; } -#sub-menu-container { - z-index: 550; - min-height: 41px; -} - .shadow { box-shadow: 3px 3px 3px rgba(17, 17, 17, 0.5); } diff --git a/themes/light/assets/js/common/init.js b/themes/light/assets/js/common/init.js index de38ed9d11..24fae868f0 100644 --- a/themes/light/assets/js/common/init.js +++ b/themes/light/assets/js/common/init.js @@ -77,39 +77,6 @@ MEDUSA.common.init = function() { $(this).parent().find('.triggerhighlight').css('background-color', revertBackgroundColor); // Reverting back to original background-color }); - $.confirm.options = { - confirmButton: 'Yes', - cancelButton: 'Cancel', - dialogClass: 'modal-dialog', - post: false, - confirm(e) { - location.href = e[0].href; - } - }; - - $('a.removeshow').confirm({ - title: 'Remove Show', - text: 'Are you sure you want to remove ' + $('#showtitle').data('showname') + ' from the database?

Check to delete files as well. IRREVERSIBLE', - confirm(e) { - location.href = e[0].href + (document.getElementById('deleteFiles').checked ? '&full=1' : ''); - } - }); - - $('a.clearhistory').confirm({ - title: 'Clear History', - text: 'Are you sure you want to clear all download history?' - }); - - $('a.trimhistory').confirm({ - title: 'Trim History', - text: 'Are you sure you want to trim all download history older than 30 days?' - }); - - $('a.submiterrors').confirm({ - title: 'Submit Errors', - text: 'Are you sure you want to submit these errors ?

Make sure Medusa is updated and trigger
this error with debug enabled before submitting
' - }); - $('#config-components').tabs({ activate(event, ui) { let lastOpenedPanel = $(this).data('lastOpenedPanel'); diff --git a/themes/light/assets/js/common/init.js.map b/themes/light/assets/js/common/init.js.map index 8d67978bf0..842d064bbe 100644 --- a/themes/light/assets/js/common/init.js.map +++ b/themes/light/assets/js/common/init.js.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["js/common/init.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i' + $('#showtitle').data('showname') + ' from the database?

Check to delete files as well. IRREVERSIBLE',\n confirm: function confirm(e) {\n location.href = e[0].href + (document.getElementById('deleteFiles').checked ? '&full=1' : '');\n }\n });\n\n $('a.clearhistory').confirm({\n title: 'Clear History',\n text: 'Are you sure you want to clear all download history?'\n });\n\n $('a.trimhistory').confirm({\n title: 'Trim History',\n text: 'Are you sure you want to trim all download history older than 30 days?'\n });\n\n $('a.submiterrors').confirm({\n title: 'Submit Errors',\n text: 'Are you sure you want to submit these errors ?

Make sure Medusa is updated and trigger
this error with debug enabled before submitting
'\n });\n\n $('#config-components').tabs({\n activate: function activate(event, ui) {\n var lastOpenedPanel = $(this).data('lastOpenedPanel');\n\n if (!lastOpenedPanel) {\n lastOpenedPanel = $(ui.oldPanel);\n }\n\n if (!$(this).data('topPositionTab')) {\n $(this).data('topPositionTab', $(ui.newPanel).position().top);\n }\n\n // Dont use the builtin fx effects. This will fade in/out both tabs, we dont want that\n // Fadein the new tab yourself\n $(ui.newPanel).hide().fadeIn(0);\n\n if (lastOpenedPanel) {\n // 1. Show the previous opened tab by removing the jQuery UI class\n // 2. Make the tab temporary position:absolute so the two tabs will overlap\n // 3. Set topposition so they will overlap if you go from tab 1 to tab 0\n // 4. Remove position:absolute after animation\n lastOpenedPanel.toggleClass('ui-tabs-hide').css('position', 'absolute').css('top', $(this).data('topPositionTab') + 'px').fadeOut(0, function () {\n $(this).css('position', '');\n });\n }\n\n // Saving the last tab has been opened\n $(this).data('lastOpenedPanel', $(ui.newPanel));\n }\n });\n\n if (MEDUSA.config.fuzzyDating) {\n $.timeago.settings.allowFuture = true;\n $.timeago.settings.strings = {\n prefixAgo: null,\n prefixFromNow: 'In ',\n suffixAgo: 'ago',\n suffixFromNow: '',\n seconds: 'a few seconds',\n minute: 'a minute',\n minutes: '%d minutes',\n hour: 'an hour',\n hours: '%d hours',\n day: 'a day',\n days: '%d days',\n month: 'a month',\n months: '%d months',\n year: 'a year',\n years: '%d years',\n wordSeparator: ' ',\n numbers: []\n };\n $('[datetime]').timeago();\n }\n\n $(document.body).on('click', 'a[data-no-redirect]', function (e) {\n e.preventDefault();\n $.get($(this).attr('href'));\n return false;\n });\n\n $(document.body).on('click', '.bulkCheck', function () {\n var bulkCheck = this;\n var whichBulkCheck = $(bulkCheck).attr('id');\n\n $('.' + whichBulkCheck + ':visible').each(function () {\n $(this).prop('checked', $(bulkCheck).prop('checked'));\n });\n });\n\n $('.enabler').each(function () {\n if (!$(this).prop('checked')) {\n $('#content_' + $(this).attr('id')).hide();\n }\n });\n\n $('.enabler').on('click', function () {\n if ($(this).prop('checked')) {\n $('#content_' + $(this).attr('id')).fadeIn('fast', 'linear');\n } else {\n $('#content_' + $(this).attr('id')).fadeOut('fast', 'linear');\n }\n });\n\n $('.addQTip').each(function () {\n $(this).css({\n 'cursor': 'help', // eslint-disable-line quote-props\n 'text-shadow': '0px 0px 0.5px #666'\n });\n\n var my = $(this).data('qtip-my') || 'left center';\n var at = $(this).data('qtip-at') || 'middle right';\n\n $(this).qtip({\n show: {\n solo: true\n },\n position: {\n my: my,\n at: at\n },\n style: {\n tip: {\n corner: true,\n method: 'polygon'\n },\n classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'\n }\n });\n });\n};\n\n},{}]},{},[1]);\n"],"file":"init.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["js/common/init.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i will be empty\n next();\n });\n\n window.router = router;\n}\n\n},{}]},{},[1]);\n"],"file":"router.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["js/router.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i will be empty\n next();\n });\n\n window.router = router;\n}\n\n},{}]},{},[1]);\n"],"file":"router.js"} \ No newline at end of file diff --git a/themes/light/assets/js/templates/show-selector.vue b/themes/light/assets/js/templates/show-selector.vue index af41cc36be..654b8f126e 100644 --- a/themes/light/assets/js/templates/show-selector.vue +++ b/themes/light/assets/js/templates/show-selector.vue @@ -22,7 +22,8 @@ module.exports = { }, data() { return { - selectedShowSlug: this.showSlug + selectedShowSlug: this.showSlug, + lock: false }; }, computed: Object.assign(Vuex.mapState(['config', 'shows']), { @@ -69,7 +70,15 @@ module.exports = { } }), watch: { + showSlug(newSlug) { + this.lock = true; + this.selectedShowSlug = newSlug; + }, selectedShowSlug(newSlug) { + if (this.lock) { + this.lock = false; + return; + } const { shows } = this; const selectedShow = shows.find(show => show.id.slug === newSlug); if (!selectedShow) { diff --git a/themes/light/templates/layouts/main.mako b/themes/light/templates/layouts/main.mako index 051e620136..87cf498f47 100644 --- a/themes/light/templates/layouts/main.mako +++ b/themes/light/templates/layouts/main.mako @@ -61,7 +61,7 @@ % if submenu: - <%include file="/partials/submenu.mako"/> + % endif <%include file="/partials/alerts.mako"/>
@@ -137,6 +137,7 @@ Vue.component('file-browser', httpVueLoader('js/templates/file-browser.vue')); Vue.component('plot-info', httpVueLoader('js/templates/plot-info.vue')); + <%include file="/vue-components/sub-menu.mako"/> <%include file="/vue-components/quality-chooser.mako"/> +<%! + import json +%> + + \ No newline at end of file