2020-05-02 18:16:57 +08:00
|
|
|
{% load staticfiles %}
|
2019-12-15 15:45:05 +08:00
|
|
|
<div class="layui-header layui-fluid">
|
|
|
|
<div class="" style="display:flex;flex-direction:row;justify-content:space-between;">
|
|
|
|
<!-- LOGO -->
|
|
|
|
<div class="">
|
|
|
|
<a class="logo" href="{% url 'pro_list' %}">
|
2020-05-02 18:16:57 +08:00
|
|
|
<img src="{% static 'logo.jpg' %}" style="height: 32px;width: auto;">
|
|
|
|
<!-- <h1><strong>MrDoc</strong></h1> -->
|
2019-12-15 15:45:05 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<!-- 搜索框 -->
|
2020-04-06 17:36:04 +08:00
|
|
|
<div style="margin:12px;" class="layui-hide-xs">
|
2020-07-31 20:23:23 +08:00
|
|
|
<form method="get" action="{% url 'search' %}" target="_blank">
|
2020-04-06 17:36:04 +08:00
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input class="layui-input mrdoc-search-input" placeholder="搜索文集或文档" name="kw"/>
|
|
|
|
<button type="submit" style="position: absolute;top:12px;right: 8px;border: none;background-color: white;">
|
|
|
|
<i class="layui-icon layui-icon-search" ></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2020-07-31 20:23:23 +08:00
|
|
|
<div class="layui-hide-lg layui-hide-md layui-hide-sm" style="margin:20px;">
|
|
|
|
<a href="{% url 'search' %}">
|
|
|
|
<i class="layui-icon layui-icon-search" style="font-size: 24px;"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
<!-- 新建文档按钮 -->
|
|
|
|
<div class="layui-hide-xs" style="">
|
|
|
|
<ul class="layui-nav" style="">
|
|
|
|
<li class="layui-nav-item">
|
|
|
|
<a href="{% url 'create_doc' %}" target="_blank">
|
|
|
|
<i class="layui-icon layui-icon-add-1"></i> <span class="">新建文档</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<!-- 用户菜单 -->
|
|
|
|
<div class="">
|
2020-07-31 20:23:23 +08:00
|
|
|
<ul class="layui-nav layui-layout-right">
|
|
|
|
{% if request.user.is_authenticated %}
|
2019-12-01 20:44:16 +08:00
|
|
|
<li class="layui-nav-item">
|
2020-07-31 20:23:23 +08:00
|
|
|
<a href="javascript:void(0);">
|
|
|
|
<i class="layui-icon layui-icon-friends"></i> <span class="layui-hide-xs">{{request.user.username}}</span>
|
|
|
|
</a>
|
|
|
|
<dl class="layui-nav-child">
|
|
|
|
<!-- <dd><a href="">基本资料</a></dd> -->
|
|
|
|
{% if request.user.is_superuser %}
|
|
|
|
<dd>
|
|
|
|
<a href="{% url 'user_manage' %}">
|
|
|
|
<i class="layui-icon layui-icon-console layui-hide-md"></i>
|
|
|
|
<span class="layui-hide-xs">进入后台</span>
|
|
|
|
</a>
|
|
|
|
</dd>
|
|
|
|
{% endif %}
|
|
|
|
<dd class="layui-hide-md">
|
|
|
|
<a href="{% url 'create_doc' %}">
|
|
|
|
<i class="layui-icon layui-icon-add-1 layui-hide-md"></i>
|
|
|
|
</a>
|
|
|
|
</dd>
|
|
|
|
<dd>
|
|
|
|
<a href="{% url 'manage_doc' %}">
|
|
|
|
<i class="layui-icon layui-icon-app layui-hide-md"></i>
|
|
|
|
<span class="layui-hide-xs">个人中心</span>
|
|
|
|
</a>
|
|
|
|
</dd>
|
|
|
|
<dd>
|
|
|
|
<a href="javascript:void(0);" onclick="changePwd('{{ request.user.id }}','{{ request.user.username }}' )">
|
|
|
|
<i class="layui-icon layui-icon-password layui-hide-md"></i>
|
|
|
|
<span class="layui-hide-xs">修改密码</span>
|
|
|
|
</a>
|
|
|
|
</dd>
|
|
|
|
<dd>
|
|
|
|
<a href="{% url 'logout' %}">
|
|
|
|
<i class="layui-icon layui-icon-release layui-hide-md"></i>
|
|
|
|
<span class="layui-hide-xs">退出登录</span>
|
|
|
|
</a>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
</li>
|
2019-12-01 20:44:16 +08:00
|
|
|
{% else %}
|
2020-07-31 20:23:23 +08:00
|
|
|
<li class="layui-nav-item">
|
|
|
|
<a href="javascript:void(0);">
|
|
|
|
<i class="layui-icon layui-icon-username"></i> 游客
|
|
|
|
</a>
|
|
|
|
<dl class="layui-nav-child">
|
|
|
|
<!-- <dd><a href="">基本资料</a></dd> -->
|
|
|
|
{% if close_register == 'on' %}
|
|
|
|
<dd><a href="{% url 'login' %}">登录</a></dd>
|
|
|
|
{% else %}
|
|
|
|
<dd><a href="{% url 'register' %}">注册</a></dd>
|
|
|
|
<dd><a href="{% url 'login' %}">登录</a></dd>
|
|
|
|
{% endif %}
|
|
|
|
</dl>
|
|
|
|
</li>
|
2019-12-01 20:44:16 +08:00
|
|
|
{% endif %}
|
2020-07-31 20:23:23 +08:00
|
|
|
</ul>
|
2019-12-15 15:45:05 +08:00
|
|
|
</div>
|
2019-12-01 20:44:16 +08:00
|
|
|
</div>
|
|
|
|
</div>
|