1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

render repo table head when reset repo collection

This commit is contained in:
lian
2015-05-11 17:30:11 +08:00
parent 9ea129e9d2
commit 97bbf0156d
6 changed files with 29 additions and 46 deletions

View File

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

View File

@@ -65,15 +65,7 @@
<div id="my-own-repos">
<table class="hide">
<thead>
<tr>
<th width="4%"><!--icon--></th>
<th width="46%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th>
<th width="10%"><!--op--></th>
<th width="20%">{% trans "Size" %}</th>
<th width="20%">{% trans "Last Update" %} <span class="by-time icon-caret-down cspt"></span></th>
</tr>
</thead>
<thead></thead>
<tbody></tbody>
</table>
<div class="empty-tips hide">
@@ -103,16 +95,7 @@
<div id="repos-shared-to-me">
<table class="hide">
<thead>
<tr>
<th width="4%"><!--icon--></th>
<th width="40%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th>
<th width="8%"><!--op--></th>
<th width="14%">{% trans "Size" %}</th>
<th width="18%">{% trans "Last Update" %} <span class="by-time icon-caret-down cspt"></span></th>
<th width="16%">{% trans "Shared By" %}</th>
</tr>
</thead>
<thead></thead>
<tbody></tbody>
</table>
<div class="empty-tips hide">
@@ -182,16 +165,7 @@
<div id="grp-repos">
<table style="display:none">
<thead>
<tr>
<th width="4%"><!--icon--></th>
<th width="38%">{% trans "Name" %} <span class="by-name icon-caret-up cspt"></span></th>
<th width="10%"><!--op--></th>
<th width="14%">{% trans "Size" %}</th>
<th width="18%">{% trans "Last Update" %} <span class="by-time icon-caret-down cspt"></span></th>
<th width="16%">{% trans "Shared By" %}</th>
</tr>
</thead>
<thead></thead>
<tbody></tbody>
</table>
@@ -212,18 +186,8 @@
</div>
<table class="repo-list hide">
<thead>
<tr>
<th width="4%"></th>
<th width="38%">{% trans "Name"%} <span class="by-name icon-caret-up cspt"></span></th>
<th width="10%"><!--op--></th>
<th width="14%">{% trans "Size"%}</th>
<th width="18%">{% trans "Last Update"%} <span class="by-time icon-caret-down cspt"></span></th>
<th width="16%">{% trans "Shared By"%}</th>
</tr>
</thead>
<tbody>
</tbody>
<thead></thead>
<tbody></tbody>
</table>
<img class="loading-tip" width="32" src="{{MEDIA_URL}}img/loading-new.gif" alt="{% trans 'Loading...' %}" />
<div class="empty-tips hide">

View File

@@ -51,6 +51,7 @@ define([
},
reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html()))
this.$tableBody.empty();
this.repos.each(this.addOne, this);
this.$loadingTip.hide();

View File

@@ -42,6 +42,7 @@ define([
},
reset: function() {
this.$tableHead.html(_.template($('#my-repo-thead-tmpl').html()))
this.$tableBody.empty();
this.repos.each(this.addOne, this);
if (this.repos.length) {

View File

@@ -34,6 +34,7 @@ define([
},
reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html()))
this.$tableBody.empty();
this.repos.each(this.addOne, this);
if (this.repos.length) {
@@ -46,14 +47,9 @@ define([
this.$loadingTip.hide();
},
renderPath: function() {
//
},
showSharedRepos: function() {
this.repos.fetch({reset: true});
this.$tabs.show();
//this.$table.parent().show();
this.$table.hide();
this.$loadingTip.show();
$('#shared-lib-tab', this.$tabs).parent().addClass('ui-state-active');

View File

@@ -18,6 +18,7 @@ define([
this.$sideNav = $('#org-side-nav');
this.$reposDiv = $('#organization-repos');
this.$table = $('#organization-repos table');
this.$tableHead = $('thead', this.$table);
this.$tableBody = $('tbody', this.$table);
this.$loadingTip = $('#organization-repos .loading-tip');
this.$emptyTip = $('#organization-repos .empty-tips');
@@ -49,6 +50,7 @@ define([
},
reset: function() {
this.$tableHead.html(_.template($('#shared-repo-thead-tmpl').html()))
this.$tableBody.empty();
this.repos.each(this.addOne, this);
if (this.repos.length) {