diff --git a/seahub/templates/base_for_backbone.html b/seahub/templates/base_for_backbone.html
index a2d3d23d8d..aba1f512f1 100644
--- a/seahub/templates/base_for_backbone.html
+++ b/seahub/templates/base_for_backbone.html
@@ -146,6 +146,7 @@
{% include 'footer.html' %}
+ {% include 'js/templates.html' %}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/seahub/templates/pubrepo.html b/seahub/templates/pubrepo.html
index 925fcbba1c..1bebe8a1c2 100644
--- a/seahub/templates/pubrepo.html
+++ b/seahub/templates/pubrepo.html
@@ -1,6 +1,7 @@
{% extends 'base_for_backbone.html' %}
{% load seahub_tags avatar_tags i18n %}
{% load url from future %}
+{% load staticfiles %}
{% block sub_title %}{% trans "Organization" %} - {% endblock %}
@@ -64,5 +65,9 @@ app["pageOptions"] = {
is_staff: {% if request.user.is_staff %} true {% else %} false {% endif %}
};
-
+{% if debug %}
+
+{% else %}
+
+{% endif %}
{% endblock %}
diff --git a/static/scripts/app/views/add-group-repo.js b/static/scripts/app/views/add-group-repo.js
index 577b88a1c8..2cb6664325 100644
--- a/static/scripts/app/views/add-group-repo.js
+++ b/static/scripts/app/views/add-group-repo.js
@@ -4,9 +4,8 @@ define([
'underscore',
'backbone',
'common',
- 'app/views/add-repo',
- 'text!' + app.config._tmplRoot + 'create-repo.html'
-], function($, simplemodal, _, Backbone, Common, AddRepoView, CreateRepoTemplate) {
+ 'app/views/add-repo'
+], function($, simplemodal, _, Backbone, Common, AddRepoView) {
'use strict';
var AddGroupRepoView = AddRepoView.extend({
diff --git a/static/scripts/app/views/add-repo.js b/static/scripts/app/views/add-repo.js
index 262b531df0..0ffdd2a848 100644
--- a/static/scripts/app/views/add-repo.js
+++ b/static/scripts/app/views/add-repo.js
@@ -3,16 +3,15 @@ define([
'simplemodal',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'create-repo.html'
-], function($, simplemodal, _, Backbone, Common, CreateRepoTemplate) {
+ 'common'
+], function($, simplemodal, _, Backbone, Common) {
'use strict';
var AddRepoView = Backbone.View.extend({
tagName: 'div',
- template: _.template(CreateRepoTemplate),
+ template: _.template($('#create-repo-tmpl').html()),
initialize: function(repos) {
this.repos = repos;
diff --git a/static/scripts/app/views/dir.js b/static/scripts/app/views/dir.js
index dd09d1aadf..c10e6844d7 100644
--- a/static/scripts/app/views/dir.js
+++ b/static/scripts/app/views/dir.js
@@ -9,18 +9,16 @@ define([
'app/collections/dirents',
'app/views/dirent',
'app/views/fileupload',
- 'app/views/share',
- 'text!' + app.config._tmplRoot + 'dir-op-bar.html',
- 'text!' + app.config._tmplRoot + 'path-bar.html',
+ 'app/views/share'
], function($, progressbar, simplemodal, _, Backbone, Common, FileTree, DirentCollection, DirentView,
- FileUploadView, ShareView, DirOpBarTemplate, PathBarTemplate) {
+ FileUploadView, ShareView) {
'use strict';
var DirView = Backbone.View.extend({
el: $('#dir-view'),
- path_bar_template: _.template(PathBarTemplate),
- dir_op_bar_template: _.template(DirOpBarTemplate),
+ path_bar_template: _.template($('#path-bar-tmpl').html()),
+ dir_op_bar_template: _.template($('#dir-op-bar-tmpl').html()),
newDirTemplate: _.template($("#add-new-dir-form-template").html()),
newFileTemplate: _.template($("#add-new-file-form-template").html()),
mvcpTemplate: _.template($("#mvcp-form-template").html()),
diff --git a/static/scripts/app/views/dirent.js b/static/scripts/app/views/dirent.js
index 829e42f168..77ad68edf3 100644
--- a/static/scripts/app/views/dirent.js
+++ b/static/scripts/app/views/dirent.js
@@ -4,9 +4,8 @@ define([
'backbone',
'common',
'file-tree',
- 'app/views/share',
- 'text!' + app.config._tmplRoot + 'dirent.html'
-], function($, _, Backbone, Common, FileTree, ShareView, direntTemplate) {
+ 'app/views/share'
+], function($, _, Backbone, Common, FileTree, ShareView) {
'use strict';
app = app || {};
@@ -15,7 +14,7 @@ define([
var DirentView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(direntTemplate),
+ template: _.template($('#dirent-tmpl').html()),
renameTemplate: _.template($("#rename-form-template").html()),
mvcpTemplate: _.template($("#mvcp-form-template").html()),
mvProgressTemplate: _.template($("#mv-progress-popup-template").html()),
diff --git a/static/scripts/app/views/group-change-items.js b/static/scripts/app/views/group-change-items.js
index 74518780a0..209b54cf42 100644
--- a/static/scripts/app/views/group-change-items.js
+++ b/static/scripts/app/views/group-change-items.js
@@ -2,15 +2,14 @@ define([
'jquery',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'group-change-item.html'
-], function($, _, Backbone, Common, changeItemTemplate) {
+ 'common'
+], function($, _, Backbone, Common) {
'use strict';
var GroupChangeItemView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(changeItemTemplate),
+ template: _.template($('#group-change-item-tmpl').html()),
events: {
'click .lsch': 'showDetail'
diff --git a/static/scripts/app/views/group-nav.js b/static/scripts/app/views/group-nav.js
index 76a3e25906..e1145d8fa5 100644
--- a/static/scripts/app/views/group-nav.js
+++ b/static/scripts/app/views/group-nav.js
@@ -3,15 +3,14 @@ define([
'underscore',
'backbone',
'common',
- 'app/collections/groups',
- 'text!' + app.config._tmplRoot + 'group-nav.html',
+ 'app/collections/groups'
], function($, _, Backbone, Common, GroupCollection, GroupNavTemplate) {
'use strict';
var GroupNavView = Backbone.View.extend({
el: '#header-inner',
- template: _.template(GroupNavTemplate),
+ template: _.template($('#group-nav-tmpl').html()),
initialize: function(options) {
this.$topNavGrp = this.$('#top-nav-grp');
diff --git a/static/scripts/app/views/group-repos.js b/static/scripts/app/views/group-repos.js
index 8a99656a74..6a1f067c70 100644
--- a/static/scripts/app/views/group-repos.js
+++ b/static/scripts/app/views/group-repos.js
@@ -2,15 +2,14 @@ define([
'jquery',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'group-repos.html'
-], function($, _, Backbone, Common, reposTemplate) {
+ 'common'
+], function($, _, Backbone, Common) {
'use strict';
var GroupRepoView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(reposTemplate),
+ template: _.template($('#group-repos-tmpl').html()),
events: {
'mouseenter': 'showAction',
diff --git a/static/scripts/app/views/organization-repo.js b/static/scripts/app/views/organization-repo.js
index 49d78f040f..708f29c5de 100644
--- a/static/scripts/app/views/organization-repo.js
+++ b/static/scripts/app/views/organization-repo.js
@@ -2,15 +2,14 @@ define([
'jquery',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'organization-repo.html'
-], function($, _, Backbone, Common, reposTemplate) {
+ 'common'
+], function($, _, Backbone, Common) {
'use strict';
var OrganizationRepoView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(reposTemplate),
+ template: _.template($('#organization-repos-tmpl').html()),
events: {
'mouseenter': 'showAction',
diff --git a/static/scripts/app/views/repo.js b/static/scripts/app/views/repo.js
index f7cee6994e..da1fc16934 100644
--- a/static/scripts/app/views/repo.js
+++ b/static/scripts/app/views/repo.js
@@ -3,15 +3,14 @@ define([
'underscore',
'backbone',
'common',
- 'app/views/share',
- 'text!' + app.config._tmplRoot + 'repo.html'
-], function($, _, Backbone, Common, ShareView, repoTemplate) {
+ 'app/views/share'
+], function($, _, Backbone, Common, ShareView) {
'use strict';
var RepoView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(repoTemplate),
+ template: _.template($('#repo-tmpl').html()),
repoDelConfirmTemplate: _.template($('#repo-del-confirm-template').html()),
events: {
diff --git a/static/scripts/app/views/share.js b/static/scripts/app/views/share.js
index a63333805b..4f50216ff7 100644
--- a/static/scripts/app/views/share.js
+++ b/static/scripts/app/views/share.js
@@ -4,15 +4,14 @@ define([
'backbone',
'common',
'jquery.ui.tabs',
- 'select2',
- 'text!' + app.config._tmplRoot + 'share-popup.html',
-], function($, _, Backbone, Common, Tabs, Select2, SharePopupTemplate) {
+ 'select2'
+], function($, _, Backbone, Common, Tabs, Select2) {
'use strict';
var SharePopupView = Backbone.View.extend({
tagName: 'div',
id: 'share-popup',
- template: _.template(SharePopupTemplate),
+ template: _.template($('#share-popup-tmpl').html()),
initialize: function(options) {
this.is_repo_owner = options.is_repo_owner;
diff --git a/static/scripts/app/views/shared-repo.js b/static/scripts/app/views/shared-repo.js
index 49d804abe0..872634723f 100644
--- a/static/scripts/app/views/shared-repo.js
+++ b/static/scripts/app/views/shared-repo.js
@@ -2,15 +2,14 @@ define([
'jquery',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'shared-repo.html'
-], function($, _, Backbone, Common, reposTemplate) {
+ 'common'
+], function($, _, Backbone, Common) {
'use strict';
var SharedRepoView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(reposTemplate),
+ template: _.template($('#shared-repo-tmpl').html()),
events: {
'mouseenter': 'showAction',
diff --git a/static/scripts/app/views/sub-lib.js b/static/scripts/app/views/sub-lib.js
index d5cfb668e7..4ae7dc4a5c 100644
--- a/static/scripts/app/views/sub-lib.js
+++ b/static/scripts/app/views/sub-lib.js
@@ -2,15 +2,14 @@ define([
'jquery',
'underscore',
'backbone',
- 'common',
- 'text!' + app.config._tmplRoot + 'sub-lib.html'
-], function($, _, Backbone, Common, repoTemplate) {
+ 'common'
+], function($, _, Backbone, Common) {
'use strict';
var RepoView = Backbone.View.extend({
tagName: 'tr',
- template: _.template(repoTemplate),
+ template: _.template($('#sub-lib-tmpl').html()),
repoDelConfirmTemplate: _.template($('#repo-del-confirm-template').html()),
events: {