为超级管理员添加前台到后台的链接

This commit is contained in:
sxw@401 2015-09-15 14:16:36 +08:00
parent 6c07396cea
commit 0bbd4a1a06

View File

@ -50,28 +50,31 @@
<li><a href="/about/">关于</a></li> <li><a href="/about/">关于</a></li>
</ul> </ul>
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false"> aria-expanded="false">
{{ request.user.username }} {{ request.user.username }}
<span class="caret"></span></a> <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="/submissions/">我的提交</a></li> {% if request.user.admin_type == 2 %}
<li><a href="#">我的资料</a></li> <li><a href="/admin/">后台管理</a></li>
<li role="separator" class="divider"></li> {% endif %}
<li><a href="/logout/">退出</a></li> <li><a href="/submissions/">我的提交</a></li>
</ul> <li><a href="#">我的资料</a></li>
</li> <li role="separator" class="divider"></li>
</ul> <li><a href="/logout/">退出</a></li>
</ul>
</li>
</ul>
{% else %} {% else %}
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="/login/"> <a href="/login/">
登录 登录
</a> </a>
</li> </li>
</ul> </ul>
{% endif %} {% endif %}
</div> </div>
</div> </div>