mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 09:51:26 +00:00
[side nav] modified for myhome & org
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block left_panel %}
|
||||
<div class="side-tabnav">
|
||||
<div class="side-tabnav hide" id="myhome-side-nav">
|
||||
<div class="hd w100 ovhd">
|
||||
<h3 class="fleft">{% trans "Personal" %}</h3>
|
||||
{% if user.permissions.can_add_repo %}
|
||||
@@ -32,28 +32,37 @@
|
||||
</div>
|
||||
<ul class="side-tabnav-tabs">
|
||||
<li class="tab tab-cur"><a href="{{ SITE_ROOT }}#my-libs/" class="lib">{% trans "Libraries" %}</a></li>
|
||||
<li class="tab {% block cur_stars %}{% endblock %}"><a href="{% url 'starred' %}" class="star">{% trans "Starred" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'starred' %}" class="star">{% trans "Starred" %}</a></li>
|
||||
{% if events_enabled %}
|
||||
<li class="tab {% block cur_activities %}{% endblock %}"><a href="{% url 'activities' %}" class="activity">{% trans "Activities" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'activities' %}" class="activity">{% trans "Activities" %}</a></li>
|
||||
{% endif %}
|
||||
{% for mod in request.user.mods_enabled %}
|
||||
{% if mod == 'personal wiki' %}
|
||||
<li class="tab {% block cur_personal_wiki %}{% endblock %}"><a href="{% url 'personal_wiki' %}" class="wiki">{% trans "Personal Wiki" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'personal_wiki' %}" class="wiki">{% trans "Personal Wiki" %}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li class="tab {% block cur_messages %}{% endblock %}"><a href="{% url 'message_list' %}" class="msgs">{% trans "Messages" %}</a></li>
|
||||
<li class="tab {% block cur_devices %}{% endblock %}"><a href="{% url 'devices' %}" class="clients">{% trans "Devices" %}</a></li>
|
||||
<li class="tab {% block cur_contacts %}{% endblock %}"><a href="{% url 'contacts' %}" class="contacts">{% trans "Contacts" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'message_list' %}" class="msgs">{% trans "Messages" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'devices' %}" class="clients">{% trans "Devices" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'contacts' %}" class="contacts">{% trans "Contacts" %}</a></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="hd">{% trans "Share Admin" %}</h3>
|
||||
<ul class="side-tabnav-tabs">
|
||||
{% if user.permissions.can_add_repo %}
|
||||
<li class="tab {% block cur_share_libs %}{% endblock %}"><a href="{% url 'share_admin' %}" class="lib">{% trans "Libraries" %}</a></li>
|
||||
<li class="tab {% block cur_share_folders %}{% endblock %}"><a href="{% url 'list_priv_shared_folders' %}" class="folders">{% trans "Folders" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'share_admin' %}" class="lib">{% trans "Libraries" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'list_priv_shared_folders' %}" class="folders">{% trans "Folders" %}</a></li>
|
||||
{% endif %}
|
||||
<li class="tab {% block cur_share_files %}{% endblock %}"><a href="{% url 'list_priv_shared_files' %}" class="files">{% trans "Files" %}</a></li>
|
||||
<li class="tab {% block cur_share_links %}{% endblock %}"><a href="{% url 'list_shared_links' %}" class="links">{% trans "Links" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'list_priv_shared_files' %}" class="files">{% trans "Files" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'list_shared_links' %}" class="links">{% trans "Links" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="side-tabnav hide" id="org-side-nav">
|
||||
<h3 class="hd">{% trans "Organization" %}</h3>
|
||||
<ul class="side-tabnav-tabs">
|
||||
<li class="tab tab-cur"><a href="{{ SITE_ROOT }}libs/#org" class="lib">{% trans "Libraries" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'pubgrp' %}" class="group">{% trans "Groups" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'pubuser' %}" class="members">{% trans "Members" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -16,13 +16,10 @@ define([
|
||||
el: '#main',
|
||||
|
||||
initialize: function() {
|
||||
|
||||
|
||||
//_.bindAll(this, 'ajaxLoadingShow', 'ajaxLoadingHide');
|
||||
//this.$el.ajaxStart(this.ajaxLoadingShow).ajaxStop(this.ajaxLoadingHide);
|
||||
|
||||
this.$cont = this.$('#right-panel');
|
||||
|
||||
this.$sideNav = $('#myhome-side-nav');
|
||||
|
||||
this.reposView = new ReposView();
|
||||
this.subReposView = new SubReposView();
|
||||
this.sharedReposView = new SharedReposView();
|
||||
@@ -32,6 +29,9 @@ define([
|
||||
$('#initial-loading-view').hide();
|
||||
},
|
||||
|
||||
showSideNav: function () {
|
||||
this.$sideNav.show();
|
||||
},
|
||||
|
||||
ajaxLoadingShow: function() {
|
||||
Common.feedback('Loading...', 'info', Common.INFO_TIMEOUT);
|
||||
@@ -50,24 +50,28 @@ define([
|
||||
},
|
||||
|
||||
showMyRepos: function() {
|
||||
this.showSideNav();
|
||||
this.currentView.hide();
|
||||
this.reposView.show();
|
||||
this.currentView = this.reposView;
|
||||
},
|
||||
|
||||
showMySubRepos: function() {
|
||||
this.showSideNav();
|
||||
this.currentView.hide();
|
||||
this.subReposView.show();
|
||||
this.currentView = this.subReposView;
|
||||
},
|
||||
|
||||
showSharedRepos: function() {
|
||||
this.showSideNav();
|
||||
this.currentView.hide();
|
||||
this.sharedReposView.show();
|
||||
this.currentView = this.sharedReposView;
|
||||
},
|
||||
|
||||
showDir: function(category, repo_id, path) {
|
||||
this.showSideNav();
|
||||
var path = path || '/';
|
||||
this.currentView.hide();
|
||||
this.dirView.showDir(category, repo_id, path);
|
||||
@@ -76,9 +80,9 @@ define([
|
||||
|
||||
hide: function() {
|
||||
this.currentView.hide();
|
||||
this.$sideNav.hide();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return MyHomeView;
|
||||
|
@@ -16,6 +16,7 @@ define([
|
||||
|
||||
initialize: function() {
|
||||
|
||||
this.$sideNav = $('#org-side-nav');
|
||||
this.$reposDiv = $('#organization-repos');
|
||||
this.$table = $('#organization-repos table');
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
@@ -62,6 +63,7 @@ define([
|
||||
},
|
||||
|
||||
showRepoList: function() {
|
||||
this.$sideNav.show();
|
||||
this.dirView.hide();
|
||||
this.$reposDiv.show();
|
||||
this.repos.fetch({reset: true});
|
||||
@@ -73,6 +75,7 @@ define([
|
||||
},
|
||||
|
||||
showDir: function(repo_id, path) {
|
||||
this.$sideNav.show();
|
||||
var path = path || '/';
|
||||
this.hideRepoList();
|
||||
this.dirView.showDir('org', repo_id, path);
|
||||
@@ -83,7 +86,6 @@ define([
|
||||
|
||||
sortByName: function() {
|
||||
var repos = this.repos;
|
||||
console.log(repos);
|
||||
var el = $('.by-name', this.$table);
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
if (el.hasClass('icon-caret-up')) {
|
||||
@@ -115,6 +117,7 @@ define([
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.$sideNav.hide();
|
||||
this.hideRepoList();
|
||||
this.dirView.hide();
|
||||
}
|
||||
|
Reference in New Issue
Block a user