forked from mirror/MrDoc
修改一些小的样式
This commit is contained in:
parent
2954311246
commit
94a548bf8c
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
BIN
media/logo-white.png
Normal file
BIN
media/logo-white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@ -5,11 +5,20 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}{% endblock %} - 后台管理 - MrDoc</title>
|
||||
<link href="{% static 'layui/css/layui.css' %}" rel="stylesheet">
|
||||
<style>
|
||||
.logo img{
|
||||
height: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo"><strong>MrDoc</strong></div>
|
||||
<div class="layui-logo">
|
||||
<a class="logo" href="{% url 'pro_list' %}">
|
||||
<img src="/media/logo-white.png" />
|
||||
</a>
|
||||
</div>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:;">
|
||||
@ -27,11 +36,19 @@
|
||||
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
|
||||
<ul class="layui-nav layui-nav-tree" lay-filter="test">
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href=""><i class="layui-icon layui-icon-user"></i> 用户管理</a>
|
||||
<a href=""><i class="layui-icon layui-icon-list"></i> 文集管理</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href=""><i class="layui-icon layui-icon-file-b"></i> 文档管理</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href=""><i class="layui-icon layui-icon-template"></i> 文档模板管理</a>
|
||||
</li>
|
||||
{% if request.user.is_superuser %}
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'user_manage' %}"><i class="layui-icon layui-icon-user"></i> 用户管理</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,6 +2,12 @@
|
||||
{% load staticfiles %}
|
||||
{% block title %}用户管理{% endblock %}
|
||||
{% block content %}
|
||||
<div class="layui-card-header" style="margin-bottom: 10px;">
|
||||
<div class="layui-row">
|
||||
<span style="font-size:18px;">用户管理
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
|
@ -9,16 +9,47 @@
|
||||
<link href="{% static 'style.css' %}" rel="stylesheet">
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
<!--<div class="layui-row">-->
|
||||
<!--<ul class="layui-nav layui-bg-blue">-->
|
||||
<!--<li class="layui-nav-item"><a href="">MrDoc</a></li>-->
|
||||
<!--<li class="layui-nav-item"><a href="/">回到首页</a></li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<div class="layui-header">
|
||||
<div class="layui-main">
|
||||
<a class="logo" href="{% url 'pro_list' %}">
|
||||
<img src="/media/logo.png" />
|
||||
</a>
|
||||
<div class="component">
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="搜索文集"/>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0);">
|
||||
<i class="layui-icon layui-icon-username"></i> {{request.user.username}}
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<!-- <dd><a href="">基本资料</a></dd> -->
|
||||
<dd><a href="javascript:void(0);">修改密码</a></dd>
|
||||
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
|
||||
</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> -->
|
||||
<dd><a href="javascript:void(0);">注册</a></dd>
|
||||
<dd><a href="{% url 'login' %}">登录</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-main">
|
||||
<div class="create-doc-form">
|
||||
<div class="layui-form">
|
||||
<label class="layui-form-label">模板标题:</label>
|
||||
<label class="layui-form-label">模板标题</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="doc-name" id="doctemp-name" required lay-verify="required" placeholder="请输入模板名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
|
@ -1,10 +1,135 @@
|
||||
{% load staticfiles %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<title>管理文档模板 - MrDoc</title>
|
||||
<link href="{% static 'layui/css/layui.css' %}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{% static 'editor.md/css/editormd.css' %}" />
|
||||
<link href="{% static 'style.css' %}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-header">
|
||||
<div class="layui-main">
|
||||
<a class="logo" href="{% url 'pro_list' %}">
|
||||
<img src="/media/logo.png" />
|
||||
</a>
|
||||
<div class="component">
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="搜索文集"/>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0);">
|
||||
<i class="layui-icon layui-icon-username"></i> {{request.user.username}}
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<!-- <dd><a href="">基本资料</a></dd> -->
|
||||
<dd><a href="javascript:void(0);">修改密码</a></dd>
|
||||
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
|
||||
</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> -->
|
||||
<dd><a href="javascript:void(0);">注册</a></dd>
|
||||
<dd><a href="{% url 'login' %}">登录</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-main">
|
||||
<div class="">
|
||||
<h1>管理文档模板</h1>
|
||||
</div>
|
||||
<div id="editor-md">
|
||||
<textarea style="display:none;"></textarea>
|
||||
<textarea class="editormd-html-textarea" name="$id-html-code"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
<script src="{% static 'editor.md/editormd.min.js' %}"></script>
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
layui.config({
|
||||
base: "/static/layui/module/"
|
||||
}).extend({
|
||||
treeSelect: "treeSelect/treeSelect"
|
||||
});
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
//初始化editormd
|
||||
var editor = editormd("editor-md", {
|
||||
width : "100%",
|
||||
height : "1000px;",
|
||||
placeholder:"开始使用Markdown书写……",
|
||||
path : "/static/editor.md/lib/",
|
||||
saveHTMLToTextarea : true,
|
||||
tex:true,//开启科学公式
|
||||
tocm:true,//开启下拉目录
|
||||
taskList:true,//开启任务列表
|
||||
tocTitle:'文章导读',
|
||||
tocContainer:'',
|
||||
tocDropdown:false,
|
||||
emoji:true,
|
||||
|
||||
});
|
||||
//粘贴上传图片
|
||||
$("#editor-md").on('paste', function (ev) {
|
||||
var data = ev.clipboardData;
|
||||
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
for (var index in items) {
|
||||
var item = items[index];
|
||||
if (item.kind === 'file') {
|
||||
var blob = item.getAsFile();
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
var base64 = event.target.result;
|
||||
//ajax上传图片
|
||||
$.post("{% url 'upload_doc_img' %}",{base:base64}, function (ret) {
|
||||
layer.msg(ret.message);
|
||||
if (ret.success === 1) {
|
||||
//新一行的图片显示
|
||||
editor.insertValue("\n![](" + ret.url + ")");
|
||||
}
|
||||
});
|
||||
}; // data url!
|
||||
var url = reader.readAsDataURL(blob);
|
||||
}
|
||||
}
|
||||
});
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
//保存文档模板
|
||||
createDocTemp = function(){
|
||||
var data = {
|
||||
'name':$("#doctemp-name").val(),
|
||||
'content':editor.getMarkdown(),
|
||||
}
|
||||
$.post("{% url 'create_doctemp' %}",data,function(r){
|
||||
if(r.status){
|
||||
//创建成功
|
||||
layer.msg('保存成功',function(){
|
||||
window.location.href = "{% url 'pro_list' %}";
|
||||
});
|
||||
}else{
|
||||
//创建失败
|
||||
layer.msg('保存失败');
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
@ -26,7 +26,7 @@
|
||||
<!-- 左侧目录栏 -->
|
||||
<div class="doc-summary">
|
||||
<div id="doc-search-input">
|
||||
<input type="text" placeholder="搜索文集或文档" value="" class="layui-input doc-search-input">
|
||||
<input type="text" placeholder="搜索文档" value="" class="layui-input doc-search-input">
|
||||
</div>
|
||||
<div class="project-title">
|
||||
<a href="{% url 'pro_index' pro_id=project.id %}">{{ project.name }}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user