1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 09:51:26 +00:00

bugfix for 'dir view', modified grp-repo-tmpl

This commit is contained in:
llj
2015-04-17 18:07:17 +08:00
committed by Daniel Pan
parent cfad7ef7d4
commit 816960b129
6 changed files with 24 additions and 24 deletions

View File

@@ -46,19 +46,19 @@
<script type="text/template" id="group-repo-tmpl"> <script type="text/template" id="group-repo-tmpl">
<td> <td>
<% if (encrypted) { %> <% if (encrypted) { %>
<img src="<%= app.config.mediaUrl %>img/sync-folder-encrypt-20.png" title="{% trans "Encrypted" %}" alt="" /> <img src="{{ MEDIA_URL }}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted" %}" alt="" />
<% } else { %> <% } else { %>
<% if (permission == 'rw') { %> <% if (permission == 'rw') { %>
<img src="<%= app.config.mediaUrl %>img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write" %}" alt="" /> <img src="{{ MEDIA_URL }}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write" %}" alt="" />
<% } else { %> <% } else { %>
<img src="<%= app.config.mediaUrl %>img/folder-no-write-20.png?t=1387267140" title="{% trans "Read-Only" %}" alt="" /> <img src="{{ MEDIA_URL }}img/folder-no-write-20.png?t=1387267140" title="{% trans "Read-Only" %}" alt="" />
<% } %> <% } %>
<% } %> <% } %>
</td> </td>
<td><a href="#/group/<%= group_id %>/lib/<%= id %>"><%- name %></a></td> <td><a href="#group/<%= group_id %>/lib/<%= id %>"><%- name %></a></td>
<td class="alc"> <td class="alc">
<% if (app.pageOptions.isGroupStaff) { %> <% if (app.pageOptions.isGroupStaff) { %>
<img src="<%= app.config.mediaUrl%>img/delete-orange.png" alt="" class="cancel-share op-icon vh" title="{% trans "Unshare" %}" /> <img src="{{ MEDIA_URL }}img/delete-orange.png" alt="" class="cancel-share op-icon vh" title="{% trans "Unshare" %}" />
<% } %> <% } %>
</td> </td>
<td><%= size_formatted %></td> <td><%= size_formatted %></td>

View File

@@ -26,7 +26,6 @@ define([
this.dirent_more = data.dirent_more; this.dirent_more = data.dirent_more;
this.more_start = data.more_start; this.more_start = data.more_start;
this.share = data.share;
return data.dirent_list; // return the array return data.dirent_list; // return the array
}, },

View File

