1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

Dynamicly change navigator

This commit is contained in:
xiez
2012-05-17 14:02:47 +08:00
parent e04d6fab06
commit 034ea57339
9 changed files with 27 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ import settings
def version(request):
"""
Adds seafile version to the context
Add seafile version to the context.
"""
return {'seafile_version': settings.SEAFILE_VERSION}

View File

@@ -65,6 +65,9 @@ tr.first { background-color: #00FF00; }
.top-bar { height:20px; color:#fff; text-align:right; font-weight:bold; background:#606; }
.top-bar-in { width:950px; margin:0 auto; }
.top-bar a { color:#ddd; font-weight:normal; }
.top-bar a.adminconsole { float:left; color:#ddd; font-weight:normal; }
.top-bar a.myaccount { float:left; color:#ddd; font-weight:normal; }
.top-bar a:hover { background:#A0A; }
/* header */
#header .top-info { margin-bottom:5px;}

View File

@@ -1,4 +1,4 @@
{% extends "myhome_base.html" %}
{% extends "admin_base.html" %}
{% block title %}添加用户{% endblock %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block main_panel %}

14
templates/admin_base.html Normal file
View File

@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block nav %}
<ul class="nav ovhd">
{% if request.user.is_staff %}
<li>
<a href="{{ SITE_ROOT }}seafadmin/" {% block nav_seafadmin_class %}{% endblock %}>目录管理</a>
</li>
<li>
<a href="{{ SITE_ROOT }}useradmin/" {% block nav_useradmin_class %}{% endblock %}>用户管理</a>
</li>
{% endif %}
</ul>
{% endblock %}

View File

@@ -17,6 +17,10 @@
<div id="top-bar">
<div class="top-bar">
<div class="top-bar-in">
{% if request.user.is_staff %}
<a href="{{ SITE_ROOT }}seafadmin/" class="adminconsole">管理员控制台</a>
<a href="{{ SITE_ROOT }}home/my/" class="myaccount">我的帐号</a>
{% endif %}
{% if request.user.is_authenticated %}
欢迎, {{ request.user }}
<a href="{{ SITE_ROOT }}profile/">设置</a>

View File

@@ -13,14 +13,6 @@
<li>
<a href="{{ SITE_ROOT }}group/" {% block nav_group_class %}{% endblock %}>小组</a>
</li>
{% if request.user.is_staff %}
<li>
<a href="{{ SITE_ROOT }}seafadmin/" {% block nav_seafadmin_class %}{% endblock %}>目录管理</a>
</li>
<li>
<a href="{{ SITE_ROOT }}useradmin/" {% block nav_useradmin_class %}{% endblock %}>用户管理</a>
</li>
{% endif %}
<li>
<a href="{{ SITE_ROOT}}back/local/">回到本地</a>
</li>
@@ -28,7 +20,6 @@
<li>
<a href="http://www.gonggeng.org/seasite/help/" target="_blank">使用帮助</a>
</li>
<!--
<li>
<a href="{{ SITE_ROOT }}repos/my/">Files</a>

View File

@@ -1,4 +1,4 @@
{% extends "myhome_base.html" %}
{% extends "admin_base.html" %}
{% block nav_seafadmin_class %}class="cur"{% endblock %}
{% block right_panel %}

View File

@@ -1,4 +1,4 @@
{% extends "myhome_base.html" %}
{% extends "admin_base.html" %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block left_panel %}

View File

@@ -7,7 +7,8 @@ from seahub.views import root, peers, myhome, \
role_add, role_remove, activate_user, user_add, user_remove, \
ownerhome, remove_fetched_repo, \
repo_list_dir, user_info, repo_set_access_property, repo_operation_file, \
repo_add_share, repo_list_share, repo_remove_share, repo_download, seafile_access_check, back_local
repo_add_share, repo_list_share, repo_remove_share, repo_download, \
seafile_access_check, back_local
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin