mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
Dynamicly change navigator
This commit is contained in:
@@ -10,7 +10,7 @@ import settings
|
|||||||
|
|
||||||
def version(request):
|
def version(request):
|
||||||
"""
|
"""
|
||||||
Adds seafile version to the context
|
Add seafile version to the context.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return {'seafile_version': settings.SEAFILE_VERSION}
|
return {'seafile_version': settings.SEAFILE_VERSION}
|
||||||
|
@@ -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 { height:20px; color:#fff; text-align:right; font-weight:bold; background:#606; }
|
||||||
.top-bar-in { width:950px; margin:0 auto; }
|
.top-bar-in { width:950px; margin:0 auto; }
|
||||||
.top-bar a { color:#ddd; font-weight:normal; }
|
.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; }
|
.top-bar a:hover { background:#A0A; }
|
||||||
/* header */
|
/* header */
|
||||||
#header .top-info { margin-bottom:5px;}
|
#header .top-info { margin-bottom:5px;}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{% extends "myhome_base.html" %}
|
{% extends "admin_base.html" %}
|
||||||
{% block title %}添加用户{% endblock %}
|
{% block title %}添加用户{% endblock %}
|
||||||
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
||||||
{% block main_panel %}
|
{% block main_panel %}
|
||||||
|
14
templates/admin_base.html
Normal file
14
templates/admin_base.html
Normal 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 %}
|
||||||
|
|
@@ -17,6 +17,10 @@
|
|||||||
<div id="top-bar">
|
<div id="top-bar">
|
||||||
<div class="top-bar">
|
<div class="top-bar">
|
||||||
<div class="top-bar-in">
|
<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 %}
|
{% if request.user.is_authenticated %}
|
||||||
欢迎, {{ request.user }}
|
欢迎, {{ request.user }}
|
||||||
<a href="{{ SITE_ROOT }}profile/">设置</a>
|
<a href="{{ SITE_ROOT }}profile/">设置</a>
|
||||||
|
@@ -13,14 +13,6 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{ SITE_ROOT }}group/" {% block nav_group_class %}{% endblock %}>小组</a>
|
<a href="{{ SITE_ROOT }}group/" {% block nav_group_class %}{% endblock %}>小组</a>
|
||||||
</li>
|
</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>
|
<li>
|
||||||
<a href="{{ SITE_ROOT}}back/local/">回到本地</a>
|
<a href="{{ SITE_ROOT}}back/local/">回到本地</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -28,7 +20,6 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="http://www.gonggeng.org/seasite/help/" target="_blank">使用帮助</a>
|
<a href="http://www.gonggeng.org/seasite/help/" target="_blank">使用帮助</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ SITE_ROOT }}repos/my/">Files</a>
|
<a href="{{ SITE_ROOT }}repos/my/">Files</a>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{% extends "myhome_base.html" %}
|
{% extends "admin_base.html" %}
|
||||||
{% block nav_seafadmin_class %}class="cur"{% endblock %}
|
{% block nav_seafadmin_class %}class="cur"{% endblock %}
|
||||||
|
|
||||||
{% block right_panel %}
|
{% block right_panel %}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{% extends "myhome_base.html" %}
|
{% extends "admin_base.html" %}
|
||||||
|
|
||||||
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
||||||
{% block left_panel %}
|
{% block left_panel %}
|
||||||
|
3
urls.py
3
urls.py
@@ -7,7 +7,8 @@ from seahub.views import root, peers, myhome, \
|
|||||||
role_add, role_remove, activate_user, user_add, user_remove, \
|
role_add, role_remove, activate_user, user_add, user_remove, \
|
||||||
ownerhome, remove_fetched_repo, \
|
ownerhome, remove_fetched_repo, \
|
||||||
repo_list_dir, user_info, repo_set_access_property, repo_operation_file, \
|
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:
|
# Uncomment the next two lines to enable the admin:
|
||||||
#from django.contrib import admin
|
#from django.contrib import admin
|
||||||
|
Reference in New Issue
Block a user