forked from mirror/MrDoc
新增文集水印设置,优化文集图标选择,优化样式
This commit is contained in:
parent
de247b00f0
commit
5081222bbd
28
app_doc/migrations/0036_auto_20201229_2004.py
Normal file
28
app_doc/migrations/0036_auto_20201229_2004.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.2.12 on 2020-12-29 20:04
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app_doc', '0035_auto_20201221_2042'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='is_watermark',
|
||||
field=models.BooleanField(default=False, verbose_name='水印状态'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='watermark_type',
|
||||
field=models.IntegerField(default=1, verbose_name='水印类型'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='watermark_value',
|
||||
field=models.CharField(blank=True, default='', max_length=250, null=True, verbose_name='水印内容'),
|
||||
),
|
||||
]
|
@ -10,6 +10,9 @@ class Project(models.Model):
|
||||
# 文集权限说明:0表示公开,1表示私密,2表示指定用户可见,3表示访问码可见 默认公开
|
||||
role = models.IntegerField(choices=((0,0),(1,1),(2,2),(3,3)), default=0,verbose_name="文集权限")
|
||||
role_value = models.TextField(verbose_name="文集权限值",blank=True,null=True)
|
||||
is_watermark = models.BooleanField(verbose_name="水印状态",default=False)
|
||||
watermark_type = models.IntegerField(verbose_name="水印类型",default=1) # 1表示文字水印 2表示图片水印
|
||||
watermark_value = models.CharField(verbose_name="水印内容",null=True,blank=True,default='',max_length=250)
|
||||
create_user = models.ForeignKey(User,on_delete=models.CASCADE)
|
||||
create_time = models.DateTimeField(auto_now_add=True)
|
||||
modify_time = models.DateTimeField(auto_now=True)
|
||||
|
@ -397,9 +397,17 @@ def modify_project(request):
|
||||
name = request.POST.get('name',None)
|
||||
icon = request.POST.get('picon', None)
|
||||
content = request.POST.get('desc',None)
|
||||
is_watermark = request.POST.get('is_watermark',False)
|
||||
if is_watermark == 'true':
|
||||
is_watermark = True
|
||||
else:
|
||||
is_watermark = False
|
||||
watermark_value = request.POST.get('watermark_value','')
|
||||
project.name = validateTitle(name)
|
||||
project.intro = content
|
||||
project.icon = icon
|
||||
project.is_watermark = is_watermark
|
||||
project.watermark_value = watermark_value
|
||||
project.save()
|
||||
return JsonResponse({'status':True,'data':'修改成功'})
|
||||
else:
|
||||
|
@ -1,90 +1,104 @@
|
||||
/*一级无序li显示实心圆点*/
|
||||
.doc-content ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
/*二级无序li显示空心圆点*/
|
||||
.doc-content ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
/*有序li显示数字*/
|
||||
.doc-content ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.doc-content ol ol ul,.doc-content ol ul ul,.doc-content ul ol ul,.doc-content ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 三级及以下无序li显示小方块 */
|
||||
.doc-content ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 下拉目录隐藏li样式 */
|
||||
.editormd-toc-menu ul.markdown-toc-list li{
|
||||
/*list-style:none;*/
|
||||
}
|
||||
/* 弹出框文档目录样式 */
|
||||
ul.markdown-toc-list{
|
||||
list-style-position:inside;
|
||||
}
|
||||
ul.markdown-toc-list li{
|
||||
list-style: none!important;
|
||||
line-height: 24px;
|
||||
}
|
||||
ul.markdown-toc-list > li > ul > li,ul.markdown-toc-list > li > ul li{
|
||||
padding-left:15px;
|
||||
}
|
||||
ul.markdown-toc-list a{
|
||||
/* text-decoration: underline!important; */
|
||||
}
|
||||
/* 块级代码和行内代码去除边框 */
|
||||
.markdown-body p code{
|
||||
border:none;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
pre.linenums{
|
||||
max-height: 500px;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
/*一级无序li显示实心圆点*/
|
||||
.doc-content ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
/*二级无序li显示空心圆点*/
|
||||
.doc-content ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
/*有序li显示数字*/
|
||||
.doc-content ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.doc-content ol ol ul,.doc-content ol ul ul,.doc-content ul ol ul,.doc-content ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 三级及以下无序li显示小方块 */
|
||||
.doc-content ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 下拉目录隐藏li样式 */
|
||||
.editormd-toc-menu ul.markdown-toc-list li{
|
||||
/*list-style:none;*/
|
||||
}
|
||||
/* 弹出框文档目录样式 */
|
||||
ul.markdown-toc-list{
|
||||
list-style-position:inside;
|
||||
}
|
||||
ul.markdown-toc-list li{
|
||||
list-style: none!important;
|
||||
line-height: 24px;
|
||||
}
|
||||
ul.markdown-toc-list > li > ul > li,ul.markdown-toc-list > li > ul li{
|
||||
padding-left:15px;
|
||||
}
|
||||
ul.markdown-toc-list a{
|
||||
/* text-decoration: underline!important; */
|
||||
}
|
||||
/* 块级代码和行内代码去除边框 */
|
||||
.markdown-body p code{
|
||||
border:none;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
pre.linenums{
|
||||
max-height: 500px;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* layui弹出框颜色 */
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #333;
|
||||
}
|
||||
/* 覆盖vditor样式 */
|
||||
.vditor-outline__item{
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
color: #333;
|
||||
}
|
||||
.vditor-reset pre>code{
|
||||
font-size: 100%;
|
||||
}
|
||||
/* layui弹出框颜色 */
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #333;
|
||||
}
|
||||
/* 覆盖vditor样式 */
|
||||
.vditor-outline__item{
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
color: #333;
|
||||
}
|
||||
.vditor-reset pre>code{
|
||||
font-size: 100%;
|
||||
}
|
||||
/* 文档图片悬浮鼠标样式 */
|
||||
#content img:hover{
|
||||
cursor: -moz-zoom-in;
|
||||
cursor: -webkit-zoom-in;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
#wm{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
position: absolute;
|
||||
opacity: 0.1;
|
||||
pointer-events: none;
|
||||
}
|
@ -247,7 +247,7 @@ function SwitchToc(i){
|
||||
console.log("点击了")
|
||||
var $me = $(this);
|
||||
$(this).parent().next("ul").toggleClass("toc-close"); //切换展开收起样式
|
||||
$(this).toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
$(this).toggleClass("layui-icon-left layui-icon-down");//切换图标
|
||||
};
|
||||
|
||||
// 展开文档树
|
||||
@ -255,7 +255,7 @@ function openDocTree(){
|
||||
$("nav ul.summary ul").each(function(obj){
|
||||
console.log(obj,this)
|
||||
$(this).removeClass("toc-close")
|
||||
$(this).prev().children('i').toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
$(this).prev().children('i').toggleClass("layui-icon-left layui-icon-down");//切换图标
|
||||
})
|
||||
|
||||
};
|
||||
@ -264,7 +264,7 @@ function closeDocTree(){
|
||||
$("nav ul.summary ul").each(function(obj){
|
||||
console.log(obj,this)
|
||||
$(this).addClass("toc-close")
|
||||
$(this).prev().children('i').toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
$(this).prev().children('i').toggleClass("layui-icon-left layui-icon-down");//切换图标
|
||||
})
|
||||
};
|
||||
|
||||
@ -308,6 +308,21 @@ doc_qrcode = function(){
|
||||
doc_qrcode();
|
||||
|
||||
|
||||
textBecomeImg = function(text,fontsize,fontcolor){
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.height = 180;
|
||||
canvas.width = 400;
|
||||
var context = canvas.getContext('2d');
|
||||
// 擦除(0,0)位置大小为200x200的矩形,擦除的意思是把该区域变为透明
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
context.fillStyle = fontcolor;
|
||||
context.font=fontsize+"px Arial";
|
||||
context.rotate(-25 * Math.PI / 180)
|
||||
context.fillText(text,10,160);
|
||||
|
||||
var dataUrl = canvas.toDataURL('image/png');//注意这里背景透明的话,需要使用png
|
||||
return dataUrl;
|
||||
}
|
||||
/*
|
||||
########################################################
|
||||
### 文集阅读页面JavaScript函数和变量定义 ###
|
||||
|
@ -533,6 +533,7 @@ input#doc-name,input#doctemp-name{
|
||||
box-shadow:0 2px 4px rgba(0,0,0,.12);
|
||||
box-sizing:border-box;
|
||||
margin-right: 2px;
|
||||
margin-bottom: 2px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.mrdoc-import-doc-item a{
|
||||
|
@ -12,10 +12,10 @@
|
||||
{% if request.user == doc.create_user or request.user == project.create_user %}
|
||||
<span class="btn pull-left">|</span>
|
||||
<a class="btn pull-left" aria-label="" href="{% url 'modify_doc' doc_id=doc.id %}">
|
||||
<i class="fa fa-edit"></i> <span class="layui-hide-xs">{% trans "修改" %}</span>
|
||||
<i class="layui-icon layui-icon-edit"></i> <span class="layui-hide-xs">{% trans "修改" %}</span>
|
||||
</a>
|
||||
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
|
||||
<i class="fa fa-plus-square"></i> <span class="layui-hide-xs">{% trans "添加" %}</span>
|
||||
<i class="layui-icon layui-icon-add-1"></i> <span class="layui-hide-xs">{% trans "添加" %}</span>
|
||||
</a>
|
||||
<a class="btn pull-left" aria-label="" href="{% url 'manage_doc' %}" target="_blank">
|
||||
<i class="fa fa-cubes"></i> <span class="layui-hide-xs">{% trans "管理" %}</span>
|
||||
@ -24,11 +24,11 @@
|
||||
<span class="btn pull-left">|</span>
|
||||
{% if colla_user_role == 1 %}
|
||||
<a class="btn pull-left" aria-label="" href="{% url 'modify_doc' doc_id=doc.id %}">
|
||||
<i class="fa fa-edit"></i> <span class="layui-hide-xs">{% trans "修改" %}</span>
|
||||
<i class="layui-icon layui-icon-edit"></i> <span class="layui-hide-xs">{% trans "修改" %}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
|
||||
<i class="fa fa-plus-square"></i> <span class="layui-hide-xs">{% trans "添加" %}</span>
|
||||
<i class="layui-icon layui-icon-add-1"></i> <span class="layui-hide-xs">{% trans "添加" %}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<!-- 文档目录 -->
|
||||
@ -72,14 +72,14 @@
|
||||
|
||||
<div class="layui-row layui-col-space20" style="padding-left: 20px;">
|
||||
<span>
|
||||
<i class="fa fa-user"></i> {% if doc.create_user.first_name != '' %} {{doc.create_user.first_name}} {% else %} {{doc.create_user.username}}{% endif %}
|
||||
<i class="layui-icon layui-icon-user"></i> {% if doc.create_user.first_name != '' %} {{doc.create_user.first_name}} {% else %} {{doc.create_user.username}}{% endif %}
|
||||
</span>
|
||||
<span tooltip="{% trans '更新于:' %}{{doc.modify_time}}">
|
||||
<i class="fa fa-clock-o"></i> {{ doc.modify_time }}
|
||||
<i class="layui-icon layui-icon-log"></i> {{ doc.modify_time }}
|
||||
</span>
|
||||
|
||||
<button id="share" class="doc-bottom-btn" tooltip="{% trans '分享本文档' %}">
|
||||
<i class="fa fa-share-alt" ></i> {% trans "分享" %}
|
||||
<i class="layui-icon layui-icon-share" ></i> {% trans "分享" %}
|
||||
</button>
|
||||
|
||||
{% if request.user == doc.create_user or request.user.is_superuser %}
|
||||
|
@ -81,9 +81,9 @@
|
||||
<div style="display:flex;justify-content:space-between;">
|
||||
<a href="{% url 'doc' pro_id=pro_id doc_id=docs.id %}" title="{{docs.name}}">{{ docs.name }}</a>
|
||||
{% if docs.open_children %}
|
||||
<i class="fa fa-chevron-down switch-toc" style="padding:15px;"></i>
|
||||
<i class="layui-icon layui-icon-down switch-toc" style="padding:15px;cursor: pointer;"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>
|
||||
<i class="layui-icon layui-icon-left switch-toc" style="padding:15px;cursor: pointer;"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if docs.open_children %}
|
||||
@ -99,9 +99,9 @@
|
||||
<div style="display:flex;justify-content:space-between;">
|
||||
<a href="{% url 'doc' pro_id=pro_id doc_id=node.id %}" title="{{node.name}}">{{ node.name }}</a>
|
||||
{% if node.open_children %}
|
||||
<i class="fa fa-chevron-down switch-toc" style="padding:15px;"></i>
|
||||
<i class="layui-icon layui-icon-down switch-toc" style="padding:15px;cursor: pointer;"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>
|
||||
<i class="layui-icon layui-icon-eft switch-toc" style="padding:15px;cursor: pointer;"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if node.open_children %}
|
||||
@ -151,7 +151,7 @@
|
||||
<!-- 文档导航 -->
|
||||
<div class="doc-header" role="navigation">
|
||||
<a class="btn pull-left js-toolbar-action" aria-label="" href="javascript:void(0);" title="{% trans '切换侧边栏' %}">
|
||||
<i class="fa fa-align-justify"></i>
|
||||
<i class="layui-icon layui-icon-slider"></i>
|
||||
</a>
|
||||
<a class="btn pull-left font-small" href="javascript:void(0);" title="{% trans '缩小字体' %}">
|
||||
<i class="fa fa-font">-</i>
|
||||
@ -166,12 +166,15 @@
|
||||
{% block head_toolbar %}
|
||||
{% endblock %}
|
||||
<a class="btn pull-right" aria-label="" href="{% url 'pro_list' %}">
|
||||
<i class="fa fa-home"></i> <span class="layui-hide-xs">{% trans "首页" %}</span>
|
||||
<i class="layui-icon layui-icon-home"></i> <span class="layui-hide-xs">{% trans "首页" %}</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- 文档主体 -->
|
||||
<div class="doc-body-content">
|
||||
<div class="doc-body-content-div">
|
||||
{% if project.is_watermark %}
|
||||
<div id="wm"></div>
|
||||
{% endif %}
|
||||
<!-- 文档内容 -->
|
||||
<div class="doc-content">
|
||||
<!-- 标题 -->
|
||||
@ -179,7 +182,7 @@
|
||||
<!-- 页面主体头信息 -->
|
||||
{% block content_head %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
@ -228,7 +231,7 @@
|
||||
<!-- 右侧文档栏结束 -->
|
||||
<!-- 右下角工具按钮 -->
|
||||
<div class="fixed-tool-bar">
|
||||
<div class="toTop" ><i class="fa fa-arrow-up"></i></div>
|
||||
<div class="toTop" ><i class="layui-icon layui-icon-up"></i></div>
|
||||
{% block right_widget %} {% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
@ -295,7 +298,7 @@
|
||||
|
||||
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
<script src="{% static 'viewerjs/viewer.js' %}"></script>
|
||||
<script src="{% static 'viewerjs/viewer.min.js' %}"></script>
|
||||
<script src="{% static 'qrcodejs/qrcode.min.js' %}"></script>
|
||||
<script src="{% static 'mrdoc/mrdoc-docs.js' %}?version={{mrdoc_version}}"></script>
|
||||
<script src="{% static 'iconFont/iconfont.js' %}"></script>
|
||||
@ -383,6 +386,12 @@
|
||||
// }
|
||||
// initRender();
|
||||
{% endif %}
|
||||
|
||||
{% if project.is_watermark %}
|
||||
var img_base64 = textBecomeImg('{{project.watermark_value}}','14','#000')
|
||||
console.log(img_base64)
|
||||
document.getElementById("wm").style.background = 'url('+ img_base64 + ')'
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
@ -121,7 +121,7 @@
|
||||
<div class="layui-colla-content layui-show" style="padding: 10px;background-color: #fff;">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-primary" id="save_doc" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存文档
|
||||
<i class="fa fa-save"></i> 存为草稿
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-normal" id="pub_doc" title="发布当前内容">
|
||||
<i class="layui-icon layui-icon-release"></i> 发布文档
|
||||
@ -316,7 +316,7 @@
|
||||
window.location.href = "/project-" + r.data.pro + "/doc-" + r.data.doc
|
||||
});
|
||||
}else{
|
||||
layer.msg('保存成功,即将跳转到文档编辑页面',function(){
|
||||
layer.msg('保存成功',{time:1000},function(){
|
||||
md_changed = false;
|
||||
//跳转到文档修改
|
||||
window.location.href = "/modify_doc/"+r.data.doc+"/";
|
||||
|
@ -34,9 +34,9 @@
|
||||
<div class="layui-row">
|
||||
<div class="doc-form-label" style="margin-bottom: 10px;">
|
||||
{% if doc.status == 0 %}
|
||||
<strong>*当前文档状态:草稿</strong>
|
||||
<strong>*当前文档状态:<span style="text-decoration:underline">草稿</span></strong>
|
||||
{% elif doc.status == 1 %}
|
||||
<strong>*当前文档状态:已发布 </strong>
|
||||
<strong>*当前文档状态:<span style="text-decoration:underline">已发布</span></strong>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<div class="layui-row" style="margin-top: 5px;">
|
||||
<button class="layui-btn layui-btn-primary layui-btn-fluid mrdoc-btn-default" id="modify_save_doc" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存草稿
|
||||
<i class="fa fa-save"></i> 存为草稿
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -296,10 +296,10 @@
|
||||
window.location.href = "{% url 'doc' pro_id=doc.top_doc doc_id=doc.id %}";
|
||||
});
|
||||
}else{
|
||||
//修改成功
|
||||
layer.msg('保存成功',function(){
|
||||
layer.msg('保存成功',{time:1000},function(){
|
||||
md_changed = false;
|
||||
window.location.href = "{% url 'modify_doc' doc.id %}";
|
||||
//跳转到文档修改
|
||||
window.location.href = "/modify_doc/"+r.data.doc+"/";
|
||||
});
|
||||
}
|
||||
}else{
|
||||
|
@ -36,7 +36,7 @@
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<!-- 文集基础信息配置 -->
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-tab-item layui-show layui-form">
|
||||
<div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{% trans "文集名称" %}</label>
|
||||
@ -61,6 +61,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">文集水印</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_watermark" id="is_watermark" lay-skin="switch" lay-text="开启|关闭" {% if pro.is_watermark %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">水印文字</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="input" class="layui-input" name="watermark_value" id="watermark_value" value="{{pro.watermark_value}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{% trans "文集简介" %}</label>
|
||||
<div class="layui-input-block">
|
||||
@ -245,9 +257,10 @@
|
||||
var selected_icon = e.currentTarget.dataset.icon;
|
||||
var selected_icon_svg = '<svg class="icon" aria-hidden="true"><use xlink:href="#'+ selected_icon +'"></use></svg>'
|
||||
console.log(selected_icon)
|
||||
$("#project-icon-select").html(selected_icon_svg)
|
||||
$("#picon").val(selected_icon)
|
||||
})
|
||||
$("#project-icon-select").html(selected_icon_svg);
|
||||
$("#picon").val(selected_icon);
|
||||
$("#project-icon-select-box").toggleClass("hide-project-icon-list");
|
||||
});
|
||||
//修改文集基础信息
|
||||
modifyProject = function(pro_id,pro_name,pro_intro){
|
||||
layer.load(1);
|
||||
@ -256,6 +269,8 @@
|
||||
'pro_id':'{{pro.id}}',
|
||||
'name':$("#pname").val(),
|
||||
'desc':$("#desc").val(),
|
||||
'is_watermark':$("input[name=is_watermark]")[0].checked,
|
||||
'watermark_value':$("#watermark_value").val(),
|
||||
}
|
||||
$.post("{% url 'modify_project' %}",project_data,function(r){
|
||||
layer.closeAll('loading'); //关闭loading
|
||||
@ -323,15 +338,33 @@
|
||||
reportFile = function(pro_id,types){
|
||||
layer.load(1)
|
||||
var data = {'pro_id':pro_id,'types':types};
|
||||
$.post("{% url 'genera_project_file' %}",data,function(r){
|
||||
layer.closeAll('loading');
|
||||
if(r.status){
|
||||
layer.msg("生成完成")
|
||||
window.location.reload();
|
||||
}else{
|
||||
layer.msg("生成出错,请稍后重试")
|
||||
$.ajax({
|
||||
url:"{% url 'genera_project_file' %}",
|
||||
type:"post",
|
||||
data:data,
|
||||
success:function(r){
|
||||
layer.closeAll('loading');
|
||||
if(r.status){
|
||||
layer.msg("生成完成")
|
||||
window.location.reload();
|
||||
}else{
|
||||
layer.msg("生成出错,请稍后重试")
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
layer.closeAll('loading');
|
||||
layer.msg("服务器异常")
|
||||
}
|
||||
})
|
||||
// $.post("{% url 'genera_project_file' %}",data,function(r){
|
||||
// layer.closeAll('loading');
|
||||
// if(r.status){
|
||||
// layer.msg("生成完成")
|
||||
// window.location.reload();
|
||||
// }else{
|
||||
// layer.msg("生成出错,请稍后重试")
|
||||
// }
|
||||
// })
|
||||
}
|
||||
// 删除文集
|
||||
delProject = function(pro_id){
|
||||
|
@ -299,8 +299,9 @@
|
||||
var selected_icon = e.currentTarget.dataset.icon;
|
||||
var selected_icon_svg = '<svg class="icon" aria-hidden="true"><use xlink:href="#'+ selected_icon +'"></use></svg>'
|
||||
console.log(selected_icon)
|
||||
$("#project-icon-select").html(selected_icon_svg)
|
||||
$("#picon").val(selected_icon)
|
||||
$("#project-icon-select").html(selected_icon_svg);
|
||||
$("#picon").val(selected_icon);
|
||||
$("#project-icon-select-box").toggleClass("hide-project-icon-list");
|
||||
})
|
||||
|
||||
</script>
|
||||
|
@ -17,91 +17,17 @@
|
||||
<link href="{% static 'layui/css/layui.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{% static 'editor.md/css/editormd.css' %}?version={{mrdoc_version}}" />
|
||||
<link rel="stylesheet" href="{% static 'katex/katex.min.css' %}?version={{mrdoc_version}}" />
|
||||
<!-- <link href="{% static 'viewerjs/viewer.css' %}?version={{mrdoc_version}}" rel="stylesheet"> -->
|
||||
<link href="{% static 'viewerjs/viewer.min.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-docs.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
/*一级无序li显示实心圆点*/
|
||||
.doc-content ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
/*二级无序li显示空心圆点*/
|
||||
.doc-content ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
/*有序li显示数字*/
|
||||
.doc-content ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.doc-content ol ol ul,.doc-content ol ul ul,.doc-content ul ol ul,.doc-content ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 三级及以下无序li显示小方块 */
|
||||
.doc-content ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 弹出框文档目录样式 */
|
||||
ul.markdown-toc-list{
|
||||
list-style-position:inside;
|
||||
}
|
||||
ul.markdown-toc-list li{
|
||||
list-style: none!important;
|
||||
line-height: 24px;
|
||||
}
|
||||
ul.markdown-toc-list > li > ul > li,ul.markdown-toc-list > li > ul li{
|
||||
padding-left:15px;
|
||||
}
|
||||
ul.markdown-toc-list a{
|
||||
text-decoration: underline!important;
|
||||
}
|
||||
/* 块级代码和行内代码去除边框 */
|
||||
.markdown-body p code{
|
||||
border:none;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
{% if img_scale %}
|
||||
.markdown-body p img{
|
||||
max-width: 350px;
|
||||
}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
pre.linenums{
|
||||
max-height: 500px;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* layui弹出框颜色 */
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #333;
|
||||
}
|
||||
{% endif %}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user