1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-20 20:32:44 +00:00
seahub/static/scripts/sysadmin-app/views/admin-log.js

39 lines
844 B
JavaScript
Raw Normal View History

2017-03-09 09:42:59 +00:00
define([
'jquery',
'underscore',
'backbone',
'common',
'moment',
'app/views/widgets/hl-item-view'
], function($, _, Backbone, Common, Moment, HLItemView) {
'use strict';
var AdminLogView = HLItemView.extend({
tagName: 'tr',
template: _.template($('#admin-log-item-tmpl').html()),
events: {
},
initialize: function() {
HLItemView.prototype.initialize.call(this);
},
render: function() {
var data = this.model.toJSON(),
created_at = Moment(data['datetime']);
data['time'] = created_at.format('LLLL');
data['time_from_now'] = Common.getRelativeTimeStr(created_at);
this.$el.html(this.template(data));
return this;
}
});
return AdminLogView;
});