define([ 'jquery', 'underscore', 'backbone', 'common' ], function($, _, Backbone, Common) { 'use strict'; var GroupChangeItemView = Backbone.View.extend({ tagName: 'tr', template: _.template($('#group-change-item-tmpl').html()), events: { 'click .lsch': 'showDetail' }, render: function() { this.$el.html(this.template(this.model.toJSON())); return this; }, showDetail: function() { console.log(this.model); // TODO: if repo is encrypted, and not set password, show decrypt // form, else show details var model = this.model; var url = app.config.siteRoot + 'ajax/repo/' + model.get("repo").id + '/history/changes/' + "?commit_id=" + model.get("id"); var loadingHtml = '
' + model.get("ctime") + '
'; var con = ''; function show(data_, hd) { if (data_.length > 0) { con += '' + Common.HTMLescape(data['cmt_desc']) + '
'; } } $('#ls-ch').css('text-align','left').html(heading + time + con); $(window).resize(); }, error: function() { $('#ls-ch').html("Unknown error."); setTimeout(function() { $.modal.close(); }, 2500); } }); } }); return GroupChangeItemView; });