|
|
@ -1,37 +1,23 @@
|
|
|
|
window.QualityProfilesView = Backbone.View.extend({
|
|
|
|
QualityProfileView = Backbone.Marionette.ItemView.extend({
|
|
|
|
|
|
|
|
tagName: "div",
|
|
|
|
initialize: function () {
|
|
|
|
className: "quality-profile",
|
|
|
|
this.render();
|
|
|
|
template: "#QualityProfileTemplate"
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render: function () {
|
|
|
|
|
|
|
|
var profiles = this.model.models;
|
|
|
|
|
|
|
|
var len = profiles.length;
|
|
|
|
|
|
|
|
var startPos = (this.options.page - 1) * 8;
|
|
|
|
|
|
|
|
var endPos = Math.min(startPos + 8, len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(this.el).html('<ul class="thumbnails"></ul>');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = startPos; i < endPos; i++) {
|
|
|
|
|
|
|
|
$('.thumbnails', this.el).append(new QualityProfileView({ model: profiles[i] }).render().el);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
window.QualityProfileView = Backbone.View.extend({
|
|
|
|
QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
|
|
|
|
|
|
|
|
tagName: "div",
|
|
|
|
|
|
|
|
id: "quality-profile-collection",
|
|
|
|
|
|
|
|
itemView: QualityProfileView,
|
|
|
|
|
|
|
|
template: QualityProfileApp.Constants.Templates.QualityProfileCollection,
|
|
|
|
|
|
|
|
|
|
|
|
tagName: "li",
|
|
|
|
//appendHtml: function (collectionView, itemView) {
|
|
|
|
|
|
|
|
// collectionView.$('#collection').append(itemView.el);
|
|
|
|
|
|
|
|
//},
|
|
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function () {
|
|
|
|
this.model.bind("change", this.render, this);
|
|
|
|
_.bindAll(this, 'render');
|
|
|
|
this.model.bind("destroy", this.close, this);
|
|
|
|
this.collection = new QualityProfileCollection();
|
|
|
|
},
|
|
|
|
this.collection.fetch();
|
|
|
|
|
|
|
|
this.collection.bind('reset', this.render);
|
|
|
|
render: function () {
|
|
|
|
|
|
|
|
$(this.el).html(this.template(this.model.toJSON()));
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|