mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
Split js from django template, move js to scripts , add requirejs support, and i18n for js
This commit is contained in:
27
media/scripts/app/views/repos.js
Normal file
27
media/scripts/app/views/repos.js
Normal file
@@ -0,0 +1,27 @@
|
||||
define([
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'text!' + app.config._tmplRoot + 'repos.html'
|
||||
], function($, _, Backbone, reposTemplate) {
|
||||
'use strict';
|
||||
|
||||
var RepoView = Backbone.View.extend({
|
||||
tagName: 'tr',
|
||||
|
||||
template: _.template(reposTemplate),
|
||||
|
||||
initialize: function() {
|
||||
console.log('init RepoView');
|
||||
Backbone.View.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return RepoView;
|
||||
});
|
Reference in New Issue
Block a user