2013-06-25 04:43:16 +00:00
|
|
|
|
'use strict';
|
2013-06-24 23:41:59 +00:00
|
|
|
|
|
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'app',
|
|
|
|
|
'marionette',
|
|
|
|
|
'Settings/Quality/Profile/EditQualityProfileView',
|
|
|
|
|
'Settings/Quality/Profile/DeleteView',
|
2013-06-25 00:41:32 +00:00
|
|
|
|
'Mixins/AsModelBoundView',
|
|
|
|
|
'Settings/Quality/Profile/AllowedLabeler'
|
2013-06-24 23:41:59 +00:00
|
|
|
|
|
|
|
|
|
], function (App, Marionette, EditProfileView, DeleteProfileView, AsModelBoundView) {
|
|
|
|
|
|
|
|
|
|
var view = Marionette.ItemView.extend({
|
|
|
|
|
template: 'Settings/Quality/Profile/QualityProfileTemplate',
|
2013-06-25 00:41:32 +00:00
|
|
|
|
tagName : 'li',
|
2013-06-24 23:41:59 +00:00
|
|
|
|
|
|
|
|
|
ui: {
|
|
|
|
|
'progressbar': '.progress .bar'
|
|
|
|
|
},
|
2013-06-24 04:48:47 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
events: {
|
2013-06-25 00:41:32 +00:00
|
|
|
|
'click .x-edit' : '_editProfile',
|
|
|
|
|
'click .x-delete': '_deleteProfile'
|
2013-06-24 23:41:59 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-06-25 07:21:10 +00:00
|
|
|
|
initialize: function () {
|
|
|
|
|
this.listenTo(this.model, 'sync', this.render);
|
|
|
|
|
},
|
|
|
|
|
|
2013-06-25 00:41:32 +00:00
|
|
|
|
_editProfile: function () {
|
2013-06-25 07:21:10 +00:00
|
|
|
|
var view = new EditProfileView({ model: this.model, profileCollection: this.model.collection });
|
2013-06-24 23:41:59 +00:00
|
|
|
|
App.modalRegion.show(view);
|
|
|
|
|
},
|
|
|
|
|
|
2013-06-25 00:41:32 +00:00
|
|
|
|
_deleteProfile: function () {
|
2013-06-24 23:41:59 +00:00
|
|
|
|
var view = new DeleteProfileView({ model: this.model });
|
|
|
|
|
App.modalRegion.show(view);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return AsModelBoundView.call(view);
|
|
|
|
|
});
|