diff --git a/src/UI/Content/icons.less b/src/UI/Content/icons.less index 14f35d6dd..734245993 100644 --- a/src/UI/Content/icons.less +++ b/src/UI/Content/icons.less @@ -87,6 +87,11 @@ color: #b94a48; } +.icon-nd-form-info-link:before { + .clickable; + .icon(@question-sign); +} + .icon-nd-donate:before { .icon(@heart); color: @nzbdroneRed; diff --git a/src/UI/Settings/MediaManagement/Naming/NamingView.js b/src/UI/Settings/MediaManagement/Naming/NamingView.js index b94654287..27e5d5945 100644 --- a/src/UI/Settings/MediaManagement/Naming/NamingView.js +++ b/src/UI/Settings/MediaManagement/Naming/NamingView.js @@ -1,11 +1,12 @@ 'use strict'; define( [ + 'jquery', 'vent', 'marionette', 'Settings/MediaManagement/Naming/NamingSampleModel', 'Mixins/AsModelBoundView' - ], function (vent, Marionette, NamingSampleModel, AsModelBoundView) { + ], function ($, vent, Marionette, NamingSampleModel, AsModelBoundView) { var view = Marionette.ItemView.extend({ template: 'Settings/MediaManagement/Naming/NamingViewTemplate', @@ -15,12 +16,14 @@ define( renameEpisodesCheckbox: '.x-rename-episodes', singleEpisodeExample : '.x-single-episode-example', multiEpisodeExample : '.x-multi-episode-example', - dailyEpisodeExample : '.x-daily-episode-example' + dailyEpisodeExample : '.x-daily-episode-example', + namingTokenHelper : '.x-naming-token-helper' }, events: { - 'change .x-rename-episodes': '_setFailedDownloadOptionsVisibility', - 'click .x-show-wizard' : '_showWizard' + 'change .x-rename-episodes' : '_setFailedDownloadOptionsVisibility', + 'click .x-show-wizard' : '_showWizard', + 'click .x-naming-token-helper a' : '_addToken' }, onRender: function () { @@ -58,6 +61,28 @@ define( _showWizard: function () { vent.trigger(vent.Commands.ShowNamingWizard, { model: this.model }); + }, + + _addToken: function (e) { + e.preventDefault(); + e.stopPropagation(); + + var target = e.target; + var token = ''; + var input = $(target).closest('.x-helper-input').children('input'); + + if ($(target).attr('data-token')) { + token = '{{0}}'.format($(target).attr('data-token')); + } + + else { + token = $(target).attr('data-separator'); + } + + input.val(input.val() + token); + + this.ui.namingTokenHelper.removeClass('open'); + input.focus(); } }); diff --git a/src/UI/Settings/MediaManagement/Naming/NamingViewTemplate.html b/src/UI/Settings/MediaManagement/Naming/NamingViewTemplate.html index 037333fe0..8dc1d9c36 100644 --- a/src/UI/Settings/MediaManagement/Naming/NamingViewTemplate.html +++ b/src/UI/Settings/MediaManagement/Naming/NamingViewTemplate.html @@ -39,7 +39,25 @@
- +
+ +
+ + +
+
+ + +
@@ -47,7 +65,26 @@
- +
+ +
+ + +
+
+ + +
diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/AirDateNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/AirDateNamingPartial.html new file mode 100644 index 000000000..ed845e2c0 --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/AirDateNamingPartial.html @@ -0,0 +1,9 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeNamingPartial.html new file mode 100644 index 000000000..c56795719 --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeNamingPartial.html @@ -0,0 +1,7 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeTitleNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeTitleNamingPartial.html new file mode 100644 index 000000000..d4ae003d6 --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/EpisodeTitleNamingPartial.html @@ -0,0 +1,8 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/QualityTitleNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/QualityTitleNamingPartial.html new file mode 100644 index 000000000..4fe8dc65e --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/QualityTitleNamingPartial.html @@ -0,0 +1,8 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/SeasonNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/SeasonNamingPartial.html new file mode 100644 index 000000000..1174a055d --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/SeasonNamingPartial.html @@ -0,0 +1,7 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/SeparatorNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/SeparatorNamingPartial.html new file mode 100644 index 000000000..eb2abe61a --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/SeparatorNamingPartial.html @@ -0,0 +1,10 @@ + diff --git a/src/UI/Settings/MediaManagement/Naming/Partials/SeriesTitleNamingPartial.html b/src/UI/Settings/MediaManagement/Naming/Partials/SeriesTitleNamingPartial.html new file mode 100644 index 000000000..f2cd5fd81 --- /dev/null +++ b/src/UI/Settings/MediaManagement/Naming/Partials/SeriesTitleNamingPartial.html @@ -0,0 +1,8 @@ +