MrDoc/template/app_doc/head_base.html

94 lines
4.0 KiB
HTML
Raw Normal View History

{% 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' %}">
<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>
<!-- 搜索框 -->
<div style="margin:12px;" class="layui-hide-xs">
<form method="get" action="">
<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>
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="">
2019-12-01 20:44:16 +08:00
<ul class="layui-nav layui-layout-right">
{% if request.user.is_authenticated %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
2019-12-15 15:45:05 +08:00
<i class="layui-icon layui-icon-friends"></i> <span class="layui-hide-xs">{{request.user.username}}</span>
2019-12-01 20:44:16 +08:00
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
{% if request.user.is_superuser %}
2019-12-15 15:45:05 +08:00
<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>
2019-12-01 20:44:16 +08:00
{% endif %}
2019-12-15 15:45:05 +08:00
<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>
2019-12-15 15:45:05 +08:00
</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>
2019-12-01 20:44:16 +08:00
</dl>
</li>
{% else %}
<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>
{% endif %}
</ul>
2019-12-15 15:45:05 +08:00
</div>
2019-12-01 20:44:16 +08:00
</div>
</div>