@@ -6,9 +6,10 @@ define([
'app/views/myhome', 'app/views/myhome',
'app/views/group', 'app/views/group',
'app/views/organization', 'app/views/organization',
'app/views/dir',
'app/views/top-group-nav' 'app/views/top-group-nav'
], function($, Backbone, Common, MyHomeView, GroupView, OrgView, ], function($, Backbone, Common, MyHomeView, GroupView, OrgView,
GroupNavView) { DirView, GroupNavView) {
"use strict"; "use strict";
var Router = Backbone.Router.extend({ var Router = Backbone.Router.extend({
@@ -35,9 +36,11 @@ define([
Common.initNoticePopup(); Common.initNoticePopup();
Common.getContacts(); Common.getContacts();
this.myHomeView = new MyHomeView(); this.dirView = new DirView();
this.groupView = new GroupView();
this.orgView = new OrgView(); this.myHomeView = new MyHomeView({dirView: this.dirView});
this.groupView = new GroupView({dirView: this.dirView});
this.orgView = new OrgView({dirView: this.dirView});
this.currentView = this.myHomeView; this.currentView = this.myHomeView;

View File

@@ -6,10 +6,9 @@ define([
'app/collections/group-repos', 'app/collections/group-repos',
'app/views/group-repo', 'app/views/group-repo',
'app/views/add-group-repo', 'app/views/add-group-repo',
'app/views/dir',
'app/views/group-side-nav' 'app/views/group-side-nav'
], function($, _, Backbone, Common, GroupRepos, GroupRepoView, ], function($, _, Backbone, Common, GroupRepos, GroupRepoView,
AddGroupRepoView, DirView, GroupSideNavView) { AddGroupRepoView, GroupSideNavView) {
'use strict'; 'use strict';
var GroupView = Backbone.View.extend({ var GroupView = Backbone.View.extend({
@@ -21,7 +20,7 @@ define([
'click #grp-repos .by-time': 'sortByTime' 'click #grp-repos .by-time': 'sortByTime'
}, },
initialize: function() { initialize: function(options) {
this.$tabs = this.$('#group-repo-tabs'); this.$tabs = this.$('#group-repo-tabs');
this.$table = this.$('#grp-repos table', this.$tabs); this.$table = this.$('#grp-repos table', this.$tabs);
this.$tableHead = $('thead', this.$table); this.$tableHead = $('thead', this.$table);
@@ -35,7 +34,7 @@ define([
this.listenTo(this.repos, 'add', this.addOne); this.listenTo(this.repos, 'add', this.addOne);
this.listenTo(this.repos, 'reset', this.reset); this.listenTo(this.repos, 'reset', this.reset);
this.dirView = new DirView(); this.dirView = options.dirView;
}, },
addOne: function(repo, collection, options) { addOne: function(repo, collection, options) {

View File

@@ -6,23 +6,23 @@ define([
'app/views/myhome-repos', 'app/views/myhome-repos',
'app/views/myhome-sub-repos', 'app/views/myhome-sub-repos',
'app/views/myhome-shared-repos', 'app/views/myhome-shared-repos',
'app/views/dir',
'app/views/myhome-side-nav' 'app/views/myhome-side-nav'
], function($, _, Backbone, Common, ReposView, SubReposView, ], function($, _, Backbone, Common, ReposView, SubReposView,
SharedReposView, DirView, MyhomeSideNavView) { SharedReposView, MyhomeSideNavView) {
'use strict'; 'use strict';
var MyHomeView = Backbone.View.extend({ var MyHomeView = Backbone.View.extend({
el: '#main', el: '#main',
initialize: function() { initialize: function(options) {
this.$cont = this.$('#right-panel');
this.sideNavView = new MyhomeSideNavView(); this.sideNavView = new MyhomeSideNavView();
this.reposView = new ReposView(); this.reposView = new ReposView();
this.subReposView = new SubReposView(); this.subReposView = new SubReposView();
this.sharedReposView = new SharedReposView(); this.sharedReposView = new SharedReposView();
this.dirView = new DirView();
this.dirView = options.dirView;
this.currentView = this.reposView; this.currentView = this.reposView;
$('#initial-loading-view').hide(); $('#initial-loading-view').hide();

View File

@@ -5,16 +5,15 @@ define([
'common', 'common',
'app/collections/pub-repos', 'app/collections/pub-repos',
'app/views/organization-repo', 'app/views/organization-repo',
'app/views/dir',
'app/views/add-pub-repo' 'app/views/add-pub-repo'
], function($, _, Backbone, Common, PubRepoCollection, OrganizationRepoView, ], function($, _, Backbone, Common, PubRepoCollection, OrganizationRepoView,
DirView, AddPubRepoView) { AddPubRepoView) {
'use strict'; 'use strict';
var OrganizationView = Backbone.View.extend({ var OrganizationView = Backbone.View.extend({
el: '#main', el: '#main',
initialize: function() { initialize: function(options) {
this.$sideNav = $('#org-side-nav'); this.$sideNav = $('#org-side-nav');
this.$reposDiv = $('#organization-repos'); this.$reposDiv = $('#organization-repos');
@@ -27,7 +26,7 @@ define([
this.listenTo(this.repos, 'add', this.addOne); this.listenTo(this.repos, 'add', this.addOne);
this.listenTo(this.repos, 'reset', this.reset); this.listenTo(this.repos, 'reset', this.reset);
this.dirView = new DirView(); this.dirView = options.dirView;
}, },
events: { events: {