1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 21:30:39 +00:00

upate render repo table thead

This commit is contained in:
lian
2015-05-11 18:39:21 +08:00
parent 97bbf0156d
commit f725506262
5 changed files with 30 additions and 6 deletions

View File

@@ -698,7 +698,7 @@
<img src="{{MEDIA_URL}}img/rm.png" alt="" class="unstar op-icon vh" title="{% trans "Unstar" %}" /> <img src="{{MEDIA_URL}}img/rm.png" alt="" class="unstar op-icon vh" title="{% trans "Unstar" %}" />
</td> </td>
</script> </script>
<script type="text/template" id="my-repo-thead-tmpl"> <script type="text/template" id="my-repos-hd-tmpl">
<tr> <tr>
<th width="4%"><!--icon--></th> <th width="4%"><!--icon--></th>
<th width="46%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th> <th width="46%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th>
@@ -707,7 +707,7 @@
<th width="20%">{% trans "Last Update" %} <span class="by-time icon-caret-down cspt"></span></th> <th width="20%">{% trans "Last Update" %} <span class="by-time icon-caret-down cspt"></span></th>
</tr> </tr>
</script> </script>
<script type="text/template" id="shared-repo-thead-tmpl"> <script type="text/template" id="shared-repos-hd-tmpl">
<tr> <tr>
<th width="4%"><!--icon--></th> <th width="4%"><!--icon--></th>
<th width="40%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th> <th width="40%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th>

View File

@@ -14,6 +14,8 @@ define([
var GroupView = Backbone.View.extend({ var GroupView = Backbone.View.extend({
el: '#main', el: '#main',
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
events: { events: {
'click #group-repo-tabs .repo-create': 'createRepo', 'click #group-repo-tabs .repo-create': 'createRepo',
'click #grp-repos .by-name': 'sortByName', 'click #grp-repos .by-name': 'sortByName',
@@ -50,8 +52,12 @@ define([
} }
}, },
renderReposHd: function() {
this.$tableHead.html(this.reposHdTemplate());
},
reset: function() { reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html())) this.renderReposHd();
this.$tableBody.empty(); this.$tableBody.empty();
this.repos.each(this.addOne, this); this.repos.each(this.addOne, this);
this.$loadingTip.hide(); this.$loadingTip.hide();

View File

@@ -12,6 +12,8 @@ define([
var ReposView = Backbone.View.extend({ var ReposView = Backbone.View.extend({
el: $('#repo-tabs'), el: $('#repo-tabs'),
reposHdTemplate: _.template($('#my-repos-hd-tmpl').html()),
events: { events: {
'click .repo-create': 'createRepo', 'click .repo-create': 'createRepo',
'click #my-own-repos .by-name': 'sortByName', 'click #my-own-repos .by-name': 'sortByName',
@@ -41,8 +43,12 @@ define([
} }
}, },
renderReposHd: function() {
this.$tableHead.html(this.reposHdTemplate());
},
reset: function() { reset: function() {
this.$tableHead.html(_.template($('#my-repo-thead-tmpl').html())) this.renderReposHd();
this.$tableBody.empty(); this.$tableBody.empty();
this.repos.each(this.addOne, this); this.repos.each(this.addOne, this);
if (this.repos.length) { if (this.repos.length) {

View File

@@ -11,6 +11,8 @@ define([
var SharedReposView = Backbone.View.extend({ var SharedReposView = Backbone.View.extend({
el: $('#repo-tabs'), el: $('#repo-tabs'),
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
initialize: function(options) { initialize: function(options) {
this.$tabs = $('#repo-tabs'); this.$tabs = $('#repo-tabs');
this.$table = $('#repos-shared-to-me table'); this.$table = $('#repos-shared-to-me table');
@@ -33,8 +35,12 @@ define([
} }
}, },
renderReposHd: function() {
this.$tableHead.html(this.reposHdTemplate());
},
reset: function() { reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html())) this.renderReposHd();
this.$tableBody.empty(); this.$tableBody.empty();
this.repos.each(this.addOne, this); this.repos.each(this.addOne, this);
if (this.repos.length) { if (this.repos.length) {

View File

@@ -13,6 +13,8 @@ define([
var OrganizationView = Backbone.View.extend({ var OrganizationView = Backbone.View.extend({
el: '#main', el: '#main',
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
initialize: function(options) { initialize: function(options) {
this.$sideNav = $('#org-side-nav'); this.$sideNav = $('#org-side-nav');
@@ -49,8 +51,12 @@ define([
} }
}, },
renderReposHd: function() {
this.$tableHead.html(this.reposHdTemplate());
},
reset: function() { reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html())) this.renderReposHd();
this.$tableBody.empty(); this.$tableBody.empty();
this.repos.each(this.addOne, this); this.repos.each(this.addOne, this);
if (this.repos.length) { if (this.repos.length) {