New: Show naming format on rename preview

This commit is contained in:
Mark McDowall 2015-01-23 18:42:28 -08:00
parent b1871c1686
commit 50b843a422
5 changed files with 57 additions and 3 deletions

View File

@ -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);
}
});
});

View File

@ -0,0 +1,5 @@
<span class="file-name-format">
{{#if rename}}
{{format}}
{{/if}}
</span>

View File

@ -7,22 +7,32 @@ define(
'Rename/RenamePreviewCollection',
'Rename/RenamePreviewCollectionView',
'Rename/RenamePreviewEmptyCollectionView',
'Rename/RenamePreviewFormatView',
'Shared/LoadingView',
'Commands/CommandController'
], function (_, vent, Marionette, RenamePreviewCollection, RenamePreviewCollectionView, EmptyCollectionView, LoadingView, CommandController) {
], function (_,
vent,
Marionette,
RenamePreviewCollection,
RenamePreviewCollectionView,
EmptyCollectionView,
RenamePreviewFormatView,
LoadingView,
CommandController) {
return Marionette.Layout.extend({
className : 'modal-lg',
template : 'Rename/RenamePreviewLayoutTemplate',
regions: {
renamePreviews : '#rename-previews'
renamePreviews : '#rename-previews',
formatRegion : '.x-format-region'
},
ui: {
pathInfo : '.x-path-info',
renameAll : '.x-rename-all',
checkboxIcon: '.x-rename-all-button i'
checkboxIcon : '.x-rename-all-button i'
},
events: {
@ -47,6 +57,7 @@ define(
onRender: function() {
this.renamePreviews.show(new LoadingView());
this.formatRegion.show(new RenamePreviewFormatView({ model: this.model }));
},
_showPreviews: function () {

View File

@ -9,9 +9,12 @@
</div>
<div class="modal-body">
<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>
<div class="modal-footer">
<span class="rename-all-button x-rename-all-button pull-left">
<label class="checkbox-button" title="Toggle all">
<input type="checkbox" checked="checked" class="x-rename-all"/>
@ -20,6 +23,8 @@
</div>
</label>
</span>
<span class="x-format-region pull-left"></span>
<button class="btn" data-dismiss="modal">close</button>
<button class="btn btn-primary x-organize">Organize</button>
</div>

View File

@ -51,3 +51,9 @@
}
}
.file-name-format {
color : #8c8c8c;
margin-left : 25px;
margin-top : 6px;
display : inline-block;
}