mirror of https://github.com/Radarr/Radarr
New: Show naming format on rename preview
This commit is contained in:
parent
b1871c1686
commit
50b843a422
|
@ -0,0 +1,27 @@
|
||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'vent',
|
||||||
|
'marionette',
|
||||||
|
'Settings/MediaManagement/Naming/NamingModel'
|
||||||
|
], function (vent, Marionette, NamingModel) {
|
||||||
|
return Marionette.ItemView.extend({
|
||||||
|
template: 'Rename/RenamePreviewFormatViewTemplate',
|
||||||
|
|
||||||
|
templateHelpers: function () {
|
||||||
|
var type = this.model.get('seriesType');
|
||||||
|
|
||||||
|
return {
|
||||||
|
rename : this.naming.get('renameEpisodes'),
|
||||||
|
format : this.naming.get(type + 'EpisodeFormat')
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function () {
|
||||||
|
this.naming = new NamingModel();
|
||||||
|
this.naming.fetch();
|
||||||
|
|
||||||
|
this.listenTo(this.naming, 'sync', this.render);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,5 @@
|
||||||
|
<span class="file-name-format">
|
||||||
|
{{#if rename}}
|
||||||
|
{{format}}
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
|
@ -7,22 +7,32 @@ define(
|
||||||
'Rename/RenamePreviewCollection',
|
'Rename/RenamePreviewCollection',
|
||||||
'Rename/RenamePreviewCollectionView',
|
'Rename/RenamePreviewCollectionView',
|
||||||
'Rename/RenamePreviewEmptyCollectionView',
|
'Rename/RenamePreviewEmptyCollectionView',
|
||||||
|
'Rename/RenamePreviewFormatView',
|
||||||
'Shared/LoadingView',
|
'Shared/LoadingView',
|
||||||
'Commands/CommandController'
|
'Commands/CommandController'
|
||||||
], function (_, vent, Marionette, RenamePreviewCollection, RenamePreviewCollectionView, EmptyCollectionView, LoadingView, CommandController) {
|
], function (_,
|
||||||
|
vent,
|
||||||
|
Marionette,
|
||||||
|
RenamePreviewCollection,
|
||||||
|
RenamePreviewCollectionView,
|
||||||
|
EmptyCollectionView,
|
||||||
|
RenamePreviewFormatView,
|
||||||
|
LoadingView,
|
||||||
|
CommandController) {
|
||||||
|
|
||||||
return Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
className : 'modal-lg',
|
className : 'modal-lg',
|
||||||
template : 'Rename/RenamePreviewLayoutTemplate',
|
template : 'Rename/RenamePreviewLayoutTemplate',
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
renamePreviews : '#rename-previews'
|
renamePreviews : '#rename-previews',
|
||||||
|
formatRegion : '.x-format-region'
|
||||||
},
|
},
|
||||||
|
|
||||||
ui: {
|
ui: {
|
||||||
pathInfo : '.x-path-info',
|
pathInfo : '.x-path-info',
|
||||||
renameAll : '.x-rename-all',
|
renameAll : '.x-rename-all',
|
||||||
checkboxIcon: '.x-rename-all-button i'
|
checkboxIcon : '.x-rename-all-button i'
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
@ -47,6 +57,7 @@ define(
|
||||||
|
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
this.renamePreviews.show(new LoadingView());
|
this.renamePreviews.show(new LoadingView());
|
||||||
|
this.formatRegion.show(new RenamePreviewFormatView({ model: this.model }));
|
||||||
},
|
},
|
||||||
|
|
||||||
_showPreviews: function () {
|
_showPreviews: function () {
|
||||||
|
|
|
@ -9,9 +9,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="alert alert-info path-info x-path-info">All paths are relative to: <strong>{{path}}</strong></div>
|
<div class="alert alert-info path-info x-path-info">All paths are relative to: <strong>{{path}}</strong></div>
|
||||||
|
|
||||||
<div id="rename-previews"></div>
|
<div id="rename-previews"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
||||||
<span class="rename-all-button x-rename-all-button pull-left">
|
<span class="rename-all-button x-rename-all-button pull-left">
|
||||||
<label class="checkbox-button" title="Toggle all">
|
<label class="checkbox-button" title="Toggle all">
|
||||||
<input type="checkbox" checked="checked" class="x-rename-all"/>
|
<input type="checkbox" checked="checked" class="x-rename-all"/>
|
||||||
|
@ -20,6 +23,8 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="x-format-region pull-left"></span>
|
||||||
|
|
||||||
<button class="btn" data-dismiss="modal">close</button>
|
<button class="btn" data-dismiss="modal">close</button>
|
||||||
<button class="btn btn-primary x-organize">Organize</button>
|
<button class="btn btn-primary x-organize">Organize</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -51,3 +51,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.file-name-format {
|
||||||
|
color : #8c8c8c;
|
||||||
|
margin-left : 25px;
|
||||||
|
margin-top : 6px;
|
||||||
|
display : inline-block;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue