v0.5.8,更新内容详见change.md
17
CHANGES.md
@ -1,13 +1,26 @@
|
||||
## 版本更新记录
|
||||
|
||||
### v0.5.8 2020-08-30
|
||||
|
||||
- 优化和调整首页功能链接和样式;
|
||||
- 优化和调整文档浏览页面样式;
|
||||
- 优化和调整文档编辑器页面样式;
|
||||
- 优化和调整个人中心页面样式;
|
||||
- 优化图片分组的新建的逻辑,避免同名分组的产生;
|
||||
- 优化个人中心图片上传功能,在指定分组页面上传的图片将归属到特定图片分组;
|
||||
- 优化用户注册逻辑,限制用户名类型和长度;
|
||||
- 新增文档标签功能;
|
||||
- 新增个人中心仪表盘页面功能;
|
||||
- 新增个人中心个人资料修改页面功能;
|
||||
- 新增后台管理新增管理员功能;
|
||||
- 基于Token的API新增获取文集下文档列表和获取单篇文档接口;
|
||||
|
||||
### v0.5.7 2020-08
|
||||
|
||||
- 修复搜索的权限问题
|
||||
- 修复文集协作的权限问题;
|
||||
- 优化文档目录显示;
|
||||
- 优化文集协作管理;
|
||||
|
||||
|
||||
- 优化文档编辑器排版;
|
||||
|
||||
### v0.5.6 2020-07-31
|
||||
|
@ -40,7 +40,7 @@ SECRET_KEY = '5&71mt9@^58zdg*_!t(x6g14q*@84d%ptr%%s6e0l50zs0we3d'
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = CONFIG.getboolean('site','debug')
|
||||
|
||||
VERSIONS = '0.5.7'
|
||||
VERSIONS = '0.5.8'
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
## MrDoc觅道文档 - 记录文档,汇聚思想 - [English](./README_ENG.md)
|
||||
|
||||
  
|
||||
  
|
||||
|
||||

|
||||
|
||||
@ -140,12 +140,9 @@ python manage.py runserver
|
||||
加入MrDoc交流QQ群:
|
||||
|
||||
- 群1(付费) **735507293** [](http://shang.qq.com/wpa/qunwpa?idkey=143c23a4ffbd0ba9137d2bce3ee86c83532c05259a0542a69527e36615e64dba)
|
||||
- 群2(免费) **849206042**,入群密码:**mrdoc** [](http://shang.qq.com/wpa/qunwpa?idkey=4f71054b9a644e3263f695d5f17735ce39063ad7ed4fd5b4e2c5da1ac465e53a)
|
||||
|
||||
### 3、联系作者
|
||||
|
||||
微信(WeChat):**taoist_ling**
|
||||
|
||||
公众号:**zmister2016**
|
||||
|
||||
博客:<https://zmister.com>
|
||||
|
@ -1,6 +1,6 @@
|
||||
## MrDoc - Writing documents, gathering ideas
|
||||
|
||||
  
|
||||
  
|
||||
|
||||
|
||||

|
||||
|
@ -14,6 +14,7 @@ from app_admin.models import *
|
||||
from app_admin.utils import *
|
||||
import traceback
|
||||
from loguru import logger
|
||||
import re
|
||||
|
||||
|
||||
# 返回验证码图片
|
||||
@ -99,6 +100,12 @@ def register(request):
|
||||
elif username_exit.count() > 0: # 验证用户名
|
||||
errormsg = '用户名已被使用!'
|
||||
return render(request, 'register.html', locals())
|
||||
elif re.match('^[0-9a-z]+$',username) is False:
|
||||
errormsg = '用户名只能为英文数字组合'
|
||||
return render(request, 'register.html', locals())
|
||||
elif len(username) < 6:
|
||||
errormsg = '用户名必须大于等于6位!'
|
||||
return render(request, 'register.html', locals())
|
||||
elif len(password) < 6: # 验证密码长度
|
||||
errormsg = '密码必须大于等于6位!'
|
||||
return render(request, 'register.html', locals())
|
||||
@ -220,11 +227,11 @@ def admin_user(request):
|
||||
username = request.POST.get('username','')
|
||||
if username == '':
|
||||
user_data = User.objects.all().values_list(
|
||||
'id','last_login','is_superuser','username','email','date_joined','is_active'
|
||||
'id','last_login','is_superuser','username','email','date_joined','is_active','first_name'
|
||||
)
|
||||
else:
|
||||
user_data = User.objects.filter(username__icontains=username).values_list(
|
||||
'id','last_login','is_superuser','username','email','date_joined','is_active'
|
||||
'id','last_login','is_superuser','username','email','date_joined','is_active','first_name'
|
||||
)
|
||||
table_data = []
|
||||
for i in list(user_data):
|
||||
@ -235,7 +242,8 @@ def admin_user(request):
|
||||
'username':i[3],
|
||||
'email':i[4],
|
||||
'date_joined':i[5],
|
||||
'is_active':i[6]
|
||||
'is_active':i[6],
|
||||
'first_name':i[7]
|
||||
}
|
||||
table_data.append(item)
|
||||
return JsonResponse({'status':True,'data':table_data})
|
||||
@ -251,19 +259,35 @@ def admin_create_user(request):
|
||||
username = request.POST.get('username','') # 接收用户名参数
|
||||
email = request.POST.get('email','') # 接收email参数
|
||||
password = request.POST.get('password','') # 接收密码参数
|
||||
if username != '' and password != '' and email != '' and '@' in email:
|
||||
user_type = request.POST.get('user_type',0) # 用户类型 0为普通用户,1位管理员
|
||||
if username != '' and password != '' and email != '' and \
|
||||
'@' in email and re.match(r'^[0-9a-z]',username) and len(username) >= 6 :
|
||||
# 不允许电子邮箱重复
|
||||
if User.objects.filter(email = email).count() > 0:
|
||||
return JsonResponse({'status':False,'data':'电子邮箱不可重复'})
|
||||
# 不允许重复的用户名
|
||||
if User.objects.filter(username = username).count() > 0:
|
||||
return JsonResponse({'status': False,'data':'用户名不可重复'})
|
||||
try:
|
||||
user = User.objects.create_user(
|
||||
username=username,
|
||||
password=password,
|
||||
email=email
|
||||
)
|
||||
user.save()
|
||||
if user_type == 0:
|
||||
user = User.objects.create_user(
|
||||
username=username,
|
||||
password=password,
|
||||
email=email
|
||||
)
|
||||
user.save()
|
||||
elif int(user_type) == 1:
|
||||
user = User.objects.create_superuser(
|
||||
username=username,
|
||||
password=password,
|
||||
email=email
|
||||
)
|
||||
user.save()
|
||||
return JsonResponse({'status':True})
|
||||
except Exception as e:
|
||||
return JsonResponse({'status':False})
|
||||
return JsonResponse({'status':False,'data':'系统异常'})
|
||||
else:
|
||||
return JsonResponse({'status':False})
|
||||
return JsonResponse({'status':False,'data':'请检查参数'})
|
||||
else:
|
||||
return HttpResponse('方法不允许')
|
||||
|
||||
|
@ -4,21 +4,33 @@
|
||||
# #日期:2020/5/11
|
||||
# 博客地址:zmister.com
|
||||
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from rest_framework import serializers
|
||||
from rest_framework.serializers import ModelSerializer,SerializerMethodField
|
||||
from app_doc.models import *
|
||||
|
||||
# 文集序列化器
|
||||
class ProjectSerializer(ModelSerializer):
|
||||
create_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M')
|
||||
|
||||
class Meta:
|
||||
model = Project
|
||||
fields = ('__all__')
|
||||
|
||||
# 文档序列化器
|
||||
class DocSerializer(ModelSerializer):
|
||||
|
||||
project_name = SerializerMethodField(label="所属文集")
|
||||
modify_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
|
||||
|
||||
class Meta:
|
||||
model = Doc
|
||||
fields = ('__all__')
|
||||
|
||||
# 返回文档的所属文集
|
||||
def get_project_name(self,obj):
|
||||
pro_name = Project.objects.get(id=obj.top_doc).name
|
||||
return pro_name
|
||||
|
||||
# 文档模板序列化器
|
||||
class DocTempSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
|
@ -9,6 +9,8 @@ from app_api import views
|
||||
urlpatterns = [
|
||||
path('manage_token/',views.manage_token,name='manage_token'),# 用户Token管理
|
||||
path('get_projects/',views.get_projects,name="api_get_projects"), # 获取文集列表
|
||||
path('get_docs/',views.get_docs,name="api_get_docs"), # 获取文集的文档列表
|
||||
path('get_doc/',views.get_doc,name="api_get_doc"), # 获取单篇文档
|
||||
path('create_doc/',views.create_doc,name="api_create_doc"), # 新建文档
|
||||
path('upload_img/',views.upload_img,name="api_upload_img"), # 粘贴上传文件
|
||||
]
|
@ -70,6 +70,59 @@ def get_projects(request):
|
||||
return JsonResponse({'status':False,'data':'系统异常'})
|
||||
|
||||
|
||||
# 获取文集下的文档列表
|
||||
def get_docs(request):
|
||||
token = request.GET.get('token', '')
|
||||
try:
|
||||
token = UserToken.objects.get(token=token)
|
||||
pid = request.GET.get('pid','')
|
||||
docs = Doc.objects.filter(create_user=token.user,top_doc=pid) # 查询文集下的文档
|
||||
doc_list = []
|
||||
for doc in docs:
|
||||
item = {
|
||||
'id': doc.id, # 文档ID
|
||||
'name': doc.name, # 文档名称
|
||||
'parent_doc':doc.parent_doc, # 上级文档
|
||||
'top_doc':doc.top_doc, # 所属文集
|
||||
'status':doc.status, # 文档状态
|
||||
'create_time': doc.create_time, # 文档创建时间
|
||||
'modify_time': doc.modify_time, # 文档的修改时间
|
||||
'create_user': doc.create_user.username # 文档的创建者
|
||||
}
|
||||
doc_list.append(item)
|
||||
return JsonResponse({'status': True, 'data': doc_list})
|
||||
except ObjectDoesNotExist:
|
||||
return JsonResponse({'status': False, 'data': 'token无效'})
|
||||
except:
|
||||
logger.exception("token获取文集异常")
|
||||
return JsonResponse({'status': False, 'data': '系统异常'})
|
||||
|
||||
# 获取单篇文档
|
||||
def get_doc(request):
|
||||
token = request.GET.get('token', '')
|
||||
try:
|
||||
token = UserToken.objects.get(token=token)
|
||||
did = request.GET.get('did', '')
|
||||
doc = Doc.objects.get(create_user=token.user, id=did) # 查询文集下的文档
|
||||
|
||||
item = {
|
||||
'id': doc.id, # 文档ID
|
||||
'name': doc.name, # 文档名称
|
||||
'md_content':doc.pre_content, # 文档内容
|
||||
'parent_doc':doc.parent_doc, # 上级文档
|
||||
'top_doc':doc.top_doc, # 所属文集
|
||||
'status':doc.status, # 文档状态
|
||||
'create_time': doc.create_time, # 文档创建时间
|
||||
'modify_time': doc.modify_time, # 文档的修改时间
|
||||
'create_user': doc.create_user.username # 文档的创建者
|
||||
}
|
||||
return JsonResponse({'status': True, 'data': item})
|
||||
except ObjectDoesNotExist:
|
||||
return JsonResponse({'status': False, 'data': 'token无效'})
|
||||
except:
|
||||
logger.exception("token获取文集异常")
|
||||
return JsonResponse({'status': False, 'data': '系统异常'})
|
||||
|
||||
# 新建文档
|
||||
@require_http_methods(['GET','POST'])
|
||||
@csrf_exempt
|
||||
|
@ -5,6 +5,7 @@
|
||||
# 博客地址:zmister.com
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth import authenticate
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.models import Q
|
||||
@ -107,10 +108,11 @@ class ProjectView(APIView):
|
||||
project_list = Project.objects.filter(
|
||||
Q(create_user=request.user) | \
|
||||
Q(id__in=colla_list)
|
||||
)
|
||||
page = PageNumberPagination() # 实例化一个分页器
|
||||
page_projects = page.paginate_queryset(project_list, request, view=self) # 进行分页查询
|
||||
serializer = ProjectSerializer(page_projects, many=True) # 对分页后的结果进行序列化处理
|
||||
).order_by('-create_time')
|
||||
# page = PageNumberPagination() # 实例化一个分页器
|
||||
# page_projects = page.paginate_queryset(project_list, request, view=self) # 进行分页查询
|
||||
# serializer = ProjectSerializer(page_projects, many=True) # 对分页后的结果进行序列化处理
|
||||
serializer = ProjectSerializer(project_list, many=True)
|
||||
resp = {
|
||||
'code': 0,
|
||||
'data': serializer.data,
|
||||
@ -429,9 +431,11 @@ class DocView(APIView):
|
||||
|
||||
# 获取文档
|
||||
def get(self,request):
|
||||
pro_id = request.query_params.get('pid','')
|
||||
doc_id = request.query_params.get('did','')
|
||||
pro_id = request.query_params.get('pid','') # 文集ID
|
||||
doc_id = request.query_params.get('did','') # 文档ID
|
||||
doc_format = request.query_params.get('type','json') # 返回格式
|
||||
|
||||
# 存在文集ID和文档ID,进行数据库检索
|
||||
if pro_id != '' and doc_id != '':
|
||||
# 获取文集信息
|
||||
project = Project.objects.get(id=int(pro_id))
|
||||
@ -472,13 +476,33 @@ class DocView(APIView):
|
||||
# 获取文档内容
|
||||
try:
|
||||
doc = Doc.objects.get(id=int(doc_id), status=1)
|
||||
serializer = DocSerializer(doc)
|
||||
resp = {'code':0,'data':serializer.data}
|
||||
return Response(resp)
|
||||
if doc_format == 'json':
|
||||
serializer = DocSerializer(doc)
|
||||
resp = {'code':0,'data':serializer.data}
|
||||
return Response(resp)
|
||||
elif doc_format == 'html':
|
||||
logger.info("返回HTML")
|
||||
# return Response({'status':'html'})
|
||||
return render(request,'app_api/single_doc_detail.html',locals())
|
||||
else:
|
||||
logger.info(doc_format)
|
||||
except ObjectDoesNotExist:
|
||||
return Response({'code':4})
|
||||
# 不存在文集ID和文档ID,返回用户自己的文档列表
|
||||
else:
|
||||
return Response({'code':4})
|
||||
if request.auth:
|
||||
doc_list = Doc.objects.filter(create_user=request.user,status=1).order_by('-modify_time')
|
||||
page = PageNumberPagination() # 实例化一个分页器
|
||||
page_docs = page.paginate_queryset(doc_list, request, view=self) # 进行分页查询
|
||||
serializer = DocSerializer(page_docs, many=True) # 对分页后的结果进行序列化处理
|
||||
resp = {
|
||||
'code': 0,
|
||||
'data': serializer.data,
|
||||
'count': doc_list.count()
|
||||
}
|
||||
return Response(resp)
|
||||
else:
|
||||
return Response({'code':4})
|
||||
|
||||
# 新建文档
|
||||
def post(self, request):
|
||||
|
41
app_doc/migrations/0024_doctag_tag.py
Normal file
@ -0,0 +1,41 @@
|
||||
# Generated by Django 2.2.12 on 2020-08-18 22:19
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('app_doc', '0023_auto_20200620_2009'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Tag',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=10, verbose_name='标签名')),
|
||||
('create_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '标签',
|
||||
'verbose_name_plural': '标签',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='DocTag',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(auto_now_add=True)),
|
||||
('doc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_doc.Doc')),
|
||||
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_doc.Tag')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '文档标签',
|
||||
'verbose_name_plural': '文档标签',
|
||||
},
|
||||
),
|
||||
]
|
@ -105,6 +105,32 @@ class DocTemp(models.Model):
|
||||
verbose_name = '文档模板'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
# 标签模板
|
||||
class Tag(models.Model):
|
||||
name = models.CharField(verbose_name='标签名',max_length=10)
|
||||
create_user = models.ForeignKey(User,on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
verbose_name = '标签'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
# 文档标签
|
||||
class DocTag(models.Model):
|
||||
tag = models.ForeignKey(Tag,on_delete=models.CASCADE)
|
||||
doc = models.ForeignKey(Doc,on_delete=models.CASCADE)
|
||||
create_time = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return "{}-{}".format(self.tag.name,self.doc.name)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '文档标签'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
|
||||
# 文集导出模型
|
||||
class ProjectReport(models.Model):
|
||||
project = models.OneToOneField(Project,unique=True,on_delete=models.CASCADE)
|
||||
@ -120,7 +146,7 @@ class ProjectReport(models.Model):
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
|
||||
# 文集导出文集模型
|
||||
# 文集导出文件模型
|
||||
class ProjectReportFile(models.Model):
|
||||
project = models.ForeignKey(Project, on_delete=models.CASCADE) # 外键关联文集
|
||||
file_type = models.CharField(choices=(('epub', 'epub'), ('pdf', 'pdf'), ('docx', 'docx')), verbose_name='文件类型',max_length=10)
|
||||
|
@ -52,3 +52,9 @@ def get_img_group_cnt(value):
|
||||
def get_project_collaborator_cnt(value):
|
||||
cnt = ProjectCollaborator.objects.filter(project=value).count()
|
||||
return cnt
|
||||
|
||||
# 获取标签的文档数量
|
||||
@register.filter(name='tag_doc_cnt')
|
||||
def get_img_group_cnt(value):
|
||||
cnt = DocTag.objects.filter(tag=value).count()
|
||||
return cnt
|
@ -43,7 +43,13 @@ urlpatterns = [
|
||||
path('manage_image/',views.manage_image,name="manage_image"), # 图片管理
|
||||
path('manage_image_group/',views.manage_img_group,name="manage_img_group"), # 图片分组管理
|
||||
path('manage_attachment/',views.manage_attachment,name='manage_attachment'), # 附件管理
|
||||
##############文档标签
|
||||
path('manage_doc_tag/',views.manage_doc_tag,name="manage_doc_tag"), # 文档标签管理
|
||||
path('tag_docs/<int:tag_id>/',views.tag_docs,name="tag_docs"), # 标签文档页
|
||||
path('tag_doc/<int:tag_id>/<int:doc_id>/',views.tag_doc,name="tag_doc"), # 标签文档页
|
||||
################其他功能相关
|
||||
path('upload_doc_img/',util_upload_img.upload_img,name="upload_doc_img"), # 上传图片
|
||||
path('search/',views.search,name="search"), # 搜索功能
|
||||
path('manage_overview/',views.manage_overview,name="manage_overview"), # 个人中心概览
|
||||
path('manage_self/',views.manage_self,name="manage_self"), # 个人设置
|
||||
]
|
@ -17,10 +17,21 @@ def upload_img(request):
|
||||
manage_upload = request.FILES.get('manage_upload',None) # 图片管理上传
|
||||
dir_name = request.POST.get('dirname','')
|
||||
base_img = request.POST.get('base',None)
|
||||
group_id = request.POST.get('group_id',0)
|
||||
|
||||
if int(group_id) not in [0,-1]:
|
||||
try:
|
||||
group_id = ImageGroup.objects.get(id=group_id)
|
||||
except:
|
||||
group_id = None
|
||||
else:
|
||||
group_id = None
|
||||
|
||||
print('分组ID:',group_id)
|
||||
if img:# 上传普通图片文件
|
||||
result = img_upload(img, dir_name,request.user)
|
||||
elif manage_upload:
|
||||
result = img_upload(manage_upload, dir_name, request.user)
|
||||
result = img_upload(manage_upload, dir_name, request.user, group_id=group_id)
|
||||
elif base_img: # 上传base64编码图片
|
||||
result = base_img_upload(base_img,dir_name,request.user)
|
||||
else:
|
||||
@ -38,7 +49,7 @@ def upload_generation_dir(dir_name=''):
|
||||
return dir_name
|
||||
|
||||
# 普通图片上传
|
||||
def img_upload(files, dir_name, user):
|
||||
def img_upload(files, dir_name, user, group_id=None):
|
||||
#允许上传文件类型
|
||||
allow_suffix =["jpg", "jpeg", "gif", "png", "bmp", "webp"]
|
||||
file_suffix = files.name.split(".")[-1] # 提取图片格式
|
||||
@ -61,6 +72,7 @@ def img_upload(files, dir_name, user):
|
||||
file_path=file_url,
|
||||
file_name=file_name,
|
||||
remark='本地上传',
|
||||
group = group_id,
|
||||
)
|
||||
return {"success": 1, "url": file_url,'message':'上传图片成功'}
|
||||
|
||||
|
424
app_doc/views.py
@ -14,6 +14,7 @@ from loguru import logger
|
||||
import datetime
|
||||
import traceback
|
||||
import re
|
||||
import random
|
||||
from app_doc.report_utils import *
|
||||
from app_admin.decorators import check_headers,allow_report_file
|
||||
import os.path
|
||||
@ -566,6 +567,7 @@ def doc(request,pro_id,doc_id):
|
||||
# 获取文档内容
|
||||
try:
|
||||
doc = Doc.objects.get(id=int(doc_id),status=1)
|
||||
doc_tags = DocTag.objects.filter(doc=doc)
|
||||
except ObjectDoesNotExist:
|
||||
return render(request, '404.html')
|
||||
# 获取文集下一级文档
|
||||
@ -595,30 +597,47 @@ def create_doc(request):
|
||||
return render(request,'404.html')
|
||||
elif request.method == 'POST':
|
||||
try:
|
||||
project = request.POST.get('project','')
|
||||
parent_doc = request.POST.get('parent_doc','')
|
||||
doc_name = request.POST.get('doc_name','')
|
||||
doc_content = request.POST.get('content','')
|
||||
pre_content = request.POST.get('pre_content','')
|
||||
sort = request.POST.get('sort','')
|
||||
status = request.POST.get('status',1)
|
||||
project = request.POST.get('project','') # 文集ID
|
||||
parent_doc = request.POST.get('parent_doc','') # 上级文档ID
|
||||
doc_name = request.POST.get('doc_name','') # 文档标题
|
||||
doc_tags = request.POST.get('doc_tag','') # 文档标签
|
||||
doc_content = request.POST.get('content','') # 文档内容
|
||||
pre_content = request.POST.get('pre_content','') # 文档Markdown内容
|
||||
sort = request.POST.get('sort','') # 文档排序
|
||||
status = request.POST.get('status',1) # 文档状态
|
||||
if project != '' and doc_name != '' and project != '-1':
|
||||
# 验证请求者是否有文集的权限
|
||||
check_project = Project.objects.filter(id=project,create_user=request.user)
|
||||
colla_project = ProjectCollaborator.objects.filter(project=project,user=request.user)
|
||||
if check_project.count() > 0 or colla_project.count() > 0:
|
||||
# 创建文档
|
||||
doc = Doc.objects.create(
|
||||
name=doc_name,
|
||||
content = doc_content,
|
||||
pre_content= pre_content,
|
||||
parent_doc= int(parent_doc) if parent_doc != '' else 0,
|
||||
top_doc= int(project),
|
||||
sort = sort if sort != '' else 99,
|
||||
create_user=request.user,
|
||||
status = status
|
||||
)
|
||||
return JsonResponse({'status':True,'data':{'pro':project,'doc':doc.id}})
|
||||
# 开启事务
|
||||
with transaction.atomic():
|
||||
save_id = transaction.savepoint()
|
||||
try:
|
||||
# 创建文档
|
||||
doc = Doc.objects.create(
|
||||
name=doc_name,
|
||||
content = doc_content,
|
||||
pre_content= pre_content,
|
||||
parent_doc= int(parent_doc) if parent_doc != '' else 0,
|
||||
top_doc= int(project),
|
||||
sort = sort if sort != '' else 99,
|
||||
create_user=request.user,
|
||||
status = status
|
||||
)
|
||||
# 设置文档标签
|
||||
for t in doc_tags.split(","):
|
||||
if t != '':
|
||||
tag = Tag.objects.get_or_create(name=t,create_user=request.user)
|
||||
DocTag.objects.get_or_create(tag=tag[0],doc=doc)
|
||||
|
||||
return JsonResponse({'status': True, 'data': {'pro': project, 'doc': doc.id}})
|
||||
except Exception as e:
|
||||
logger.exception("创建文档异常")
|
||||
# 回滚事务
|
||||
transaction.savepoint_rollback(save_id)
|
||||
transaction.savepoint_commit(save_id)
|
||||
return JsonResponse({'status': False, 'data': '创建失败'})
|
||||
else:
|
||||
return JsonResponse({'status':False,'data':'无权操作此文集'})
|
||||
else:
|
||||
@ -637,6 +656,7 @@ def modify_doc(request,doc_id):
|
||||
if request.method == 'GET':
|
||||
try:
|
||||
doc = Doc.objects.get(id=doc_id) # 查询文档信息
|
||||
doc_tags = ','.join([i.tag.name for i in DocTag.objects.filter(doc=doc)]) # 查询文档标签信息
|
||||
project = Project.objects.get(id=doc.top_doc) # 查询文档所属的文集信息
|
||||
pro_colla = ProjectCollaborator.objects.filter(project=project,user=request.user) # 查询用户的协作文集信息
|
||||
if pro_colla.count() == 0:
|
||||
@ -666,6 +686,7 @@ def modify_doc(request,doc_id):
|
||||
project_id = request.POST.get('project', '') # 文集ID
|
||||
parent_doc = request.POST.get('parent_doc', '') # 上级文档ID
|
||||
doc_name = request.POST.get('doc_name', '') # 文档名称
|
||||
doc_tags = request.POST.get('doc_tag','') # 文档标签
|
||||
doc_content = request.POST.get('content', '') # 文档内容
|
||||
pre_content = request.POST.get('pre_content', '') # 文档Markdown格式内容
|
||||
sort = request.POST.get('sort', '') # 文档排序
|
||||
@ -683,23 +704,53 @@ def modify_doc(request,doc_id):
|
||||
is_pro_colla = False
|
||||
# 验证用户有权限修改文档 - 文档的创建者或文集的高级协作者
|
||||
if (request.user == doc.create_user) or (is_pro_colla is True) or (request.user == project.create_user):
|
||||
# 将现有文档内容写入到文档历史中
|
||||
DocHistory.objects.create(
|
||||
doc = doc,
|
||||
pre_content = doc.pre_content,
|
||||
create_user = request.user
|
||||
)
|
||||
# 更新文档内容
|
||||
Doc.objects.filter(id=int(doc_id)).update(
|
||||
name=doc_name,
|
||||
content=doc_content,
|
||||
pre_content=pre_content,
|
||||
parent_doc=int(parent_doc) if parent_doc != '' else 0,
|
||||
sort=sort if sort != '' else 99,
|
||||
modify_time = datetime.datetime.now(),
|
||||
status = status
|
||||
)
|
||||
return JsonResponse({'status': True,'data':'修改成功'})
|
||||
# 开启事务
|
||||
with transaction.atomic():
|
||||
save_id = transaction.savepoint()
|
||||
try:
|
||||
# 将现有文档内容写入到文档历史中
|
||||
DocHistory.objects.create(
|
||||
doc = doc,
|
||||
pre_content = doc.pre_content,
|
||||
create_user = request.user
|
||||
)
|
||||
# 更新文档内容
|
||||
Doc.objects.filter(id=int(doc_id)).update(
|
||||
name=doc_name,
|
||||
content=doc_content,
|
||||
pre_content=pre_content,
|
||||
parent_doc=int(parent_doc) if parent_doc != '' else 0,
|
||||
sort=sort if sort != '' else 99,
|
||||
modify_time = datetime.datetime.now(),
|
||||
status = status
|
||||
)
|
||||
# 更新文档标签
|
||||
doc_tag_list = doc_tags.split(",") if doc_tags != "" else []
|
||||
# print(doc_tags,doc_tag_list)
|
||||
# 如果没有设置标签,则删除此文档的所有标签
|
||||
if len(doc_tag_list) == 0:
|
||||
DocTag.objects.filter(doc=doc).delete()
|
||||
else:
|
||||
current_doc_tags = [i.tag.name for i in DocTag.objects.filter(doc=doc)] # 获取当前文档的标签
|
||||
# 遍历当前文档标签,如果不在新的标签列表,则删除
|
||||
for tag in current_doc_tags:
|
||||
if tag not in doc_tag_list:
|
||||
tag = Tag.objects.get(name=tag,create_user=request.user)
|
||||
DocTag.objects.filter(doc=doc,tag=tag).delete()
|
||||
# 遍历新的标签列表,如果不在当前文档标签中,则创建
|
||||
for t in doc_tag_list:
|
||||
if t not in current_doc_tags and current_doc_tags != '':
|
||||
tag = Tag.objects.get_or_create(name=t, create_user=request.user)
|
||||
DocTag.objects.get_or_create(tag=tag[0], doc=doc)
|
||||
|
||||
return JsonResponse({'status': True, 'data': '修改成功'})
|
||||
except:
|
||||
logger.exception("修改文档异常")
|
||||
# 回滚事务
|
||||
transaction.savepoint_rollback(save_id)
|
||||
transaction.savepoint_commit(save_id)
|
||||
return JsonResponse({'status': False, 'data': '修改失败'})
|
||||
|
||||
else:
|
||||
return JsonResponse({'status':False,'data':'未授权请求'})
|
||||
else:
|
||||
@ -1646,7 +1697,7 @@ def manage_image(request):
|
||||
if int(g_id) == 0:
|
||||
image_list = Image.objects.filter(user=request.user).order_by('-create_time') # 查询所有图片
|
||||
elif int(g_id) == -1:
|
||||
image_list = Image.objects.filter(user=request.user,group_id=None).order_by('-create_time') # 查询指定分组的图片
|
||||
image_list = Image.objects.filter(user=request.user,group_id=None).order_by('-create_time') # 查询未分组的图片
|
||||
else:
|
||||
image_list = Image.objects.filter(user=request.user,group_id=g_id).order_by('-create_time') # 查询指定分组的图片
|
||||
paginator = Paginator(image_list, 18)
|
||||
@ -1728,7 +1779,7 @@ def manage_img_group(request):
|
||||
if int(types) == 0:
|
||||
group_name = request.POST.get('group_name', '')
|
||||
if group_name not in ['','默认分组','未分组']:
|
||||
ImageGroup.objects.create(
|
||||
ImageGroup.objects.get_or_create(
|
||||
user = request.user,
|
||||
group_name = group_name
|
||||
)
|
||||
@ -1977,8 +2028,28 @@ def search(request):
|
||||
).order_by("-create_time")
|
||||
|
||||
# 搜索标签
|
||||
# elif search_type == 'tag':
|
||||
# pass
|
||||
elif search_type == 'tag':
|
||||
# 认证用户
|
||||
if is_auth:
|
||||
colla_list = [i.project.id for i in ProjectCollaborator.objects.filter(user=request.user)] # 用户的协作文集
|
||||
open_list = [i.id for i in Project.objects.filter(
|
||||
Q(role=0) | Q(create_user=request.user)
|
||||
)] # 公开文集
|
||||
|
||||
view_list = list(set(open_list).union(set(colla_list))) # 合并上述两个文集ID列表
|
||||
|
||||
tag_list = Tag.objects.filter(name__icontains=kw) # 查询符合条件的标签
|
||||
tag_doc_list = [i.doc.id for i in DocTag.objects.filter(tag__in=tag_list)] # 获取符合条件的标签文档
|
||||
|
||||
data_list = Doc.objects.filter(
|
||||
Q(top_doc__in=view_list), # 包含用户可浏览到的文集
|
||||
Q(id__in=tag_doc_list), # 包含符合条件标签的文档ID列表
|
||||
Q(create_time__gte=start_date, create_time__lte=end_date), # 筛选创建时间
|
||||
).order_by('-create_time')
|
||||
# 游客
|
||||
else:
|
||||
pass
|
||||
|
||||
else:
|
||||
return render(request, 'app_doc/search.html')
|
||||
|
||||
@ -1997,6 +2068,7 @@ def search(request):
|
||||
else:
|
||||
return render(request,'app_doc/search.html')
|
||||
|
||||
|
||||
# 文档Markdown文件下载
|
||||
@require_http_methods(['GET',"POST"])
|
||||
def download_doc_md(request,doc_id):
|
||||
@ -2019,3 +2091,275 @@ def download_doc_md(request,doc_id):
|
||||
response.write(doc.pre_content)
|
||||
|
||||
return response
|
||||
|
||||
|
||||
# 个人中心 - 概览
|
||||
@login_required()
|
||||
@require_http_methods(['GET'])
|
||||
def manage_overview(request):
|
||||
pro_list = Project.objects.filter(create_user=request.user).order_by('-create_time')
|
||||
colla_pro_cnt = ProjectCollaborator.objects.filter(user=request.user).count()
|
||||
total_pro_cnt = pro_list.count() + colla_pro_cnt
|
||||
total_doc_cnt = Doc.objects.filter(create_user=request.user).count()
|
||||
total_tag_cnt = Tag.objects.filter(create_user=request.user).count()
|
||||
|
||||
doc_active_list = Doc.objects.filter(create_user=request.user).order_by('-modify_time')[:5]
|
||||
|
||||
return render(request,'app_doc/manage_overview.html',locals())
|
||||
|
||||
# 个人中心 - 文档标签
|
||||
@login_required()
|
||||
@require_http_methods(['GET','POST'])
|
||||
def manage_doc_tag(request):
|
||||
if request.method == 'GET':
|
||||
tags = Tag.objects.filter(create_user=request.user)
|
||||
return render(request,'app_doc/manage_doc_tag.html',locals())
|
||||
# 操作分组
|
||||
elif request.method == 'POST':
|
||||
types = request.POST.get('types', None) # 请求类型,0表示创建标签,1表示修改标签,2表示删除标签,3表示获取标签
|
||||
# 创建分组
|
||||
if int(types) == 0:
|
||||
tag_name = request.POST.get('tag_name', '')
|
||||
if tag_name != '':
|
||||
Tag.objects.create(
|
||||
user=request.user,
|
||||
name=tag_name
|
||||
)
|
||||
return JsonResponse({'status': True, 'data': 'ok'})
|
||||
else:
|
||||
return JsonResponse({'status': False, 'data': '名称无效'})
|
||||
# 修改分组
|
||||
elif int(types) == 1:
|
||||
try:
|
||||
tag_name = request.POST.get('tag_name', '')
|
||||
if tag_name != "":
|
||||
tag_id = request.POST.get('tag_id', '')
|
||||
if tag_id != "":
|
||||
print(tag_id,tag_name)
|
||||
Tag.objects.filter(id=tag_id, create_user=request.user).update(name=tag_name)
|
||||
return JsonResponse({'status': True, 'data': '修改成功'})
|
||||
else:
|
||||
return JsonResponse({'status': False, 'data': '标签ID无效'})
|
||||
else:
|
||||
return JsonResponse({'status': False, 'data': '名称无效'})
|
||||
except Exception as e:
|
||||
logger.exception("修改异常")
|
||||
return JsonResponse({'status': False, 'data': '异常错误'})
|
||||
|
||||
# 删除分组
|
||||
elif int(types) == 2:
|
||||
try:
|
||||
tag_id = request.POST.get('tag_id', '')
|
||||
tag = Tag.objects.get(id=tag_id, create_user=request.user) # 查询分组
|
||||
tag.delete() # 删除标签
|
||||
return JsonResponse({'status': True, 'data': '删除完成'})
|
||||
except:
|
||||
logger.exception("删除标签出错")
|
||||
return JsonResponse({'status': False, 'data': '删除错误'})
|
||||
# 获取分组
|
||||
elif int(types) == 3:
|
||||
try:
|
||||
tag_list = []
|
||||
return JsonResponse({'status': True, 'data': tag_list})
|
||||
except:
|
||||
logger.exception("获取文档标签出错")
|
||||
return JsonResponse({'status': False, 'data': '出现错误'})
|
||||
|
||||
|
||||
# 标签文档关系页
|
||||
def tag_docs(request,tag_id):
|
||||
# 获取标签
|
||||
try:
|
||||
# 颜色列表
|
||||
color_list = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293', '#e062ae', '#e062ae']
|
||||
# 获取标签信息
|
||||
tag = Tag.objects.get(id=int(tag_id))
|
||||
# 获取标签的文档信息
|
||||
# 如果访问者已经登录
|
||||
if request.user.is_authenticated:
|
||||
# 判断是否为标签的创建者
|
||||
if request.user == tag.create_user:
|
||||
# 获取标签的所有文档
|
||||
view_list = [i.id for i in Project.objects.filter(create_user=request.user)]
|
||||
docs = DocTag.objects.filter(tag=tag,doc__status=1)
|
||||
else:
|
||||
# 获取有权限的文档
|
||||
colla_list = [i.project.id for i in ProjectCollaborator.objects.filter(user=request.user)] # 用户的协作文集
|
||||
open_list = [i.id for i in Project.objects.filter(
|
||||
Q(role=0) | Q(create_user=tag.create_user)
|
||||
)] # 公开文集
|
||||
|
||||
view_list = list(set(open_list).union(set(colla_list))) # 合并上述两个文集ID列表
|
||||
# 查询可浏览文集的文档
|
||||
doc_list = [i for i in Doc.objects.filter(top_doc__in=view_list,status=1)]
|
||||
# 筛选可浏览的文档的标签文档
|
||||
docs = DocTag.objects.filter(tag=tag,doc__in=doc_list)
|
||||
|
||||
else:
|
||||
# 查询标签创建者的公开文集
|
||||
open_list = [i.id for i in Project.objects.filter(
|
||||
role=0,create_user=tag.create_user
|
||||
)]
|
||||
view_list = open_list
|
||||
doc_list = [i for i in Doc.objects.filter(top_doc__in=view_list,status=1)]
|
||||
docs = DocTag.objects.filter(tag=tag,doc__in=doc_list)
|
||||
|
||||
# 获取文档的其他标签信息
|
||||
current_link_list = [] # 文档的所有标签ID列表
|
||||
for doc in docs:
|
||||
other_tags = [str(i.tag.id) for i in DocTag.objects.filter(~Q(tag=tag), doc=doc.doc)]
|
||||
current_link_list.extend(other_tags)
|
||||
|
||||
# 标签的节点列表
|
||||
tag_nodes_list = [
|
||||
# {'id':str(tag.id),'name':tag.name,'symbolSize':50,'value':docs.count(),'itemStyle':{'color':random.choice(color_list)}}
|
||||
]
|
||||
# 标签的关系列表
|
||||
tag_links_list = []
|
||||
# 标签分类列表
|
||||
tag_cate = []
|
||||
|
||||
# 添加用户创建的所有标签到节点列表
|
||||
for t in Tag.objects.filter(create_user=tag.create_user):
|
||||
tag_cate.append({'name':t.name})
|
||||
if t.name == tag.name:
|
||||
item = {
|
||||
'id': str(t.id),
|
||||
'name': t.name,
|
||||
'symbolSize': 50,
|
||||
'value': DocTag.objects.filter(tag=t,doc__status=1,doc__top_doc__in=view_list).count(),
|
||||
'itemStyle': {'color': random.choice(color_list)}
|
||||
}
|
||||
else:
|
||||
item = {
|
||||
'id':str(t.id),
|
||||
'name':t.name,
|
||||
'symbolSize':25,
|
||||
'value':DocTag.objects.filter(tag=t,doc__status=1,doc__top_doc__in=view_list).count(),
|
||||
'itemStyle':{'color':random.choice(color_list)}
|
||||
}
|
||||
tag_nodes_list.append(item)
|
||||
# 查询非主标签的关联标签
|
||||
sub_tags = DocTag.objects.filter(tag=t,doc__status=1,doc__top_doc__in=view_list) # 获取包含t标签的文档
|
||||
for sub_tag in sub_tags:
|
||||
sub_docs = DocTag.objects.filter(doc=sub_tag.doc,doc__top_doc__in=view_list) # 获取包含文档的标签
|
||||
for sub_doc in sub_docs:
|
||||
if str(sub_tag.tag.id) != str(sub_doc.tag.id):
|
||||
item = {
|
||||
'source': str(sub_tag.tag.id),
|
||||
'target': str(sub_doc.tag.id),
|
||||
'value' : sub_doc.doc.name,
|
||||
'id': sub_doc.doc.id,
|
||||
'pid': sub_doc.doc.top_doc,
|
||||
'label':{
|
||||
'normal':{
|
||||
'show':'true',
|
||||
'formatter':"{c}",
|
||||
'fontsize':'10px',
|
||||
}
|
||||
}
|
||||
}
|
||||
item_1 = {
|
||||
'source': str(sub_doc.tag.id),
|
||||
'target': str(sub_tag.tag.id),
|
||||
'value': sub_doc.doc.name,
|
||||
'id':sub_doc.doc.id,
|
||||
'pid': sub_doc.doc.top_doc,
|
||||
'label': {
|
||||
'normal': {
|
||||
'show': 'true',
|
||||
'formatter': "{c}",
|
||||
'fontsize': '10px',
|
||||
}
|
||||
}
|
||||
}
|
||||
if item_1 not in tag_links_list:
|
||||
tag_links_list.append(item)
|
||||
|
||||
return render(request, 'app_doc/tag_docs.html', locals())
|
||||
except Exception as e:
|
||||
logger.exception("标签文档页访问异常")
|
||||
return render(request, '404.html')
|
||||
|
||||
|
||||
# 标签文档页
|
||||
@require_http_methods(['GET'])
|
||||
def tag_doc(request,tag_id,doc_id):
|
||||
try:
|
||||
if tag_id != '' and doc_id != '':
|
||||
doc = Doc.objects.get(id=int(doc_id), status=1)
|
||||
# 获取文档的文集信息,以判断是否有权限访问
|
||||
project = Project.objects.get(id=int(doc.top_doc))
|
||||
# 获取文集的协作用户信息
|
||||
if request.user.is_authenticated:
|
||||
colla_user = ProjectCollaborator.objects.filter(project=project,user=request.user)
|
||||
if colla_user.exists():
|
||||
colla_user_role = colla_user[0].role
|
||||
colla_user = colla_user.count()
|
||||
else:
|
||||
colla_user = colla_user.count()
|
||||
else:
|
||||
colla_user = 0
|
||||
|
||||
# 私密文集且访问者非创建者、协作者 - 不能访问
|
||||
if (project.role == 1) and (request.user != project.create_user) and (colla_user == 0):
|
||||
return render(request, '404.html')
|
||||
# 指定用户可见文集
|
||||
elif project.role == 2:
|
||||
user_list = project.role_value
|
||||
if request.user.is_authenticated: # 认证用户判断是否在许可用户列表中
|
||||
if (request.user.username not in user_list) and \
|
||||
(request.user != project.create_user) and \
|
||||
(colla_user == 0): # 访问者不在指定用户之中,也不是协作者
|
||||
return render(request, '404.html')
|
||||
else: # 游客直接返回404
|
||||
return render(request, '404.html')
|
||||
# 访问码可见
|
||||
elif project.role == 3:
|
||||
# 浏览用户不为创建者和协作者 - 需要访问码
|
||||
if (request.user != project.create_user) and (colla_user == 0):
|
||||
viewcode = project.role_value
|
||||
viewcode_name = 'viewcode-{}'.format(project.id)
|
||||
r_viewcode = request.COOKIES[
|
||||
viewcode_name] if viewcode_name in request.COOKIES.keys() else 0 # 从cookie中获取访问码
|
||||
if viewcode != r_viewcode: # cookie中的访问码不等于文集访问码,跳转到访问码认证界面
|
||||
return redirect('/check_viewcode/?to={}'.format(request.path))
|
||||
|
||||
# 获取文档内容
|
||||
try:
|
||||
# 获取标签信息
|
||||
tag = Tag.objects.get(id=int(tag_id))
|
||||
# 获取标签文档信息
|
||||
docs = DocTag.objects.filter(tag=tag)
|
||||
# 获取文档的标签
|
||||
doc_tags = DocTag.objects.filter(doc=doc)
|
||||
except ObjectDoesNotExist:
|
||||
return render(request, '404.html')
|
||||
return render(request,'app_doc/tag_doc_single.html',locals())
|
||||
else:
|
||||
return HttpResponse('参数错误')
|
||||
except Exception as e:
|
||||
logger.exception("文集浏览出错")
|
||||
return render(request,'404.html')
|
||||
|
||||
# 个人中心 - 个人设置
|
||||
@login_required()
|
||||
def manage_self(request):
|
||||
if request.method == 'GET':
|
||||
user = User.objects.get_by_natural_key(request.user)
|
||||
return render(request,'app_doc/manage_self.html',locals())
|
||||
elif request.method == 'POST':
|
||||
first_name = request.POST.get('first_name','')
|
||||
email = request.POST.get('email',None)
|
||||
user = User.objects.get_by_natural_key(request.user)
|
||||
if User.objects.filter(first_name=first_name).count() > 0 and user.first_name != first_name:
|
||||
return JsonResponse({'status':False,'data':'昵称已被使用'})
|
||||
if User.objects.filter(email=email).count() > 0 and user.email != email:
|
||||
return JsonResponse({'status':False,'data':'电子邮箱已被使用'})
|
||||
if email != '' and '@' in email:
|
||||
user.email = email
|
||||
user.first_name = first_name
|
||||
user.save()
|
||||
return JsonResponse({'status':True,'data':'ok'})
|
||||
else:
|
||||
return JsonResponse({'status':False,'data':'参数不正确'})
|
Before Width: | Height: | Size: 187 KiB |
BIN
static/dashang/dashang_alipay.webp
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 40 KiB |
BIN
static/dashang/dashang_qq.webp
Normal file
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 39 KiB |
BIN
static/dashang/dashang_wx.webp
Normal file
After Width: | Height: | Size: 11 KiB |
@ -3832,7 +3832,7 @@
|
||||
}
|
||||
|
||||
return "<div class='echart' style='width:100%;min-height:350px;height:"+ custom_height +"px;' id='echart-"+ map_id +"'>"+code+"</div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return marked.Renderer.prototype.code.apply(this, arguments);
|
||||
|
1
static/icon_img/create-doc-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597540219775" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3907" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M96 1024V0h448v384h384v640H96z m96-256a32 32 0 0 0 32 32h96a32 32 0 0 0 32-32v-96a32 32 0 0 0-32-32H224a32 32 0 0 0-32 32v96z m160-416a32 32 0 0 0-32-32H224a32 32 0 0 0-32 32v96a32 32 0 0 0 32 32h96a32 32 0 0 0 32-32v-96z m128 160a32 32 0 0 0-32-32H352a32 32 0 0 0-32 32v96a32 32 0 0 0 32 32h96a32 32 0 0 0 32-32v-96z m0 320a32 32 0 0 0-32-32H352a32 32 0 0 0-32 32v96a32 32 0 0 0 32 32h96a32 32 0 0 0 32-32v-96z" fill="#3CC451" p-id="3908"></path><path d="M608 0l320 320H608V0z" fill="#B0E7B8" p-id="3909"></path></svg>
|
After Width: | Height: | Size: 894 B |
1
static/icon_img/create-pro-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597540562340" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4295" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M526.628571 512L190.171429 285.257143l343.771428-219.428572 336.457143 219.428572z" fill="#F4B1B2" p-id="4296"></path><path d="M526.628571 541.257143c-7.314286 0-7.314286 0-14.628571-7.314286L175.542857 307.2c-7.314286 0-7.314286-14.628571-7.314286-21.942857 0-7.314286 7.314286-14.628571 14.628572-21.942857L519.314286 36.571429c7.314286-7.314286 21.942857-7.314286 29.257143 0l343.771428 219.428571c7.314286 7.314286 14.628571 14.628571 14.628572 21.942857 0 7.314286-7.314286 14.628571-14.628572 21.942857L541.257143 533.942857s-7.314286 7.314286-14.628572 7.314286zM241.371429 285.257143l285.257142 190.171428 292.571429-190.171428-292.571429-190.171429-285.257142 190.171429z" fill="#D72822" p-id="4297"></path><path d="M526.628571 716.8L124.342857 446.171429c-14.628571-7.314286-21.942857-29.257143-7.314286-36.571429 7.314286-14.628571 21.942857-14.628571 36.571429-7.314286L533.942857 658.285714l394.971429-256c14.628571-7.314286 29.257143-7.314286 36.571428 7.314286s7.314286 29.257143-7.314285 36.571429L526.628571 716.8z" fill="#D72822" p-id="4298"></path><path d="M526.628571 877.714286L124.342857 607.085714c-14.628571-7.314286-21.942857-21.942857-7.314286-36.571428 7.314286-14.628571 21.942857-14.628571 36.571429-7.314286l380.342857 256 394.971429-256c14.628571-7.314286 29.257143-7.314286 36.571428 7.314286 7.314286 14.628571 7.314286 29.257143-7.314285 36.571428L526.628571 877.714286z" fill="#D72822" p-id="4299"></path></svg>
|
After Width: | Height: | Size: 1.8 KiB |
1
static/icon_img/manage-doc-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597549724434" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28428" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M146.863158 0h538.947368l296.421053 296.421053v619.789473c0 59.284211-48.505263 107.789474-107.789474 107.789474H146.863158c-59.284211 0-107.789474-48.505263-107.789474-107.789474V107.789474c0-59.284211 48.505263-107.789474 107.789474-107.789474z" fill="#2F77F1" p-id="28429"></path><path d="M688.505263 0l296.421053 296.421053h-296.421053V0zM549.726316 661.557895H142.821053c-14.821053 0-25.6-12.126316-25.6-25.6V633.263158c0-14.821053 12.126316-25.6 25.6-25.6h406.905263c13.473684 0 25.6 12.126316 25.6 25.6v2.694737c0 13.473684-10.778947 25.6-25.6 25.6z m-134.736842-350.31579H142.821053c-14.821053 0-25.6-10.778947-25.6-25.6V282.947368c0-14.821053 12.126316-25.6 25.6-25.6h272.168421c13.473684 0 25.6 12.126316 25.6 25.6v2.694737c0 13.473684-10.778947 25.6-25.6 25.6z m-272.168421 121.263158h245.221052c13.473684 0 25.6 12.126316 25.6 25.6v2.694737c0 13.473684-12.126316 25.6-25.6 25.6H142.821053c-14.821053 0-25.6-10.778947-25.6-25.6V458.105263c0-14.821053 12.126316-25.6 25.6-25.6z" fill="#AFFCFE" p-id="28430"></path></svg>
|
After Width: | Height: | Size: 1.4 KiB |
1
static/icon_img/manage-doc-pre-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597585176477" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7065" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M789.333333 785.066667H234.666667c-23.466667 0-42.666667-19.2-42.666667-42.666667v-597.333333c0-23.466667 19.2-42.666667 42.666667-42.666667h554.666666c23.466667 0 42.666667 19.2 42.666667 42.666667v597.333333c0 23.466667-19.2 42.666667-42.666667 42.666667z" fill="#FFC53D" p-id="7066"></path><path d="M654.933333 657.066667c-19.2 61.866667-74.666667 106.666667-142.933333 106.666666s-123.733333-44.8-142.933333-106.666666H128c-12.8 0-21.333333 8.533333-21.333333 21.333333v213.333333c0 12.8 8.533333 21.333333 21.333333 21.333334h768c12.8 0 21.333333-8.533333 21.333333-21.333334v-213.333333c0-12.8-8.533333-21.333333-21.333333-21.333333H654.933333z" fill="#1890FF" p-id="7067"></path><path d="M706.133333 273.066667H317.866667c-10.666667 0-19.2-8.533333-19.2-19.2v-6.4c0-10.666667 8.533333-19.2 19.2-19.2h390.4c10.666667 0 19.2 8.533333 19.2 19.2v6.4c-2.133333 10.666667-10.666667 19.2-21.333334 19.2zM706.133333 443.733333H317.866667c-10.666667 0-19.2-8.533333-19.2-19.2v-6.4c0-10.666667 8.533333-19.2 19.2-19.2h390.4c10.666667 0 19.2 8.533333 19.2 19.2v6.4c-2.133333 10.666667-10.666667 19.2-21.333334 19.2zM533.333333 593.066667H320c-12.8 0-21.333333-8.533333-21.333333-21.333334s8.533333-21.333333 21.333333-21.333333h213.333333c12.8 0 21.333333 8.533333 21.333334 21.333333 0 10.666667-8.533333 21.333333-21.333334 21.333334z" fill="#FFFFFF" p-id="7068"></path></svg>
|
After Width: | Height: | Size: 1.7 KiB |
1
static/icon_img/manage-download-no.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597547789827" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25486" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M511.3 63.2c-248 0-449 201-449 449s201 449 449 449 449-201 449-449-201-449-449-449z m2.4 814.9l-195.2-338h149.6v-383c0-6.4 5.3-11.7 11.7-11.7h68.5c6.4 0 11.7 5.3 11.7 11.7v383h148.9l-195.2 338z" fill="#8a8a8a" p-id="25487"></path></svg>
|
After Width: | Height: | Size: 612 B |
1
static/icon_img/manage-download-yes.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597547789827" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25486" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M511.3 63.2c-248 0-449 201-449 449s201 449 449 449 449-201 449-449-201-449-449-449z m2.4 814.9l-195.2-338h149.6v-383c0-6.4 5.3-11.7 11.7-11.7h68.5c6.4 0 11.7 5.3 11.7 11.7v383h148.9l-195.2 338z" fill="#1296db" p-id="25487"></path></svg>
|
After Width: | Height: | Size: 612 B |
1
static/icon_img/manage-eye-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597547358202" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11769" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 149.333333C121.6 149.333333 0 512 0 512s134.4 362.666667 512 362.666667 512-362.666667 512-362.666667S902.4 149.333333 512 149.333333z m0 533.333334c-93.866667 0-170.666667-76.8-170.666667-170.666667s76.8-170.666667 170.666667-170.666667 170.666667 76.8 170.666667 170.666667-76.8 170.666667-170.666667 170.666667z" fill="#707070" p-id="11770"></path><path d="M512 512m-128 0a128 128 0 1 0 256 0 128 128 0 1 0-256 0Z" fill="#707070" p-id="11771"></path></svg>
|
After Width: | Height: | Size: 840 B |
1
static/icon_img/manage-pro-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597547489850" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13137" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M239.2 244.8c-8 0-17.6-1.6-25.6-3.2-25.6-4.8-48-19.2-64-36.8v657.6c0 48 11.2 83.2 35.2 105.6 27.2 27.2 64 24 64 24h624V244.8H239.2z" fill="#FFFFFF" p-id="13138"></path><path d="M149.6 123.2c0 49.6 40 89.6 89.6 89.6h590.4c-6.4-11.2-12.8-25.6-17.6-43.2H492v-32h315.2c0-11.2 0-20.8 1.6-32H372v-32h444.8c3.2-12.8 9.6-27.2 16-41.6H239.2c-49.6 0-89.6 40-89.6 91.2z" fill="#FFFFFF" p-id="13139"></path><path d="M906.4 32V0H239.2C172 0 117.6 54.4 117.6 121.6v740.8c0 57.6 16 100.8 46.4 129.6 32 30.4 70.4 32 83.2 32H906.4V212.8h-36.8c-6.4-8-62.4-68.8 0-180.8h36.8z m-33.6 960h-624s-36.8 3.2-64-24c-24-22.4-35.2-57.6-35.2-105.6V204.8c16 17.6 38.4 32 64 36.8 8 1.6 17.6 3.2 25.6 3.2h633.6V992z m-56-918.4H372v32h436.8c-1.6 11.2-1.6 20.8-1.6 32H492v32h320c4.8 17.6 11.2 32 17.6 43.2H239.2c-49.6 0-89.6-40-89.6-89.6 0-51.2 40-91.2 89.6-91.2h593.6c-6.4 14.4-12.8 28.8-16 41.6z" fill="" p-id="13140"></path><path d="M808.8 928V244.8H239.2c-9.6 0-17.6-1.6-25.6-3.2V928h595.2z" fill="#9DE8F7" p-id="13141"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
1
static/icon_img/manage-tag-icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1597844024224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2182" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M814.833713 1024a35.323663 35.323663 0 0 1-17.275076-4.512147L549.519482 880.513732a66.006262 66.006262 0 0 0-65.36167 0L254.296163 1009.432212a64.45924 64.45924 0 0 1-65.361669 0A64.45924 64.45924 0 0 1 156.318119 952.321325v-816.053976A136.395752 136.395752 0 0 1 292.584952 0.000516h438.322831a136.395752 136.395752 0 0 1 136.782507 136.266833v650.780485a35.323663 35.323663 0 0 1-70.647327 0V136.267349a65.748425 65.748425 0 0 0-65.619506-65.619506h-438.322831a65.748425 65.748425 0 0 0-65.619507 65.619506V943.683787l221.868704-125.437681a136.653588 136.653588 0 0 1 135.364404 0.644593L832.108789 957.86482a35.323663 35.323663 0 0 1-17.275076 66.13518z" fill="#0060F7" p-id="2183"></path><path d="M666.190706 293.676812H353.176637a35.323663 35.323663 0 1 1 0-70.647326h313.014069a35.323663 35.323663 0 1 1 0 70.647326zM551.711096 473.904847h-198.534459a35.323663 35.323663 0 0 1 0-70.647327h198.534459a35.323663 35.323663 0 0 1 0 70.647327z" fill="#FF4B9D" p-id="2184"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -55,4 +55,96 @@
|
||||
}
|
||||
.opera-img-btn i:hover{
|
||||
color:red;
|
||||
}
|
||||
|
||||
/* 覆盖layUI样式 */
|
||||
.layui-layout-admin .layui-body{
|
||||
/* background-color: #f0f2f5; */
|
||||
}
|
||||
.layui-btn a{
|
||||
color:white;
|
||||
}
|
||||
.layui-icon{
|
||||
font-size: 14px;
|
||||
}
|
||||
.layui-btn{
|
||||
border-radius: 4px;
|
||||
}
|
||||
.layui-btn-normal{
|
||||
background-color: #2176ff;
|
||||
}
|
||||
.layui-btn-warm{
|
||||
background-color: #ff213b;
|
||||
}
|
||||
.layui-btn-primary:hover{
|
||||
border-color: #2176ff;
|
||||
color:#2176ff;
|
||||
}
|
||||
/* 左侧菜单栏背景 */
|
||||
.layui-bg-black,.layui-nav {
|
||||
background-color: #23262e!important;
|
||||
}
|
||||
/* 左侧菜单栏悬浮样式 */
|
||||
.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
.layui-nav-tree .layui-nav-bar{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 顶部菜单栏悬浮样式 */
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
|
||||
/* 管理文档文档状态条件筛选 管理图片图片分组筛选 */
|
||||
.doc_status_condition > a.current{
|
||||
color: #000!important;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 设置输入框的高度 和layui-btn-sm一致 */
|
||||
.layui-input{
|
||||
height: 30px !important;
|
||||
}
|
||||
/* layui引用文本样式 */
|
||||
.layui-elem-quote{
|
||||
border-left: 5px solid #2176ff !important;
|
||||
}
|
||||
/* layui单选框样式 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #2176ff;
|
||||
}
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 开关样式 */
|
||||
.layui-form-onswitch{
|
||||
border-color: #2176ff;
|
||||
background-color: #2176ff;
|
||||
}
|
||||
/* 选项卡样式 */
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #2176ff;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #2176ff !important;
|
||||
}
|
||||
/* 表格 */
|
||||
table thead tr{
|
||||
background-color: #e8ebf0 !important;
|
||||
}
|
||||
/* 弹出层按钮 */
|
||||
.layui-layer-btn .layui-layer-btn0{
|
||||
border-color: #2176ff !important;
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 分页按钮 */
|
||||
.layui-laypage a:hover {
|
||||
color: #2176ff !important;
|
||||
}
|
||||
/* 面包屑链接 */
|
||||
.layui-breadcrumb a:hover{
|
||||
color: #2176ff !important;
|
||||
}
|
@ -289,11 +289,15 @@ li.active > a,li.active > div > a{
|
||||
font-family: helvetica neue,Helvetica,Arial,sans-serif;
|
||||
overflow: visible;
|
||||
height: 50px;
|
||||
padding: 0 8px;
|
||||
padding: 0 8px 0 8px;
|
||||
z-index: 2;
|
||||
font-size: .85em;
|
||||
color: #7e888b;
|
||||
background: 0 0;
|
||||
/* 固定在顶部 */
|
||||
/* width: 100%; */
|
||||
/* position: fixed; */
|
||||
/* background-color: #ffffff; */
|
||||
}
|
||||
.doc-header .btn {
|
||||
display: block;
|
||||
@ -313,6 +317,7 @@ li.active > a,li.active > div > a{
|
||||
}
|
||||
.pull-right {
|
||||
float: right!important;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.pull-left {
|
||||
float: left!important;
|
||||
@ -332,16 +337,17 @@ li.active > a,li.active > div > a{
|
||||
.doc-body-content{
|
||||
position: relative;
|
||||
outline: 0;
|
||||
/* top:50px; */
|
||||
}
|
||||
.doc-body-content-div{
|
||||
position: relative;
|
||||
max-width: 800px;
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 15px 15px 15px 5px;
|
||||
}
|
||||
.doc-content{
|
||||
outline: 0;
|
||||
max-width: 800px;
|
||||
max-width: 900px;
|
||||
flex: 1 1 auto;
|
||||
display: block;
|
||||
padding: 0;
|
||||
@ -428,7 +434,16 @@ li.active > a,li.active > div > a{
|
||||
.markdown-body p code,.markdown-body li code,.markdown-body h1 code,.markdown-body h2 code,.markdown-body h3 code,.markdown-body h4 code,.markdown-body h5 code,.markdown-body h6 code{
|
||||
border:none !important;
|
||||
color:#e91e63 !important;
|
||||
font-family: sans-serif;
|
||||
/* font-family: sans-serif; */
|
||||
}
|
||||
|
||||
/* 文档底部按钮样式 */
|
||||
.doc-bottom-btn{
|
||||
border: none;
|
||||
background-color: #fff;
|
||||
line-height: 14px;
|
||||
height: 14px;
|
||||
color: rgba(0,0,0,.65);
|
||||
}
|
||||
|
||||
/* 自定义按钮样式 */
|
||||
@ -437,6 +452,29 @@ li.active > a,li.active > div > a{
|
||||
color:#1E9FFF;
|
||||
}
|
||||
|
||||
/* 编辑器文档标题输入框文字样式 */
|
||||
input#doc-name,input#doctemp-name{
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 覆盖layUI样式 */
|
||||
.layui-btn{
|
||||
border-radius: 4px;
|
||||
}
|
||||
button.layui-btn-normal,.doctemp-list a.layui-btn-normal{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
.layui-btn-primary:hover{
|
||||
color: #2176ff !important;
|
||||
border-color: #2176ff !important;
|
||||
}
|
||||
/* 弹出层按钮 */
|
||||
.layui-layer-btn .layui-layer-btn0{
|
||||
border-color: #2176ff !important;
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
|
||||
/* 文字悬浮提示样式 */
|
||||
/* tooltip样式 */
|
||||
[tooltip] {
|
||||
@ -450,7 +488,7 @@ li.active > a,li.active > div > a{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 8px 15px;
|
||||
padding: 8px 8px;
|
||||
max-width: 200px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.4);
|
||||
|
@ -60,7 +60,7 @@
|
||||
transition: opacity .25s linear;
|
||||
}
|
||||
.bootstrap-tagsinput .badge:hover {
|
||||
background-color: #16a085;
|
||||
background-color: #4d91ff;
|
||||
color: white;
|
||||
padding-right: 28px;
|
||||
padding-left: 14px;
|
||||
@ -95,12 +95,12 @@
|
||||
}
|
||||
|
||||
.tagsinput-primary .bootstrap-tagsinput {
|
||||
border-color: #1abc9c;
|
||||
border-color: #2176ff;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tagsinput-primary .badge {
|
||||
background-color: #1abc9c;
|
||||
background-color: #2176ff;
|
||||
color: white;
|
||||
}
|
||||
.btn{background: #1ABC9C;border: none;color: #fff;padding: 10px;border-radius: 5px;margin-top: 10px;}
|
||||
/* .btn{background: #2176ff;border: none;color: #fff;padding: 10px;border-radius: 5px;margin-top: 10px;} */
|
@ -6,46 +6,9 @@
|
||||
<title>{% block title %}{% endblock %} - 后台管理 - 觅道文档MrDoc</title>
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<link href="{% static 'layui/css/layui.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-admin.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<style>
|
||||
.layui-btn a{
|
||||
color:white;
|
||||
}
|
||||
/* 左侧菜单栏悬浮样式 */
|
||||
.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
.layui-nav-tree .layui-nav-bar{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 顶部菜单栏悬浮样式 */
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 管理文档文档状态条件筛选 管理图片图片分组筛选 */
|
||||
.doc_status_condition > a.current{
|
||||
color: #000!important;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* layui引用文本样式 */
|
||||
.layui-elem-quote{
|
||||
border-left: 5px solid #1E9FFF !important;
|
||||
}
|
||||
/* 设置输入框的高度 和layui-btn-sm一致 */
|
||||
.layui-input{
|
||||
height: 30px !important;
|
||||
}
|
||||
/* layui开关按钮 */
|
||||
.layui-form-onswitch{
|
||||
border-color: #1E9FFF;
|
||||
background-color: #1E9FFF;
|
||||
}
|
||||
/* layui单选按钮 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #1E9FFF;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
@ -66,7 +29,7 @@
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<!-- <dd><a href="">基本资料</a></dd> -->
|
||||
<dd><a href="{% url 'manage_project' %}">个人中心</a></dd>
|
||||
<dd><a href="{% url 'manage_overview' %}">个人中心</a></dd>
|
||||
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
@ -160,13 +123,13 @@
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<img src="{% static 'dashang/dashang_wx.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_wx.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_alipay.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_alipay.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_qq.png' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_qq.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<a href="https://paypal.me/zmister" target="_blank">
|
||||
|
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<!-- 表格数据 -->
|
||||
<div class="layui-row">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文档名称</th>
|
||||
|
@ -20,7 +20,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<colgroup>
|
||||
<col width="200">
|
||||
<col width="200">
|
||||
|
@ -20,7 +20,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row" >
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-size='sm' lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-size='sm' lay-even>
|
||||
<colgroup>
|
||||
<col width="90">
|
||||
<col width="120">
|
||||
|
@ -20,7 +20,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row" lay-skin="line">
|
||||
<table class="layui-table" id="register-code-list" lay-skin="">
|
||||
<table class="layui-table" id="register-code-list" lay-skin="nob">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col width="120">
|
||||
|
@ -16,7 +16,8 @@
|
||||
<input type="text" name="username" id="username" required lay-verify="required" placeholder="输入用户名" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="getUserInfo()"><i class="layui-icon layui-icon-search"></i>搜索</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="createUser()" type="button"><i class="layui-icon layui-icon-addition"></i>添加用户</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="createUser()" type="button"><i class="layui-icon layui-icon-addition"></i>新增用户</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="createSuperUser()" type="button"><i class="layui-icon layui-icon-addition"></i>添加管理员</button>
|
||||
</div>
|
||||
{# </form>#}
|
||||
</div>
|
||||
@ -73,6 +74,7 @@
|
||||
,page:true
|
||||
,cols: [[
|
||||
{field:'username',title:'用户名',width:160},
|
||||
{field:'first_name',title:'昵称',width:160},
|
||||
{field:'email',title:'电子邮箱',width:160},
|
||||
{field:'is_superuser',title:'用户角色',width:100,templet:'#userRole'},
|
||||
{field:'date_joined',title:'注册时间',width:200},
|
||||
@ -109,13 +111,45 @@
|
||||
window.location.reload();
|
||||
}else{
|
||||
//创建失败,提示
|
||||
console.log(r)
|
||||
// console.log(r)
|
||||
layer.msg("请检查输入信息是否正确")
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
};
|
||||
createSuperUser = function(){
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'新增管理员',
|
||||
area:'300px;',
|
||||
id:'createSuperUser',//配置ID
|
||||
content:'<div style="padding: 20px;"><input class="layui-input" type="text" id="user2" style="margin-bottom:10px;" placeholder="输入用户名" required lay-verify="required"><input class="layui-input" type="email" id="email2" style="margin-bottom:10px;" placeholder="输入电子邮箱" required lay-verify="required"><input class="layui-input" type="password" id="password2" placeholder="输入密码" required lay-verify="required"></div>',
|
||||
btn:['确定','取消'], //添加按钮
|
||||
btnAlign:'c', //按钮居中
|
||||
yes:function (index,layero) {
|
||||
layer.load(1);
|
||||
data = {
|
||||
'username':$("#user2").val(),
|
||||
'password':$("#password2").val(),
|
||||
'email':$("#email2").val(),
|
||||
'user_type':1,
|
||||
}
|
||||
$.post("{% url 'create_user' %}",data,function(r){
|
||||
layer.closeAll('loading');
|
||||
if(r.status){
|
||||
//创建成功,刷新页面
|
||||
window.location.reload();
|
||||
}else{
|
||||
//创建失败,提示
|
||||
// console.log(r)
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
};
|
||||
//修改用户密码
|
||||
changePwd = function(uid,username){
|
||||
layer.open({
|
||||
|
@ -8,6 +8,9 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="font-size: 12px;color: #999;">
|
||||
借助Token,你可以无需打开MrDoc网站,直接通过更加自动化的方式进行文档编写;配合MrDoc浏览器剪藏扩展,还能将MrDoc化身为便捷的网页内容摘录工具;
|
||||
</blockquote>
|
||||
<div class="layui-row">
|
||||
<form>
|
||||
<div class="layui-form-item">
|
||||
@ -22,10 +25,8 @@
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" onclick="generaToken()">重新生成Token</button>
|
||||
</div>
|
||||
</form>
|
||||
</div><hr>
|
||||
<div class="layui-row">
|
||||
*借助Token,你可以无需打开MrDoc网站,直接通过更加自动化的方式进行文档编写;配合MrDoc浏览器剪藏扩展,还能将MrDoc化身为便捷的网页内容摘录工具;
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
|
597
template/app_api/single_doc_detail.html
Normal file
@ -0,0 +1,597 @@
|
||||
{% load staticfiles %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="keywords" content="{{ doc.name }},{{ project.name }},mrdoc"/>
|
||||
<meta name="description" content="{{doc.pre_content | slice:"0:100"}}" />
|
||||
<title>{{ doc.name }} - {{ project.name }} - 觅道文档MrDoc</title>
|
||||
|
||||
<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">
|
||||
<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;
|
||||
}
|
||||
/* 下拉目录隐藏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;
|
||||
}
|
||||
.markdown-body p img{
|
||||
max-width: 350px;
|
||||
}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
#share{
|
||||
background-color: #333;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
<body class="big-page">
|
||||
<div class="doc layui-fluid" style="padding-left:0px;">
|
||||
<!-- 左侧目录栏 -->
|
||||
<div class="doc-summary">
|
||||
</div>
|
||||
<!-- 左侧目录栏结束 -->
|
||||
|
||||
<!-- 右侧文档栏 -->
|
||||
<div class="doc-body">
|
||||
<!-- 文档导航 -->
|
||||
<div class="doc-header" role="navigation">
|
||||
<!-- <a class="btn pull-left js-toolbar-action" aria-label="" href="javascript:void(0);" title="切换侧边栏">
|
||||
<i class="fa fa-align-justify"></i>
|
||||
</a> -->
|
||||
<a class="btn pull-left font-small" href="javascript:void(0);" title="缩小字体">
|
||||
<i class="fa fa-font">-</i>
|
||||
</a>
|
||||
<a class="btn pull-left font-large" href="javascript:void(0);" title="放大字体">
|
||||
<i class="fa fa-font">+</i>
|
||||
</a>
|
||||
<a class="btn pull-left font-switch" href="javascript:void(0);" title="切换字体类型">
|
||||
<i class="fa fa-text-height"></i>
|
||||
</a>
|
||||
<!-- 顶部工具栏 -->
|
||||
{% 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">首页</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- 文档主体 -->
|
||||
<div class="doc-body-content">
|
||||
<div class="doc-body-content-div">
|
||||
<!-- 文档内容 -->
|
||||
<div class="doc-content">
|
||||
<!-- 标题 -->
|
||||
<div class="doc-info">
|
||||
<!-- 页面主体头信息 -->
|
||||
{% block content_head %}
|
||||
<h1>{{ doc.name }}</h1><hr>
|
||||
<p style="" class="project-doc-content-head">
|
||||
<i class="fa fa-user"></i> 作者:{{ doc.create_user.username }}
|
||||
<i class="fa fa-edit"></i> 最后修改于:{{ doc.modify_time }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{% if ad_code %}
|
||||
<div class="ad-code">
|
||||
{{ ad_code | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- 广告代码结束 -->
|
||||
</div>
|
||||
<!-- 标题结束 -->
|
||||
<!-- 正文开始 -->
|
||||
<div class="markdown-body" id="content" style="padding: 20px;padding-top: 5px;">
|
||||
{% block page_content %}
|
||||
<textarea style="display: none;">{{ doc.pre_content }}</textarea>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<!-- 正文结束 -->
|
||||
</div>
|
||||
<hr>
|
||||
<!-- 分享栏 -->
|
||||
<button id="share" class="layui-btn layui-btn-radius layui-btn-xs">
|
||||
<i class="fa fa-share-alt"></i> 分享
|
||||
</button>
|
||||
{% block doc_bottom_block %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{% if ad_code_2 %}
|
||||
<div class="ad-code">
|
||||
{{ ad_code_2 | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- 广告代码结束 -->
|
||||
|
||||
{% block doc_previous_next %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧文档栏结束 -->
|
||||
<div class="toTop"><i class="layui-icon layui-icon-top" style="font-size: 50px;"></i></div>
|
||||
{% block right_widget %} {% endblock %}
|
||||
</div>
|
||||
|
||||
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
|
||||
<!-- 生成文集目录大纲 -->
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
// 生成文集目录
|
||||
getProjectToc = function(){
|
||||
$.post("{% url 'get_pro_doc_tree' %}",{'pro_id':'{{project.id}}'},function(r){
|
||||
$("#loading-project-toc").hide();
|
||||
if(r.status){
|
||||
var toc_str = ""
|
||||
layui.each(r.data,function(index,item){
|
||||
toc_str += "<li>"
|
||||
if(item['children'] != undefined){ // 存在二级文档
|
||||
li = '<div style="display:flex;justify-content:space-between;">' +
|
||||
'<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>' +
|
||||
'<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>'+
|
||||
'</div>'+
|
||||
'<ul class="sub-menu toc-close">'
|
||||
toc_str += li
|
||||
layui.each(item['children'],function(index,item){// 遍历二级文档
|
||||
toc_str += '<li>'
|
||||
if(item['children'] != undefined){ //存在三级文档
|
||||
li = '<div style="display:flex;justify-content:space-between;">' +
|
||||
'<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>' +
|
||||
'<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>'+
|
||||
'</div>'+'<ul class="sub-menu toc-close">'
|
||||
toc_str += li
|
||||
layui.each(item['children'],function(index,item){ // 遍历三级文档
|
||||
li = '<li><a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a></li>'
|
||||
toc_str += li
|
||||
})
|
||||
toc_str += '</ul>'
|
||||
}else{// 不存在三级文档
|
||||
li = '<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>'
|
||||
toc_str += li
|
||||
}
|
||||
toc_str += '</li>'
|
||||
})
|
||||
toc_str += '</ul>'
|
||||
}else{//不存在二级文档
|
||||
li = '<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>'
|
||||
toc_str += li
|
||||
}
|
||||
toc_str += '</li>'
|
||||
});
|
||||
$('#project-toc').append(toc_str)
|
||||
tagCurrentDoc();
|
||||
}else{
|
||||
layer.msg("获取文集目录失败!")
|
||||
}
|
||||
});
|
||||
};
|
||||
// getProjectToc();
|
||||
|
||||
//为当前页面的目录链接添加蓝色样式
|
||||
tagCurrentDoc = function(){
|
||||
$("nav li a").each(function (i) {
|
||||
var $me = $(this);
|
||||
var lochref = $.trim(window.location.href); // 获取当前URL
|
||||
var mehref = $.trim($me.get(0).href);
|
||||
if (lochref.indexOf(mehref) != -1) {
|
||||
// console.log($me,lochref,mehref)
|
||||
$me.closest("li").addClass("active");
|
||||
//展开当前文档的上级目录
|
||||
$me.parent("li").parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开二级目录
|
||||
$me.parent("div").parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开还有子级的二级目录
|
||||
$me.parent("li").parent('ul').parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开三级目录
|
||||
$me.parents("ul.sub-menu").prevAll("div").children("i").toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
} else {
|
||||
// console.log(lochref,mehref)
|
||||
$me.closest("li").removeClass("active");
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- 小屏自动收起左侧文集大纲 -->
|
||||
<script>
|
||||
//加载页面时执行一次
|
||||
//changeSidebar();
|
||||
//监听浏览器宽度的改变
|
||||
window.onresize = function(){
|
||||
changeSidebar();
|
||||
};
|
||||
function changeSidebar(){
|
||||
// 获取匹配指定的媒体查询
|
||||
var screen_width = window.matchMedia('(max-width: 768px)');
|
||||
//判断匹配状态
|
||||
if(screen_width.matches){
|
||||
//如果匹配到,切换侧边栏
|
||||
//console.log('小屏幕')
|
||||
$("body").addClass("big-page");
|
||||
}else{
|
||||
$("body").removeClass("big-page");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="{% static 'editor.md/lib/marked.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/prettify.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/raphael.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/underscore.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/sequence-diagram.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/flowchart.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/jquery.flowchart.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/echarts.min.js' %}"></script>
|
||||
<!-- 脑图开始 -->
|
||||
<script src="{% static 'mindmap/d3@5.js' %}"></script>
|
||||
<script src="{% static 'mindmap/transform.min.js' %}"></script>
|
||||
<script src="{% static 'mindmap/view.min.js' %}"></script>
|
||||
<!-- 脑图结束 -->
|
||||
|
||||
<!-- <script src="{% static 'editor.md/editormd.min.js' %}?version={{mrdoc_version}}"></script> -->
|
||||
<script src="{% static 'editor.md/editormd.js' %}?version={{mrdoc_version}}"></script>
|
||||
<script src="{% static 'qrcodejs/qrcode.min.js' %}"></script>
|
||||
|
||||
|
||||
<!-- 解析Markdown -->
|
||||
<script>
|
||||
//解析Markdown为HTML
|
||||
editormd.markdownToHTML("content", {
|
||||
htmlDecode : "style,script,iframe",
|
||||
emoji : true, //emoji表情
|
||||
taskList : true, // 任务列表
|
||||
tex : true, // 科学公式
|
||||
flowChart : true, // 流程图
|
||||
sequenceDiagram : true, // 时序图
|
||||
tocm : true, //目录
|
||||
toc :true,
|
||||
tocContainer : "#toc-container",
|
||||
tocDropdown : false,
|
||||
atLink : false,//禁用@链接
|
||||
|
||||
});
|
||||
// 显示分享弹出框
|
||||
$("#share").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['350px','350px'],
|
||||
shadeClose: true,
|
||||
content: $('#share_div')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 页面初始化字体设置 -->
|
||||
<script>
|
||||
font_stauts = window.localStorage.getItem('font-sans')
|
||||
if(font_stauts == 'serif'){// 字体类型
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
}
|
||||
if(window.localStorage.getItem('font-size')){// 字体大小
|
||||
font_size = window.localStorage.getItem('font-size')
|
||||
console.log(font_size)
|
||||
$('#content').css({'font-size':font_size+'rem'})
|
||||
}else{
|
||||
window.localStorage.setItem('font-size',1.0)
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// 初始时,“返回顶部”标签隐藏
|
||||
$(".toTop").hide();
|
||||
$(window).scroll(function() {
|
||||
// 若滚动的高度,超出指定的高度后,“返回顶部”的标签出现。
|
||||
if($(document).scrollTop() >= 150) {
|
||||
$(".toTop").show();
|
||||
} else {
|
||||
$(".toTop").hide();
|
||||
}
|
||||
})
|
||||
// 绑定点击事件,实现返回顶部的效果
|
||||
$(".toTop").click(function() {
|
||||
$(document).scrollTop(0);
|
||||
});
|
||||
// 生成当前网页链接
|
||||
$("input[name=current_url]").val(document.URL)
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 切换隐藏侧边栏 -->
|
||||
<script>
|
||||
// 切换侧边栏
|
||||
$(function(){
|
||||
$(".js-toolbar-action").click(toggleSidebar);
|
||||
});
|
||||
//切换侧边栏显示隐藏
|
||||
function toggleSidebar(){
|
||||
console.log("切换侧边栏")
|
||||
$("body").toggleClass("big-page");
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 切换内容字体 -->
|
||||
<script>
|
||||
//切换文档内容字体类型
|
||||
$(function(){
|
||||
$('.font-switch').click(switchFont);
|
||||
});
|
||||
function switchFont(){
|
||||
if(font_stauts == 'serif'){
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
window.localStorage.setItem('font-sans','sans')
|
||||
}else{
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
window.localStorage.setItem('font-sans','serif')
|
||||
}
|
||||
};
|
||||
//放大字体
|
||||
$(function(){
|
||||
$('.font-large').click(largeFont);
|
||||
});
|
||||
function largeFont(){
|
||||
var font_size = window.localStorage.getItem('font-size')
|
||||
console.log(font_size)
|
||||
if(parseFloat(font_size) < 1.4){
|
||||
size = parseFloat(font_size) + 0.1
|
||||
$('#content').css({'font-size':size+'rem'})
|
||||
window.localStorage.setItem('font-size',size)
|
||||
}else{
|
||||
console.log("xxx")
|
||||
}
|
||||
};
|
||||
//缩小字体
|
||||
$(function(){
|
||||
$('.font-small').click(smallFont);
|
||||
});
|
||||
function smallFont(){
|
||||
var font_size = window.localStorage.getItem('font-size')
|
||||
if(parseFloat(font_size) >= 0.6){
|
||||
size = parseFloat(font_size) - 0.1
|
||||
$('#content').css({'font-size':size+'rem'})
|
||||
window.localStorage.setItem('font-size',size)
|
||||
}else{
|
||||
console.log("xxx")
|
||||
}
|
||||
};
|
||||
|
||||
// 显示打赏图片
|
||||
$("#dashang").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['480px','400px'],
|
||||
shadeClose: true,
|
||||
content: $('#dashang_img')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 分享选项卡模板 -->
|
||||
<div id="share_div" style="display: none;">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">微信扫一扫</li>
|
||||
<li>复制链接</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<p style="font-weight: 700;margin-bottom: 10px;">手机扫一扫进行分享</p>
|
||||
<div id="url_qrcode"></div>
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<input type="text" id="copy_crt_url" name="current_url" class="layui-input" /><br>
|
||||
<button class="layui-btn layui-btn-radius layui-btn-xs" style="background-color: #333;" onclick="copyUrl();">复制链接</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 打赏选项卡模板 -->
|
||||
<div id="dashang_img" style="display: none;">
|
||||
<div class="layui-tab layui-tab-brief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">微信</li>
|
||||
<li>支付宝</li>
|
||||
<li>QQ支付</li>
|
||||
<li>PayPal</li>
|
||||
<li>项目源码</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<img src="{% static 'dashang/dashang_wx.jpg' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_alipay.jpg' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_qq.png' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<a href="https://paypal.me/zmister" target="_blank">
|
||||
<img src="{% static 'dashang/dashang_paypal.png' %}" style="width: 280px;height: auto;" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<p><a href="https://github.com/zmister2016/MrDoc" target="_blank">GitHub:https://github.com/zmister2016/MrDoc</a></p>
|
||||
<br>
|
||||
<p><a href="https://gitee.com/zmister/MrDoc" target="_blank">码云:https://gitee.com/zmister/MrDoc</a> </p>
|
||||
<br>
|
||||
<p><a href="https://zmister.com" target="_blank">作者博客:https://zmister.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 展开收起左边目录
|
||||
$(function(){
|
||||
// $(".switch-toc").click(SwitchToc);
|
||||
$("body").on('click','.switch-toc',SwitchToc)
|
||||
});
|
||||
function SwitchToc(i){
|
||||
console.log("点击了")
|
||||
var $me = $(this);
|
||||
$(this).parent().next("ul").toggleClass("toc-close"); //切换展开收起样式
|
||||
$(this).toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
};
|
||||
|
||||
// 展开文档树
|
||||
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");//切换图标
|
||||
})
|
||||
|
||||
};
|
||||
// 收起文档树
|
||||
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");//切换图标
|
||||
})
|
||||
};
|
||||
// 文档分享 - 复制链接
|
||||
copyUrl = function(){
|
||||
var crt_url_val = document.getElementById("copy_crt_url");
|
||||
crt_url_val.select();
|
||||
window.clipb
|
||||
document.execCommand("Copy");
|
||||
layer.msg("链接复制成功!")
|
||||
}
|
||||
// 生成二维码
|
||||
var qrcode = new QRCode("url_qrcode", {
|
||||
text: document.URL,
|
||||
width: 200,
|
||||
height: 200,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#ffffff",
|
||||
correctLevel : QRCode.CorrectLevel.H
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 统计代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{{ static_code | safe }}
|
||||
{% endif %}
|
||||
<!-- 统计代码结束 -->
|
||||
{% block custom_script %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
@ -17,6 +17,7 @@
|
||||
<link rel="stylesheet" href="{% static 'katex/katex.min.css' %}?version={{mrdoc_version}}" />
|
||||
<link rel="icon" href="{% static 'favicon_16.png' %}"/>
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'tagsInput/tagsinput.css' %}" rel="stylesheet" type="text/css"/>
|
||||
<style>
|
||||
/* 编辑器图标样式 */
|
||||
.editormd-menu i{
|
||||
@ -73,14 +74,14 @@
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #1E9FFF !important;
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color: #1E9FFF !important;
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* layui单选样式 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #1E9FFF;
|
||||
color: #2176ff;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
@ -105,6 +106,9 @@
|
||||
.CodeMirror-linenumber{
|
||||
width: auto !important;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
/* layui 折叠面板 边框颜色 - 用在左侧文集结构 */
|
||||
.layui-badge-rim, .layui-colla-content, .layui-colla-item, .layui-collapse, .layui-elem-field, .layui-form-pane .layui-form-item[pane], .layui-form-pane .layui-form-label, .layui-input, .layui-layedit, .layui-layedit-tool, .layui-quote-nm, .layui-select, .layui-tab-bar, .layui-tab-card, .layui-tab-title, .layui-tab-title .layui-this:after, .layui-textarea{
|
||||
border-color: #f8f8f8;
|
||||
@ -177,13 +181,13 @@
|
||||
|
||||
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/marked.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/prettify.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/raphael.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/underscore.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/sequence-diagram.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/flowchart.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/jquery.flowchart.min.js' %}"></script>
|
||||
<!-- <script src="{% static 'editor.md/lib/marked.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/prettify.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/raphael.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/underscore.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/sequence-diagram.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/flowchart.min.js' %}"></script> -->
|
||||
<!-- <script src="{% static 'editor.md/lib/jquery.flowchart.min.js' %}"></script> -->
|
||||
<!-- 脑图开始 -->
|
||||
<script src="{% static 'mindmap/d3@5.js' %}"></script>
|
||||
<script src="{% static 'mindmap/transform.min.js' %}"></script>
|
||||
@ -193,6 +197,8 @@
|
||||
<!-- <script src="{% static 'editor.md/editormd.min.js' %}"></script> -->
|
||||
<script src="{% static 'mrdoc/mrdoc.editor.js' %}"></script>
|
||||
<script src="{% static 'mrdoc/mrdoc.js' %}?version={{mrdoc_version}}"></script>
|
||||
<!-- 标签输入 -->
|
||||
<script src="{% static '/tagsInput/tagsinput.js' %}" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
|
@ -81,19 +81,35 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="layui-row" style="margin-bottom: 10px;">
|
||||
<button class="layui-btn layui-btn-primary layui-btn-fluid mrdoc-btn-default" onclick="saveDoc()" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存文档为草稿
|
||||
</button>
|
||||
<!-- 标签输入框 -->
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">标签</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="" placeholder="输入标签名">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-fluid" onclick="createDoc()" id="create_doc" title="发布当前内容">
|
||||
<i class="fa fa-save"></i> 发布文档
|
||||
</button>
|
||||
<!-- 发布按钮 -->
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">发布</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<button class="layui-btn layui-btn-primary mrdoc-btn-default" onclick="saveDoc()" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存为草稿
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-normal" onclick="createDoc()" id="create_doc" title="发布当前内容">
|
||||
<i class="fa fa-save"></i> 发布文档
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -106,7 +122,7 @@
|
||||
<!-- 标题 -->
|
||||
<div style="padding-bottom:10px;">
|
||||
<div class="layui-input-block" style="margin-left:0px;">
|
||||
<input type="text" name="doc-name" id="doc-name" required lay-verify="required" placeholder="请输入文档标题" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="doc-name" id="doc-name" required lay-verify="required" placeholder="请输入文档标题……" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -130,7 +146,6 @@
|
||||
title:'新建文集',
|
||||
area:'300px;',
|
||||
id:'createPro',//配置ID
|
||||
//content:'<div style="padding: 20px;"><input class="layui-input" type="text" id="pname" style="margin-bottom:10px;" placeholder="输入文集名" required lay-verify="required"><textarea name="desc" id="desc" placeholder="输入文集简介,不超过100个字,超出将被截断" maxlength="100" class="layui-textarea"></textarea></div>',
|
||||
content: $('#create-project-div'),
|
||||
btn:['确定','取消'], //添加按钮
|
||||
btnAlign:'c', //按钮居中
|
||||
@ -210,6 +225,7 @@
|
||||
'project':$("#project").val(),
|
||||
'parent_doc':$("#parent-doc").val(),
|
||||
'doc_name':$("#doc-name").val(),
|
||||
'doc_tag':$("#tagsinputval").val(),
|
||||
'content':editor.getHTML(),//获取editor解析的HTML
|
||||
//'content':editor.getPreviewedHTML(),//获取预览的HTML
|
||||
'pre_content':editor.getMarkdown(),
|
||||
@ -258,6 +274,7 @@
|
||||
'project':$("#project").val(),
|
||||
'parent_doc':$("#parent-doc").val(),
|
||||
'doc_name':$("#doc-name").val(),
|
||||
'doc_tag':$("#tagsinputval").val(),
|
||||
'content':editor.getHTML(),
|
||||
'pre_content':editor.getMarkdown(),
|
||||
'sort':$("#sort").val(),
|
||||
|
@ -31,17 +31,17 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
<!-- 文档目录 -->
|
||||
<!-- <div id="toc-container" style="display:none;padding:10px;overflow:auto;"></div> -->
|
||||
<div id="toc-container" class='sidebar'></div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content_head %}
|
||||
<h1>{{ doc.name }}</h1><hr>
|
||||
|
||||
<p style="" class="project-doc-content-head">
|
||||
<!-- <p style="" class="project-doc-content-head">
|
||||
<i class="fa fa-user"></i> 作者:{{ doc.create_user.username }}
|
||||
<i class="fa fa-edit"></i> 最后修改于:{{ doc.modify_time }}
|
||||
</p>
|
||||
</p> -->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -51,11 +51,35 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_bottom_block %}
|
||||
{% if request.user == doc.create_user or request.user.is_superuser %}
|
||||
<button class="layui-btn layui-btn-radius layui-btn-xs" id="download_doc" style="background-color: #333;">
|
||||
<i class="fa fa-download"></i> 下载
|
||||
</button>
|
||||
{% endif %}
|
||||
<div class="layui-row" style="margin-bottom: 10px;padding-left: 20px;">
|
||||
{% if doc_tags.count > 0 %}
|
||||
<i class="fa fa-tag"></i>
|
||||
{% for tag in doc_tags %}
|
||||
<a href="{% url 'tag_docs' tag.tag.id %}" style="font-size: 12px;line-height: 14px;height: 16px;padding: 0 5px;margin-left: 0;">{{tag.tag.name}}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space20" style="padding-left: 20px;">
|
||||
<span>
|
||||
<i class="fa fa-user"></i> {{ doc.create_user.username }}
|
||||
</span>
|
||||
<span tooltip="更新于:{{doc.modify_time}}">
|
||||
<i class="fa fa-clock-o"></i> {{ doc.modify_time }}
|
||||
</span>
|
||||
|
||||
<button id="share" class="doc-bottom-btn" tooltip="分享本文档">
|
||||
<i class="fa fa-share-alt" ></i> 分享
|
||||
</button>
|
||||
|
||||
{% if request.user == doc.create_user or request.user.is_superuser %}
|
||||
<button class="doc-bottom-btn" tooltip="下载文档Markdown" id="download_doc">
|
||||
<i class="fa fa-download"></i> 下载
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_previous_next %}
|
||||
@ -97,7 +121,7 @@
|
||||
<script>
|
||||
var layer = layui.layer;
|
||||
// 手机屏幕上默认最小化目录
|
||||
if(window.outerWidth < 768){
|
||||
if(window.outerWidth < 1300){
|
||||
console.log('最小化目录');
|
||||
// setTimeout(function(){
|
||||
$(".sidebar").toggleClass("doc-toc-hide");
|
||||
|
@ -87,9 +87,6 @@
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
#share{
|
||||
background-color: #333;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
@ -224,11 +221,10 @@
|
||||
</div>
|
||||
<hr>
|
||||
<!-- 分享栏 -->
|
||||
<button id="share" class="layui-btn layui-btn-radius layui-btn-xs">
|
||||
<i class="fa fa-share-alt"></i> 分享
|
||||
</button>
|
||||
<div style="color: rgba(0,0,0,.65);margin-bottom: 10px;margin-top: 10px;">
|
||||
{% block doc_bottom_block %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
@ -547,15 +543,15 @@
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<img src="{% static 'dashang/dashang_wx.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_wx.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_alipay.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_alipay.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_qq.png' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_qq.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
|
@ -29,9 +29,25 @@
|
||||
<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>
|
||||
<i class="layui-icon layui-icon-add-circle" style="color:black;"></i> <span>新建</span>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
{% if request.user.is_authenticated %}
|
||||
<dd>
|
||||
<a href="javascript:void(0);" onclick="createPro();">
|
||||
<img src="{% static 'icon_img/create-pro-icon.svg' %}" height="14px" width="14px"></img>
|
||||
<span class="layui-hide-xs">新建文集</span>
|
||||
</a>
|
||||
</dd>
|
||||
{% endif %}
|
||||
<dd>
|
||||
<a href="{% url 'create_doc' %}" target="_blank">
|
||||
<img src="{% static 'icon_img/create-doc-icon.svg' %}" height="14px" width="14px"></img>
|
||||
<span class="layui-hide-xs">新建文档</span>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -59,7 +75,7 @@
|
||||
</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="{% url 'manage_doc' %}">
|
||||
<a href="{% url 'manage_overview' %}">
|
||||
<i class="layui-icon layui-icon-app layui-hide-md"></i>
|
||||
<span class="layui-hide-xs">个人中心</span>
|
||||
</a>
|
||||
|
@ -15,12 +15,12 @@
|
||||
<input type="text" name="kw" id="kw" placeholder="输入附件名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="submit"><i class="layui-icon layui-icon-search"></i>搜索</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" id="upload_attachment"><i class="layui-icon layui-icon-upload"></i>上传附件(.zip格式)</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" id="upload_attachment" title="支持Zip格式压缩文件"><i class="layui-icon layui-icon-upload"></i>上传附件</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row" >
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<colgroup>
|
||||
<col width="400">
|
||||
<col width="200">
|
||||
@ -42,7 +42,7 @@
|
||||
<td>{{ attachment.file_size }}</td>
|
||||
<td>{{ attachment.create_time }}</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="delAttach('{{attachment.id}}');" class="layui-btn layui-btn-normal layui-btn-xs">
|
||||
<a href="javascript:void(0);" onclick="delAttach('{{attachment.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</a>
|
||||
</td>
|
||||
|
@ -11,55 +11,7 @@
|
||||
{% block custom_link %}
|
||||
{% endblock %}
|
||||
<style>
|
||||
.layui-btn a{
|
||||
color:white;
|
||||
}
|
||||
/* 左侧菜单栏悬浮样式 */
|
||||
.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
.layui-nav-tree .layui-nav-bar{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 顶部菜单栏悬浮样式 */
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 管理文档文档状态条件筛选 管理图片图片分组筛选 */
|
||||
.doc_status_condition > a.current{
|
||||
color: #000!important;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 设置输入框的高度 和layui-btn-sm一致 */
|
||||
.layui-input{
|
||||
height: 30px !important;
|
||||
}
|
||||
/* layui引用文本样式 */
|
||||
.layui-elem-quote{
|
||||
border-left: 5px solid #1E9FFF !important;
|
||||
}
|
||||
/* layui单选框样式 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #1E9FFF;
|
||||
}
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color: #1E9FFF !important;
|
||||
}
|
||||
/* 开关样式 */
|
||||
.layui-form-onswitch{
|
||||
border-color: #1E9FFF;
|
||||
background-color: #1E9FFF;
|
||||
}
|
||||
/* 选项卡样式 */
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #1E9FFF;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #1E9FFF !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
@ -92,22 +44,31 @@
|
||||
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
|
||||
<ul class="layui-nav layui-nav-tree" lay-filter="test">
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_project' %}"><i class="layui-icon layui-icon-list"></i> 文集管理</a>
|
||||
<a href="{% url 'manage_overview' %}"><i class="layui-icon layui-icon-console"></i> 仪表盘</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_doc' %}"><i class="layui-icon layui-icon-file-b"></i> 文档管理</a>
|
||||
<a href="{% url 'manage_project' %}"><i class="layui-icon layui-icon-list"></i> 我的文集</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_doctemp' %}"><i class="layui-icon layui-icon-template"></i> 文档模板管理</a>
|
||||
<a href="{% url 'manage_doc' %}"><i class="layui-icon layui-icon-file-b"></i> 我的文档</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_image' %}"><i class="layui-icon layui-icon-picture"></i> 图片素材管理</a>
|
||||
<a href="{% url 'manage_doctemp' %}"><i class="layui-icon layui-icon-template"></i> 文档模板</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_doc_tag' %}"><i class="layui-icon layui-icon-note"></i> 文档标签</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_image' %}"><i class="layui-icon layui-icon-picture"></i> 图片素材</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_attachment' %}"><i class="layui-icon layui-icon-export"></i> 附件管理</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_token' %}"><i class="layui-icon layui-icon-key"></i> Token管理</a>
|
||||
<a href="{% url 'manage_token' %}"><i class="layui-icon layui-icon-key"></i> 账户Token</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'manage_self' %}"><i class="layui-icon layui-icon-username"></i> 个人设置</a>
|
||||
</li>
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a href="{% url 'doc_recycle' %}"><i class="layui-icon layui-icon-delete"></i> 文档回收站</a>
|
||||
@ -121,7 +82,7 @@
|
||||
|
||||
<div class="layui-body">
|
||||
<!-- 内容主体区域 -->
|
||||
<div style="padding: 15px;">{% block content %}{% endblock %}</div>
|
||||
<div style="padding: 25px;">{% block content %}{% endblock %}</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-footer" style="text-align:center;font-size: 12px;">
|
||||
@ -181,13 +142,13 @@
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<img src="{% static 'dashang/dashang_wx.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_wx.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_alipay.jpg' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_alipay.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_qq.png' %}" style="width: 300px;height: auto;" />
|
||||
<img src="{% static 'dashang/dashang_qq.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<a href="https://paypal.me/zmister" target="_blank">
|
||||
|
@ -23,7 +23,7 @@
|
||||
<input type="text" name="kw" id="kw" placeholder="输入文档标题或内容" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-xs" type="submit"><i class="layui-icon layui-icon-search"></i>搜索</button>
|
||||
<a href="{% url 'create_doc' %}" target="_blank" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-addition"></i>新建文档</a>
|
||||
<a href="{% url 'create_doc' %}" target="_blank" class="layui-btn layui-btn-primary layui-btn-xs"><i class="layui-icon layui-icon-addition"></i>新建</a>
|
||||
</div>
|
||||
</form>
|
||||
<div class="">
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
|
||||
<div class="layui-row" lay-skin="">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文档名称</th>
|
||||
@ -77,11 +77,15 @@
|
||||
<tr>
|
||||
{% if doc.status == 1 %}
|
||||
<td>
|
||||
<a href="{% url 'doc' doc.top_doc doc.id %}" target="_blank" title="查看文档:{{doc.name}}">{{ doc.name }} <i class="layui-icon layui-icon-ok-circle" style="color:#01AAED"></i></a>
|
||||
<img src="{% static 'icon_img/manage-doc-icon.svg' %}" height="20px" width="20px" />
|
||||
<a href="{% url 'doc' doc.top_doc doc.id %}" target="_blank" title="查看文档:{{doc.name}}">{{ doc.name }}
|
||||
</a>
|
||||
</td>
|
||||
{% else %}
|
||||
<td>
|
||||
<a href="{% url 'modify_doc' doc.id %}" target="_blank" title="修改文档:{{doc.name}}">{{ doc.name }} <i class="layui-icon layui-icon-menu-fill" style="color:#FF5722"></i></a>
|
||||
<img src="{% static 'icon_img/manage-doc-pre-icon.svg' %}" height="20px" width="20px" />
|
||||
<a href="{% url 'modify_doc' doc.id %}" target="_blank" title="修改文档:{{doc.name}}">{{ doc.name }}
|
||||
</a>
|
||||
<button class="layui-btn layui-btn-xs layui-btn-normal" onclick="fastPubDoc('{{doc.id}}')">一键发布</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
@ -91,14 +95,14 @@
|
||||
</td>
|
||||
<td>{{ doc.create_time }}</td>
|
||||
<td>
|
||||
<a href="{% url 'manage_doc_history' doc.id %}" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-log"></i> 历史
|
||||
<a href="{% url 'manage_doc_history' doc.id %}" title="查看文档历史" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-log"></i>
|
||||
</a>
|
||||
<a href="{% url 'modify_doc' doc_id=doc.id %}" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>修改
|
||||
<a href="{% url 'modify_doc' doc_id=doc.id %}" title="修改文档" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="delDoc('{{doc.id}}');" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
<a href="javascript:void(0);" title="删除文档" onclick="delDoc('{{doc.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -9,12 +9,12 @@
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-xs" onclick="emptyDoc()"><i class="layui-icon layui-icon-delete" ></i>清空回收站</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-xs" onclick="restoreAll()"><i class="layui-icon layui-icon-refresh"></i>还原所有</button>
|
||||
<button class="layui-btn layui-btn-warm layui-btn-xs" onclick="emptyDoc()"><i class="layui-icon layui-icon-delete" ></i>清空回收站</button>
|
||||
|
||||
</div>
|
||||
<div class="layui-row" lay-skin="">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文档名称</th>
|
||||
@ -40,7 +40,7 @@
|
||||
<button class="layui-btn layui-btn-xs layui-btn-normal" onclick="restoreDoc('{{doc.id}}')">
|
||||
<i class="layui-icon layui-icon-refresh"></i>还原
|
||||
</button>
|
||||
<button onclick="delDoc('{{doc.id}}');" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<button onclick="delDoc('{{doc.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</button>
|
||||
</td>
|
||||
|
116
template/app_doc/manage_doc_tag.html
Normal file
@ -0,0 +1,116 @@
|
||||
{% extends 'app_doc/manage_base.html' %}
|
||||
{% 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">
|
||||
<form action="{% url 'manage_doctemp' %}" method="get">
|
||||
<div class="layui-form-item">
|
||||
<!--<button class="layui-btn layui-btn-normal" type="button" onclick="createImgGroup()">新建分组</button>-->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<colgroup>
|
||||
<col width="200">
|
||||
<col width="200">
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>标签名称</th>
|
||||
<th>标签文档数量</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% load project_filter %}
|
||||
{% for tag in tags %}
|
||||
<tr>
|
||||
<td><a href="{% url 'tag_docs' tag.id %}" target="_blank">{{ tag.name }}</a></td>
|
||||
<td>{{ tag.id | tag_doc_cnt }}</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="modifyTag('{{tag.id}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>修改
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="delTag('{{tag.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
delTag = function(group_id){
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'删除分组',
|
||||
area:'300px;',
|
||||
id:'delGroup',//配置ID
|
||||
content:'<div style="margin-left:10px;">警告:操作将删除此标签!</div>',
|
||||
btn:['确定','取消'], //添加按钮
|
||||
btnAlign:'c', //按钮居中
|
||||
yes:function (index,layero) {
|
||||
layer.load(1);
|
||||
data = {
|
||||
'types':2,
|
||||
'tag_id':group_id,
|
||||
}
|
||||
$.post("{% url 'manage_doc_tag' %}",data,function(r){
|
||||
layer.closeAll('loading')
|
||||
if(r.status){
|
||||
//删除成功
|
||||
window.location.reload();
|
||||
//layer.close(index)
|
||||
}else{
|
||||
//删除失败,提示
|
||||
console.log(r)
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
};
|
||||
modifyTag = function(group_id){
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'修改分组',
|
||||
area:'300px;',
|
||||
id:'modifyGroup',//配置ID
|
||||
content:'<div style="margin:10px;"><input class="layui-input" placeholder="输入标签的新名称" id="new-group-name"></input></div>',
|
||||
btn:['确定','取消'], //添加按钮
|
||||
btnAlign:'c', //按钮居中
|
||||
yes:function (index,layero) {
|
||||
layer.load(1);
|
||||
data = {
|
||||
'types':1,
|
||||
'tag_id':group_id,
|
||||
'tag_name':$("#new-group-name").val()
|
||||
}
|
||||
$.post("{% url 'manage_doc_tag' %}",data,function(r){
|
||||
layer.closeAll('loading')
|
||||
if(r.status){
|
||||
//修改成功
|
||||
window.location.reload();
|
||||
//layer.close(index)
|
||||
}else{
|
||||
//修改失败,提示
|
||||
// console.log(r)
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@ -14,13 +14,13 @@
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="kw" id="kw" placeholder="输入文档模板内容" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="submit"><i></i>搜索</button>
|
||||
<a href="{% url 'create_doctemp' %}" target="_blank" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon layui-icon-addition"></i>新建文档模板</a>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="submit"><i class="layui-icon layui-icon-search"></i>搜索</button>
|
||||
<a href="{% url 'create_doctemp' %}" target="_blank" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon layui-icon-addition"></i>新建</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row" >
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-even>
|
||||
<colgroup>
|
||||
<col width="200">
|
||||
<col width="200">
|
||||
@ -42,7 +42,7 @@
|
||||
<a href="{% url 'modify_doctemp' doctemp_id=temp.id %}" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>修改
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="delTemp('{{temp.id}}');" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<a href="javascript:void(0);" onclick="delTemp('{{temp.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</a>
|
||||
</td>
|
||||
|
@ -16,10 +16,6 @@
|
||||
<div class="layui-row">
|
||||
<form action="" method="get">
|
||||
<div class="layui-form-item">
|
||||
<!--<div class="layui-input-inline">-->
|
||||
<!--<input type="text" name="kw" id="kw" placeholder="搜索图片" autocomplete="off" class="layui-input">-->
|
||||
<!--</div>-->
|
||||
<!--<button class="layui-btn" type="submit">搜索</button>-->
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" id="upload_img"><i class="layui-icon layui-icon-upload"></i>上传图片</button>
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" onclick="createImgGroup()"><i class="layui-icon layui-icon-addition"></i>新建分组</button>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" href="{% url 'manage_img_group' %}">分组管理</a>
|
||||
@ -28,7 +24,6 @@
|
||||
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<!--<span style="font-size:16px;"><b>分组: </b></span>-->
|
||||
<span class="layui-breadcrumb doc_status_condition" lay-separator="|">
|
||||
{% load project_filter %}
|
||||
<a href="{% url 'manage_image' %}?group=0" class="{% if g_id == 0 %}current{% endif %}">全部图片({{all_img_cnt}})</a>
|
||||
@ -42,10 +37,7 @@
|
||||
<ul style="padding: 20px;" id="images">
|
||||
{% for img in images %}
|
||||
<li class="image-list">
|
||||
<!--<i class="image-list-i" style="background-image: url('{{img.file_path}}');"></i>-->
|
||||
<img class="image-list-i" src="{{img.file_path}}" title="{{img.file_name}}">
|
||||
<!--<span class="img-file-name" title="{{img.file_name}}">{{img.file_name}}</span>-->
|
||||
<!--<input type="checkbox" />-->
|
||||
<div class="opera-img-btn">
|
||||
<a href="javascript:void(0);" class="move-img" title="移动分组" data-src="{{img.file_path}}" data-id="{{img.id}}"><i class="layui-icon layui-icon-transfer"></i></a>
|
||||
<a href="javascript:void(0);" class="del-img" title="删除图片" data-src="{{img.file_path}}" data-id="{{img.id}}"><i class="layui-icon layui-icon-delete"></i></a>
|
||||
@ -211,6 +203,7 @@
|
||||
upload.render({
|
||||
elem: '#upload_img',
|
||||
url: '{% url "upload_doc_img" %}',
|
||||
data:{group_id:"{{g_id}}"},
|
||||
before: function(obj){ //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
|
||||
layer.load(); //上传loading
|
||||
},
|
||||
@ -223,6 +216,10 @@
|
||||
layer.msg("上传出错,请重试!")
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
layer.closeAll('loading'); //关闭loading
|
||||
layer.msg("系统异常,请稍后再试!")
|
||||
},
|
||||
accept: 'images', //允许上传的文件类型
|
||||
acceptMime:'image/*',
|
||||
field:'manage_upload',
|
||||
|
@ -45,7 +45,7 @@
|
||||
<a href="javascript:void(0);" onclick="modifyGroup('{{group.id}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>修改
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="delGroup('{{group.id}}');" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<a href="javascript:void(0);" onclick="delGroup('{{group.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</a>
|
||||
</td>
|
||||
|
155
template/app_doc/manage_overview.html
Normal file
@ -0,0 +1,155 @@
|
||||
{% extends 'app_doc/manage_base.html' %}
|
||||
{% 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 layui-col-space20">
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-collapse">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">概览</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div style="display: flex;justify-content:space-between;color:rgba(0,0,0,.65)">
|
||||
<div style="font-size: 14px;"><img src="{% static 'icon_img/manage-pro-icon.svg' %}" width="14px;"> {{ total_pro_cnt }}个文集</div>
|
||||
<div style="font-size: 14px;"><img src="{% static 'icon_img/manage-doc-icon.svg' %}" width="14px;"> {{ total_doc_cnt }}篇文档</div>
|
||||
<div style="font-size: 14px;"><img src="{% static 'icon_img/manage-tag-icon.svg' %}" width="14px;"> {{ total_tag_cnt }}个标签</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-collapse">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">动态</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div style="color:rgba(0,0,0,.65)">
|
||||
<table class="layui-table" lay-even lay-skin='nob'>
|
||||
<tbody>
|
||||
{% for doc in doc_active_list %}
|
||||
<tr>
|
||||
{% if doc.status == 1 %}
|
||||
<td>{{doc.modify_time}}</td><td><a href="{% url 'doc' doc.top_doc doc.id %}" target="_blank">{{doc.name}}</a></td>
|
||||
{% elif doc.status == 0 %}
|
||||
<td>{{doc.modify_time}}</td><td><a href="{% url 'modify_doc' doc.id %}" target="_blank">{{doc.name}}</a></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-collapse">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">快速草稿</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-form">
|
||||
{% csrf_token %}
|
||||
<input name="status" value="0" hidden>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="doc_name" name="doc_name" required lay-verify="required" placeholder="请输入文档标题" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">文集</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="project" id="project" lay-verify="required">
|
||||
<option value=""></option>
|
||||
{% for pro in pro_list %}
|
||||
{% if pro.role == 0 %}
|
||||
<option value="{{pro.id}}">[公开]{{pro.name}}</option>
|
||||
{% elif pro.role == 1 %}
|
||||
<option value="{{pro.id}}">[私密]{{pro.name}}</option>
|
||||
{% elif pro.role == 2 %}
|
||||
<option value="{{pro.id}}">[指定用户]{{pro.name}}</option>
|
||||
{% elif pro.role == 3 %}
|
||||
<option value="{{pro.id}}">[密码]{{pro.name}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">文本域</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="pre_content" id="pre_content" placeholder="在想些什么呢?" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" id="save_doc" onclick="manage_overview_save_doc();">保存草稿</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
// 保存文档草稿
|
||||
manage_overview_save_doc = function(){
|
||||
$('button.layui-btn').attr("disabled",true);
|
||||
$('button.layui-btn').addClass('layui-btn-disabled');
|
||||
var data = {
|
||||
'project':$("#project").val(),
|
||||
'doc_name':$("#doc_name").val(),
|
||||
'pre_content':$("#pre_content").val(),
|
||||
'status':0
|
||||
}
|
||||
console.log(data)
|
||||
if(data.doc_name == ""){
|
||||
layer.msg('请输入文档标题!');
|
||||
$('button.layui-btn').attr("disabled",false);
|
||||
$('button.layui-btn').removeClass('layui-btn-disabled');
|
||||
}
|
||||
else if(data.project == ""){
|
||||
layer.msg('请选择文集!');
|
||||
$('button.layui-btn').attr("disabled",false);
|
||||
$('button.layui-btn').removeClass('layui-btn-disabled');
|
||||
}
|
||||
else{
|
||||
layer.load(1);
|
||||
$.post("{% url 'create_doc' %}",data,function(r){
|
||||
if(r.status){
|
||||
//保存成功
|
||||
layer.closeAll("loading");
|
||||
md_changed = false;
|
||||
layer.msg('保存草稿成功',function(){
|
||||
window.location.reload()
|
||||
});
|
||||
}else{
|
||||
//创建失败
|
||||
layer.closeAll("loading");
|
||||
layer.msg('保存草稿失败:'+r.data);
|
||||
$('button.layui-btn').attr("disabled",false);
|
||||
$('button.layui-btn').removeClass('layui-btn-disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
{% endblock %}
|
@ -2,13 +2,13 @@
|
||||
{% 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-card-header" style="margin-bottom: 10px;background-color: #fff;">
|
||||
<div class="layui-row">
|
||||
<span style="font-size:18px;">文集管理
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row" >
|
||||
<form action="{% url 'manage_project' %}" method="get">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
@ -22,16 +22,16 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="" lay-size="" lay-even>
|
||||
<table class="layui-table" id="doctemp-list" lay-skin="nob" lay-size="" lay-even>
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col width="120">
|
||||
<col width="200">
|
||||
<col width="45">
|
||||
<col width="100">
|
||||
<col width="50">
|
||||
<col width="100">
|
||||
<col width="60">
|
||||
<col width="150">
|
||||
<!-- <col width="40"> -->
|
||||
<col width="120">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -39,51 +39,50 @@
|
||||
<th>文集简介</th>
|
||||
<th>文档数量</th>
|
||||
<th>创建时间</th>
|
||||
<th>前台下载</th>
|
||||
<th>阅读权限</th>
|
||||
<th>协作人数</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% load project_filter %}
|
||||
{% for pro in pros %}
|
||||
<tr>
|
||||
<td><a href="{% url 'pro_index' pro_id=pro.id %}" target="_blank">{{ pro.name }}</a></td>
|
||||
<td>{{ pro.intro }}</td>
|
||||
{% load project_filter %}
|
||||
<td>{{ pro.id | get_doc_count }}</td>
|
||||
<td>{{ pro.create_time }}</td>
|
||||
<td>
|
||||
{% if pro.id|report_status_epub == 1 or pro.id|report_status_pdf == 1 %}
|
||||
|
||||
<span style="color: #01AAED;">允许</span> <a href="{% url 'modify_pro_download' pro.id %}" title="修改前台下载"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% else %}
|
||||
<span style="color: hotpink;">禁止</span> <a href="{% url 'modify_pro_download' pro.id %}" title="修改前台下载"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-input-inline">
|
||||
{% if pro.role == 0 %}
|
||||
<i class="layui-icon layui-icon-circle-dot" style="color: #01AAED;"></i> 公开 <a href="{% url 'modify_pro_role' pro.id %}" title="修改文集权限"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% elif pro.role == 1 %}
|
||||
<i class="layui-icon layui-icon-password"></i> 私密 <a href="{% url 'modify_pro_role' pro.id %}" title="修改文集权限"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% elif pro.role == 2 %}
|
||||
<i class="layui-icon layui-icon-group"></i> 指定用户 <a href="{% url 'modify_pro_role' pro.id %}" title="修改文集权限"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% elif pro.role == 3 %}
|
||||
<i class="layui-icon layui-icon-key"></i> 访问码 <a href="{% url 'modify_pro_role' pro.id %}" title="修改文集权限"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<img src="{% static 'icon_img/manage-pro-icon.svg' %}" height="20px" width="20px" />
|
||||
<a href="{% url 'pro_index' pro_id=pro.id %}" target="_blank" title='{{pro.name}}'>{{ pro.name }}</a>
|
||||
<!-- 文集阅读权限 -->
|
||||
{% if pro.role == 0 %}
|
||||
<a href="{% url 'modify_pro_role' pro.id %}" title="公开文集,点击修改权限"><img src="{% static 'icon_img/manage-eye-icon.svg' %}" height="14px" width="14px" /></a>
|
||||
{% elif pro.role == 1 %}
|
||||
<a href="{% url 'modify_pro_role' pro.id %}" title="私密文集,点击修改权限"><i class="layui-icon layui-icon-password"></i></a>
|
||||
{% elif pro.role == 2 %}
|
||||
<a href="{% url 'modify_pro_role' pro.id %}" title="指定用户可见,点击修改权限"><i class="layui-icon layui-icon-user"></i></a>
|
||||
{% elif pro.role == 3 %}
|
||||
<a href="{% url 'modify_pro_role' pro.id %}" title="访问码可见,点击修改权限"><i class="layui-icon layui-icon-key"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<!-- 文集前台下载权限 -->
|
||||
{% if pro.id|report_status_epub == 1 or pro.id|report_status_pdf == 1 %}
|
||||
<a href="{% url 'modify_pro_download' pro.id %}" title="允许前台下载,点击配置"><img src="{% static 'icon_img/manage-download-yes.svg' %}" height="14px" width="14px" /></a>
|
||||
{% else %}
|
||||
<a href="{% url 'modify_pro_download' pro.id %}" title="禁止前台下载,点击配置"><img src="{% static 'icon_img/manage-download-no.svg' %}" height="14px" width="14px" /></a>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td>{{ pro.intro }}</td>
|
||||
<td>{{ pro.id | get_doc_count }}</td>
|
||||
<td>{{ pro.create_time }}</td>
|
||||
<td>{{ pro.id | project_collaborator_cnt }} <a href="{% url 'manage_pro_colla' pro.id %}" title="管理文集协作"><i class="layui-icon layui-icon-set"></i></a></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="modifyProject('{{pro.id}}','{{pro.name}}','{{pro.intro}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>修改
|
||||
<a href="javascript:void(0);" title="修改文集" onclick="modifyProject('{{pro.id}}','{{pro.name}}','{{pro.intro}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="delProject('{{pro.id}}');" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
<a href="javascript:void(0);" title="导出文集" onclick="reportMd('{{pro.id}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-export"></i>
|
||||
</a>
|
||||
<a href="javascript:void(0);" onclick="reportMd('{{pro.id}}')" class="layui-btn layui-btn-xs layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-export"></i>导出
|
||||
<a href="javascript:void(0);" title="删除文集" onclick="delProject('{{pro.id}}');" class="layui-btn layui-btn-xs layui-btn-warm">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -47,7 +47,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
| <span style="color: hotpink;">未生成文集导出文件</span>
|
||||
| <span style="color: #ff213b;">未生成文集导出文件</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -71,7 +71,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
| <span style="color: hotpink;">未生成文集导出文件</span>
|
||||
| <span style="color: #ff213b;">未生成文集导出文件</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -108,7 +108,17 @@
|
||||
layer.msg("文件上传出错")
|
||||
}
|
||||
});
|
||||
|
||||
// 上传语雀知识库
|
||||
$("#upload-yuque").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['350px','350px'],
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- 导入的文集文档排序模板div -->
|
||||
<style>
|
||||
|
@ -40,7 +40,7 @@
|
||||
<div class="layui-form-item" style="{% if pro.role == 3 %}{% else %}display:none;{% endif %}" id="role-pwd">
|
||||
<label class="layui-form-label">访问码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="viewcode" placeholder="请输入访问码" autocomplete="off" class="layui-input" value="{{pro.role_value}}">
|
||||
<input type="text" name="viewcode" placeholder="请输入访问码" autocomplete="off" class="layui-input" value="{% if pro.role_value != None %}{{pro.role_value}}{% endif %}">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">不少于4位数</div>
|
||||
</div>
|
||||
@ -49,7 +49,7 @@
|
||||
<label class="layui-form-label">允许用户</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="tagsinput-primary form-group">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="{{pro.role_value}}" placeholder="请输入用户名,回车输入多个用户">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="{% if pro.role_value != None %}{{pro.role_value}}{% endif %}" placeholder="请输入用户名,回车输入多个用户">
|
||||
<!--<button class="btn" onClick="getinput()">查询</button>-->
|
||||
</div>
|
||||
</div>
|
||||
|
97
template/app_doc/manage_self.html
Normal file
@ -0,0 +1,97 @@
|
||||
{% extends 'app_doc/manage_base.html' %}
|
||||
{% 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-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户名</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" disabled autocomplete="off" class="layui-input" value="{{user.username}}" >
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">不可修改</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="firstname" id="first_name" required lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input" value="{{user.first_name}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">电子邮箱</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="email" name="email" id="email" required lay-verify="required" placeholder="请输入电子邮箱地址" autocomplete="off" class="layui-input" value="{{user.email}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">新密码</label>
|
||||
<div class="layui-form-mid layui-word-aux"><button class="layui-btn layui-btn-primary layui-btn-xs" onclick="changePwd();">点击修改密码</button></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" onclick="updateUser();">更新个人资料</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
//修改用户密码
|
||||
changePwd = function(){
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'修改密码',
|
||||
area:'300px;',
|
||||
id:'changePwd',
|
||||
content:'<div style="padding:10px 0 0 20px;">修改用户密码:</div><div style="padding: 20px;"><input class="layui-input" type="password" id="newPwd1" style="margin-bottom:10px;" placeholder="输入新密码" required lay-verify="required"><input class="layui-input" type="password" id="newPwd2" placeholder="再次确认新密码" required lay-verify="required"></div>',
|
||||
btn:['确认修改','取消'],
|
||||
yes:function (index,layero) {
|
||||
layer.load(1);
|
||||
data = {
|
||||
'password':$("#newPwd1").val(),
|
||||
'password2':$("#newPwd2").val(),
|
||||
}
|
||||
$.post("{% url 'modify_pwd' %}",data,function(r){
|
||||
layer.closeAll("loading");
|
||||
if(r.status){
|
||||
//修改成功
|
||||
// window.location.reload();
|
||||
layer.close(index)
|
||||
layer.msg("修改成功")
|
||||
}else{
|
||||
//修改失败,提示
|
||||
//console.log(r)
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
};
|
||||
updateUser = function(){
|
||||
layer.load(1)
|
||||
data = {
|
||||
'first_name':$("#first_name").val(),
|
||||
'email':$("#email").val(),
|
||||
}
|
||||
$.post("{% url 'manage_self' %}",data,function(r){
|
||||
layer.closeAll("loading");
|
||||
if(r.status){
|
||||
//修改成功
|
||||
layer.msg("修改成功",function(){
|
||||
window.location.reload();
|
||||
})
|
||||
}else{
|
||||
//修改失败,提示
|
||||
//console.log(r)
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@ -38,7 +38,7 @@
|
||||
<strong>*当前文档状态:草稿</strong>
|
||||
{% elif doc.status == 1 %}
|
||||
<strong>*当前文档状态:已发布 </strong>
|
||||
<a class="layui-btn layui-btn-xs layui-btn-normal" target="_blank" href="{% url 'doc' doc.top_doc doc.id %}">
|
||||
<a class="layui-btn layui-btn-xs layui-btn-normal" target="_blank" href="{% url 'doc' doc.top_doc doc.id %}" style="background-color: #2176ff;">
|
||||
<i class="fa fa-book"></i> 查看
|
||||
</a>
|
||||
<button class="layui-btn layui-btn-xs layui-btn-normal" id="doc-history">
|
||||
@ -91,24 +91,46 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="layui-row" style="margin-top: 10px;">
|
||||
<button class="layui-btn layui-btn-primary layui-btn-fluid mrdoc-btn-default" onclick="saveDoc()" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存为草稿
|
||||
</button>
|
||||
<!-- 标签输入框 -->
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">标签</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="{{doc_tags}}" placeholder="输入标签名">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 10px;">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-fluid" onclick="createDoc()" id="create_doc" title="发布当前内容">
|
||||
<i class="fa fa-save"></i> 发布文档
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 10px;">
|
||||
<button class="layui-btn layui-btn-warm layui-btn-fluid" onclick="moveDoc()" title="复制或移动此文档到其他文集"><i class="fa fa-copy"></i> 复制/移动文档</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 10px;">
|
||||
<button class="layui-btn layui-btn-danger layui-btn-fluid" onclick="delDoc()" title="删除此文档"><i class="fa fa-trash"></i> 删除文档</button>
|
||||
<!-- 发布按钮 -->
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">发布</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<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" onclick="saveDoc()" title="保存当前内容为草稿文档">
|
||||
<i class="fa fa-save"></i> 保存为草稿
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 5px;">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-fluid" onclick="createDoc()" id="create_doc" title="发布当前内容">
|
||||
<i class="fa fa-save"></i> 发布文档
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 5px;">
|
||||
<button class="layui-btn layui-btn-warm layui-btn-fluid" onclick="moveDoc()" title="复制或移动此文档到其他文集"><i class="fa fa-copy"></i> 复制/移动文档</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" style="margin-top: 5px;">
|
||||
<button class="layui-btn layui-btn-danger layui-btn-fluid" onclick="delDoc()" title="删除此文档"><i class="fa fa-trash"></i> 删除文档</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -195,6 +217,7 @@
|
||||
'doc_id':'{{ doc.id }}',
|
||||
'project':$("#project").val(),
|
||||
'parent_doc':$("#parent-doc").val(),
|
||||
'doc_tag':$("#tagsinputval").val(),
|
||||
'doc_name':$("#doc-name").val(),
|
||||
'content':editor.getHTML(),
|
||||
//'content':editor.getPreviewedHTML(),
|
||||
@ -225,6 +248,7 @@
|
||||
var data = {
|
||||
'doc_id':'{{ doc.id }}',
|
||||
'project':$("#project").val(),
|
||||
'doc_tag':$("#tagsinputval").val(),
|
||||
'parent_doc':$("#parent-doc").val(),
|
||||
'doc_name':$("#doc-name").val(),
|
||||
'content':editor.getHTML(),
|
||||
|
@ -15,7 +15,7 @@
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<style>
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree, .layui-nav-itemed:after {
|
||||
background-color: #333 !important;
|
||||
}
|
||||
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{
|
||||
@ -144,7 +144,7 @@
|
||||
<p class="layui-elip" style="font-weight: 700;"><i class="layui-icon layui-icon-circle-dot" style="color: #5FB878;"></i> {{ p.name }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-card-body" style="font-size: 12px;">
|
||||
<p class="layui-word-aux layui-elip">作者:{{p.create_user}}</p>
|
||||
<p class="layui-word-aux layui-elip">最新:{{p.id | get_new_doc}}</p>
|
||||
<p class="tooltip layui-word-aux">简介:
|
||||
@ -269,7 +269,7 @@
|
||||
//$(window).scroll(positionFooter).resize(positionFooter);
|
||||
//设置条件栏选中值
|
||||
var url = layui.url();
|
||||
console.log(url)
|
||||
// console.log(url)
|
||||
$("#sel-role").val(url.search.role);
|
||||
$("#sel-sort").val(url.search.sort);
|
||||
layui.form.render('select');
|
||||
@ -294,24 +294,24 @@
|
||||
title:'新建文集',
|
||||
area:'300px;',
|
||||
id:'createPro',//配置ID
|
||||
content:'<div style="padding: 20px;"><input class="layui-input" type="text" id="pname" style="margin-bottom:10px;" placeholder="输入文集名" required lay-verify="required"><textarea name="desc" id="desc" placeholder="输入文集简介" class="layui-textarea"></textarea></div>',
|
||||
content: $('#create-project-div'),
|
||||
btn:['确定','取消'], //添加按钮
|
||||
btnAlign:'c', //按钮居中
|
||||
yes:function (index,layero) {
|
||||
layer.load(1);
|
||||
layer.load(1)
|
||||
data = {
|
||||
'pname':$("#pname").val(),
|
||||
'desc':$("#desc").val(),
|
||||
'role':$("#project-role").val(),
|
||||
}
|
||||
$.post("{% url 'create_project' %}",data,function(r){
|
||||
layer.closeAll("loading");
|
||||
if(r.status){
|
||||
//创建成功,刷新页面
|
||||
window.location.reload();
|
||||
}else{
|
||||
//创建失败,提示
|
||||
console.log(r)
|
||||
|
||||
layer.closeAll('loading')
|
||||
layer.msg(r.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -397,6 +397,24 @@
|
||||
{{ static_code | safe }}
|
||||
{% endif %}
|
||||
<!-- 统计代码结束 -->
|
||||
|
||||
<!-- 新建文集div块 -->
|
||||
<div style="padding: 20px;display:none;" id="create-project-div">
|
||||
<input class="layui-input" type="text" id="pname" style="margin-bottom:10px;" placeholder="输入文集名" required lay-verify="required">
|
||||
<textarea name="desc" id="desc" placeholder="输入文集简介,不超过100个字,超出将被截断" maxlength="100" class="layui-textarea"></textarea>
|
||||
<div class="layui-form-item" style="margin-top:10px;">
|
||||
<label class="layui-form-label" style="text-align:left;padding:9px 0px;">文集权限</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="project-role" lay-verify="" class="layui-select" id="project-role">
|
||||
<!--<option value="">选择文集权限</option>-->
|
||||
<option value="0">公开</option>
|
||||
<option value="1">私密</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="color:red;font-size:12px;">*在可后台对文集权限进行进一步控制</div>
|
||||
</div>
|
||||
<!-- 结束新建文集div块 -->
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
@ -98,6 +98,12 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_bottom_block %}
|
||||
<button id="share" class="doc-bottom-btn" tooltip="分享本文档" style="padding-left: 20px;">
|
||||
<i class="fa fa-share-alt" ></i> 分享
|
||||
</button>
|
||||
{% endblock %}
|
||||
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
// 生成文集目录大纲
|
||||
|
@ -356,7 +356,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">© 2019-2010 by <a href="https://zmister.com/">州的先生</a> . All rights reserved.</div>
|
||||
<div class="foot">© 2019-2020 by <a href="https://zmister.com/">州的先生</a> . All rights reserved.</div>
|
||||
</div>
|
||||
<!--
|
||||
作者:D.Young
|
||||
|
@ -237,9 +237,10 @@
|
||||
<!-- 筛选开始 -->
|
||||
<div class="layui-inline">
|
||||
<!-- 文档搜索 -->
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-input-inline" style="width: inherit;">
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=doc&d_range={{d_range}}" class="search_type" id="search_doc"><i class="layui-icon layui-icon-search"></i>文档</a>
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=pro&d_range={{d_range}}" class="search_type" id="search_project"><i class="layui-icon layui-icon-list"></i>文集</a>
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=tag&d_range={{d_range}}" class="search_type" id="search_tag"><i class="layui-icon layui-icon-note"></i>标签</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 筛选结束 -->
|
||||
@ -313,7 +314,25 @@
|
||||
<a>{{ result.create_user }}</a> - <span style="font-size: 14px;color: #999;">{{result.modify_time}}</span></p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<!-- 标签搜索结果 -->
|
||||
{% elif search_type == 'tag' %}
|
||||
{% load doc_filter %}
|
||||
{% for result in datas %}
|
||||
<div style="margin-bottom: 18px;">
|
||||
<!-- 标题 -->
|
||||
<h3>
|
||||
<a href="{% url 'doc' pro_id=result.top_doc doc_id=result.id %}" target="_blank" class="search_result_title">{{ result.name }}</a>
|
||||
</h3>
|
||||
<!-- 简介 -->
|
||||
<div class="search_result_pre">{{ result.pre_content|get_key_context:kw }}</div>
|
||||
<!-- 所属文集 -->
|
||||
<p class="search_result_info">
|
||||
<a href="{% url 'pro_index' pro_id=result.top_doc %}" target="_blank">{{ result.top_doc | get_doc_top }}</a> - <span style="font-size: 14px;color: #999;">{{result.modify_time}}</span></p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- 主体结束 -->
|
||||
@ -417,9 +436,15 @@
|
||||
if('{{ search_type }}' == 'doc'){
|
||||
$('#search_doc').addClass('current_search_type')
|
||||
$('#search_project').removeClass('current_search_type')
|
||||
$('#search_tag').removeClass('current_search_type')
|
||||
}else if('{{ search_type }}' == 'pro'){
|
||||
$('#search_project').addClass('current_search_type')
|
||||
$('#search_doc').removeClass('current_search_type')
|
||||
$('#search_tag').removeClass('current_search_type')
|
||||
}else if('{{ search_type }}' == 'tag'){
|
||||
$('#search_tag').addClass('current_search_type')
|
||||
$('#search_doc').removeClass('current_search_type')
|
||||
$('#search_project').removeClass('current_search_type')
|
||||
}
|
||||
}
|
||||
tagCurrentSearchType();
|
||||
|
630
template/app_doc/tag_doc_base.html
Normal file
@ -0,0 +1,630 @@
|
||||
{% load staticfiles %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn" style="font-size: 14px;">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="keywords" content="{% block keyword %}{% endblock %}mrdoc"/>
|
||||
<meta name="description" content="{% block description %}{% endblock %}" />
|
||||
<title>{% block title %}标签:{{tag.name}}{% endblock %} - 觅道文档MrDoc</title>
|
||||
|
||||
<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">
|
||||
<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;
|
||||
}
|
||||
/* 下拉目录隐藏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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="doc layui-fluid" style="padding-left:0px;">
|
||||
<!-- 左侧目录栏 -->
|
||||
<div class="doc-summary">
|
||||
<!-- 文档搜索 -->
|
||||
<form action="" method="get">
|
||||
<div id="doc-search-input">
|
||||
<input type="text" name="kw" placeholder="输入并回车搜索" value="" class="layui-input doc-search-input">
|
||||
</div>
|
||||
</form>
|
||||
<!-- 文集名称 -->
|
||||
<div class="project-title">
|
||||
<i class="fa fa-tag"></i> 标签:<a href="{% url 'tag_docs' tag.id %}">{{ tag.name }}
|
||||
{% if project.role == 1 %}
|
||||
<i class="layui-icon layui-icon-password" title="私密文档"></i>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<!-- 遍历文集大纲 -->
|
||||
{% load doc_filter %}
|
||||
<nav>
|
||||
<ul class="summary">
|
||||
<!-- 一级目录 -->
|
||||
{% for doc in docs %}
|
||||
<li tooltip="{{doc.doc.top_doc | get_doc_top}}" placement="bottom">
|
||||
<a href="{% url 'tag_doc' tag_id=tag.id doc_id=doc.doc.id %}" target="_blank" >{{ doc.doc.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bq">
|
||||
<a href="javascript:void(0);" class="mrdoc-link" id="dashang">本文档使用MrDoc发布</a>
|
||||
</div>
|
||||
<!-- 右下角广告块 -->
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{% if ad_code_3 %}
|
||||
<div class="ad-code">
|
||||
{{ ad_code_3 | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- 广告代码结束 -->
|
||||
</div>
|
||||
<!-- 左侧目录栏结束 -->
|
||||
|
||||
<!-- 右侧文档栏 -->
|
||||
<div class="doc-body">
|
||||
<!-- 文档导航 -->
|
||||
<div class="doc-header" role="navigation">
|
||||
<a class="btn pull-left js-toolbar-action" aria-label="" href="javascript:void(0);" title="切换侧边栏">
|
||||
<i class="fa fa-align-justify"></i>
|
||||
</a>
|
||||
<a class="btn pull-left font-small" href="javascript:void(0);" title="缩小字体">
|
||||
<i class="fa fa-font">-</i>
|
||||
</a>
|
||||
<a class="btn pull-left font-large" href="javascript:void(0);" title="放大字体">
|
||||
<i class="fa fa-font">+</i>
|
||||
</a>
|
||||
<a class="btn pull-left font-switch" href="javascript:void(0);" title="切换字体类型">
|
||||
<i class="fa fa-text-height"></i>
|
||||
</a>
|
||||
<!-- 顶部工具栏 -->
|
||||
{% 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">首页</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- 文档主体 -->
|
||||
<div class="doc-body-content">
|
||||
<div class="doc-body-content-div">
|
||||
<!-- 文档内容 -->
|
||||
<div class="doc-content">
|
||||
<!-- 标题 -->
|
||||
<div class="doc-info">
|
||||
<!-- 页面主体头信息 -->
|
||||
{% block content_head %}
|
||||
<h1>标签:{{ tag.name }}</h1><hr>
|
||||
{% endblock %}
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{% if ad_code %}
|
||||
<div class="ad-code">
|
||||
{{ ad_code | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- 广告代码结束 -->
|
||||
</div>
|
||||
<!-- 标题结束 -->
|
||||
<!-- 正文开始 -->
|
||||
<div class="markdown-body" id="content" style="padding: 20px;padding-top: 5px;">
|
||||
{% block page_content %}
|
||||
<div id="tag-relation-chart" style="max-width: max-content;width: 800px;height: 600px;">
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<!-- 正文结束 -->
|
||||
</div>
|
||||
<hr>
|
||||
<!-- 分享栏 -->
|
||||
<div style="color: rgba(0,0,0,.65);margin-bottom: 10px;margin-top: 10px;">
|
||||
{% block doc_bottom_block %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- 广告代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{% if ad_code_2 %}
|
||||
<div class="ad-code">
|
||||
{{ ad_code_2 | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- 广告代码结束 -->
|
||||
|
||||
{% block doc_previous_next %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧文档栏结束 -->
|
||||
<div class="toTop"><i class="layui-icon layui-icon-top" style="font-size: 40px;"></i></div>
|
||||
{% block right_widget %} {% endblock %}
|
||||
</div>
|
||||
|
||||
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
|
||||
<!-- 生成文集目录大纲 -->
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
// 生成文集目录
|
||||
getProjectToc = function(){
|
||||
$.post("{% url 'get_pro_doc_tree' %}",{'pro_id':'{{project.id}}'},function(r){
|
||||
$("#loading-project-toc").hide();
|
||||
if(r.status){
|
||||
var toc_str = ""
|
||||
layui.each(r.data,function(index,item){
|
||||
toc_str += "<li>"
|
||||
if(item['children'] != undefined){ // 存在二级文档
|
||||
li = '<div style="display:flex;justify-content:space-between;">' +
|
||||
'<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>' +
|
||||
'<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>'+
|
||||
'</div>'+
|
||||
'<ul class="sub-menu toc-close">'
|
||||
toc_str += li
|
||||
layui.each(item['children'],function(index,item){// 遍历二级文档
|
||||
toc_str += '<li>'
|
||||
if(item['children'] != undefined){ //存在三级文档
|
||||
li = '<div style="display:flex;justify-content:space-between;">' +
|
||||
'<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>' +
|
||||
'<i class="fa fa-chevron-left switch-toc" style="padding:15px;"></i>'+
|
||||
'</div>'+'<ul class="sub-menu toc-close">'
|
||||
toc_str += li
|
||||
layui.each(item['children'],function(index,item){ // 遍历三级文档
|
||||
li = '<li><a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a></li>'
|
||||
toc_str += li
|
||||
})
|
||||
toc_str += '</ul>'
|
||||
}else{// 不存在三级文档
|
||||
li = '<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>'
|
||||
toc_str += li
|
||||
}
|
||||
toc_str += '</li>'
|
||||
})
|
||||
toc_str += '</ul>'
|
||||
}else{//不存在二级文档
|
||||
li = '<a href="/project-'+'{{project.id}}'+'/doc-'+item.id+'/" title="'+item.title+'">'+item.title+'</a>'
|
||||
toc_str += li
|
||||
}
|
||||
toc_str += '</li>'
|
||||
});
|
||||
$('#project-toc').append(toc_str)
|
||||
tagCurrentDoc();
|
||||
}else{
|
||||
layer.msg("获取文集目录失败!")
|
||||
}
|
||||
});
|
||||
};
|
||||
// getProjectToc();
|
||||
|
||||
//为当前页面的目录链接添加蓝色样式
|
||||
tagCurrentDoc = function(){
|
||||
$("nav li a").each(function (i) {
|
||||
var $me = $(this);
|
||||
var lochref = $.trim(window.location.href); // 获取当前URL
|
||||
var mehref = $.trim($me.get(0).href);
|
||||
if (lochref.indexOf(mehref) != -1) {
|
||||
// console.log($me,lochref,mehref)
|
||||
$me.closest("li").addClass("active");
|
||||
//展开当前文档的上级目录
|
||||
$me.parent("li").parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开二级目录
|
||||
$me.parent("div").parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开还有子级的二级目录
|
||||
$me.parent("li").parent('ul').parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开三级目录
|
||||
$me.parents("ul.sub-menu").prevAll("div").children("i").toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
} else {
|
||||
// console.log(lochref,mehref)
|
||||
$me.closest("li").removeClass("active");
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- 小屏自动收起左侧文集大纲 -->
|
||||
<script>
|
||||
//加载页面时执行一次
|
||||
changeSidebar();
|
||||
//监听浏览器宽度的改变
|
||||
window.onresize = function(){
|
||||
changeSidebar();
|
||||
};
|
||||
function changeSidebar(){
|
||||
// 获取匹配指定的媒体查询
|
||||
var screen_width = window.matchMedia('(max-width: 768px)');
|
||||
//判断匹配状态
|
||||
if(screen_width.matches){
|
||||
//如果匹配到,切换侧边栏
|
||||
//console.log('小屏幕')
|
||||
$("body").addClass("big-page");
|
||||
}else{
|
||||
$("body").removeClass("big-page");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="{% static 'editor.md/lib/marked.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/prettify.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/raphael.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/underscore.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/sequence-diagram.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/flowchart.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/jquery.flowchart.min.js' %}"></script>
|
||||
<script src="{% static 'editor.md/lib/echarts.min.js' %}"></script>
|
||||
<!-- 脑图开始 -->
|
||||
<script src="{% static 'mindmap/d3@5.js' %}"></script>
|
||||
<script src="{% static 'mindmap/transform.min.js' %}"></script>
|
||||
<script src="{% static 'mindmap/view.min.js' %}"></script>
|
||||
<!-- 脑图结束 -->
|
||||
|
||||
<!-- <script src="{% static 'editor.md/editormd.min.js' %}?version={{mrdoc_version}}"></script> -->
|
||||
<script src="{% static 'editor.md/editormd.js' %}?version={{mrdoc_version}}"></script>
|
||||
<script src="{% static 'qrcodejs/qrcode.min.js' %}"></script>
|
||||
|
||||
<!-- 解析Markdown -->
|
||||
<script>
|
||||
//解析Markdown为HTML
|
||||
editormd.markdownToHTML("content", {
|
||||
htmlDecode : "style,script,iframe",
|
||||
emoji : true, //emoji表情
|
||||
taskList : true, // 任务列表
|
||||
tex : true, // 科学公式
|
||||
flowChart : true, // 流程图
|
||||
sequenceDiagram : true, // 时序图
|
||||
tocm : true, //目录
|
||||
toc :true,
|
||||
tocContainer : "#toc-container",
|
||||
tocDropdown : false,
|
||||
atLink : false,//禁用@链接
|
||||
|
||||
});
|
||||
// 显示分享弹出框
|
||||
$("#share").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['350px','350px'],
|
||||
shadeClose: true,
|
||||
content: $('#share_div')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 页面初始化字体设置 -->
|
||||
<script>
|
||||
font_stauts = window.localStorage.getItem('font-sans')
|
||||
if(font_stauts == 'serif'){// 字体类型
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
}
|
||||
if(window.localStorage.getItem('font-size')){// 字体大小
|
||||
font_size = window.localStorage.getItem('font-size')
|
||||
console.log(font_size)
|
||||
$('#content').css({'font-size':font_size+'rem'})
|
||||
}else{
|
||||
window.localStorage.setItem('font-size',1.0)
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 返回顶部 -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// 初始时,“返回顶部”标签隐藏
|
||||
$(".toTop").hide();
|
||||
$(window).scroll(function() {
|
||||
// 若滚动的高度,超出指定的高度后,“返回顶部”的标签出现。
|
||||
if($(document).scrollTop() >= 150) {
|
||||
$(".toTop").show();
|
||||
} else {
|
||||
$(".toTop").hide();
|
||||
}
|
||||
})
|
||||
// 绑定点击事件,实现返回顶部的效果
|
||||
$(".toTop").click(function() {
|
||||
$(document).scrollTop(0);
|
||||
});
|
||||
// 生成当前网页链接
|
||||
$("input[name=current_url]").val(document.URL)
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 切换隐藏侧边栏 -->
|
||||
<script>
|
||||
// 切换侧边栏
|
||||
$(function(){
|
||||
$(".js-toolbar-action").click(toggleSidebar);
|
||||
});
|
||||
//切换侧边栏显示隐藏
|
||||
function toggleSidebar(){
|
||||
console.log("切换侧边栏")
|
||||
$("body").toggleClass("big-page");
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 切换内容字体 -->
|
||||
<script>
|
||||
//切换文档内容字体类型
|
||||
$(function(){
|
||||
$('.font-switch').click(switchFont);
|
||||
});
|
||||
function switchFont(){
|
||||
if(font_stauts == 'serif'){
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
window.localStorage.setItem('font-sans','sans')
|
||||
}else{
|
||||
$(".doc-content").toggleClass("switch-font")
|
||||
$("#content").toggleClass("switch-font")
|
||||
window.localStorage.setItem('font-sans','serif')
|
||||
}
|
||||
};
|
||||
//放大字体
|
||||
$(function(){
|
||||
$('.font-large').click(largeFont);
|
||||
});
|
||||
function largeFont(){
|
||||
var font_size = window.localStorage.getItem('font-size')
|
||||
console.log(font_size)
|
||||
if(parseFloat(font_size) < 1.4){
|
||||
size = parseFloat(font_size) + 0.1
|
||||
$('#content').css({'font-size':size+'rem'})
|
||||
window.localStorage.setItem('font-size',size)
|
||||
}else{
|
||||
console.log("xxx")
|
||||
}
|
||||
};
|
||||
//缩小字体
|
||||
$(function(){
|
||||
$('.font-small').click(smallFont);
|
||||
});
|
||||
function smallFont(){
|
||||
var font_size = window.localStorage.getItem('font-size')
|
||||
if(parseFloat(font_size) >= 0.6){
|
||||
size = parseFloat(font_size) - 0.1
|
||||
$('#content').css({'font-size':size+'rem'})
|
||||
window.localStorage.setItem('font-size',size)
|
||||
}else{
|
||||
console.log("xxx")
|
||||
}
|
||||
};
|
||||
|
||||
// 显示打赏图片
|
||||
$("#dashang").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['480px','400px'],
|
||||
shadeClose: true,
|
||||
content: $('#dashang_img')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 分享选项卡模板 -->
|
||||
<div id="share_div" style="display: none;">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">微信扫一扫</li>
|
||||
<li>复制链接</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<p style="font-weight: 700;margin-bottom: 10px;">手机扫一扫进行分享</p>
|
||||
<div id="url_qrcode"></div>
|
||||
</div>
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<input type="text" id="copy_crt_url" name="current_url" class="layui-input" /><br>
|
||||
<button class="layui-btn layui-btn-radius layui-btn-xs" style="background-color: #333;" onclick="copyUrl();">复制链接</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 打赏选项卡模板 -->
|
||||
<div id="dashang_img" style="display: none;">
|
||||
<div class="layui-tab layui-tab-brief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">微信</li>
|
||||
<li>支付宝</li>
|
||||
<li>QQ支付</li>
|
||||
<li>PayPal</li>
|
||||
<li>项目源码</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
<div class="layui-tab-item layui-show" align='center'>
|
||||
<img src="{% static 'dashang/dashang_wx.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_alipay.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<img src="{% static 'dashang/dashang_qq.webp' %}" style="width: 300px;height: auto;" />
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<a href="https://paypal.me/zmister" target="_blank">
|
||||
<img src="{% static 'dashang/dashang_paypal.png' %}" style="width: 280px;height: auto;" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item" align='center'>
|
||||
<p><a href="https://github.com/zmister2016/MrDoc" target="_blank">GitHub:https://github.com/zmister2016/MrDoc</a></p>
|
||||
<br>
|
||||
<p><a href="https://gitee.com/zmister/MrDoc" target="_blank">码云:https://gitee.com/zmister/MrDoc</a> </p>
|
||||
<br>
|
||||
<p><a href="https://zmister.com" target="_blank">作者博客:https://zmister.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 展开收起左边目录
|
||||
$(function(){
|
||||
// $(".switch-toc").click(SwitchToc);
|
||||
$("body").on('click','.switch-toc',SwitchToc)
|
||||
});
|
||||
function SwitchToc(i){
|
||||
console.log("点击了")
|
||||
var $me = $(this);
|
||||
$(this).parent().next("ul").toggleClass("toc-close"); //切换展开收起样式
|
||||
$(this).toggleClass("fa-chevron-left fa-chevron-down");//切换图标
|
||||
};
|
||||
|
||||
// 展开文档树
|
||||
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");//切换图标
|
||||
})
|
||||
|
||||
};
|
||||
// 收起文档树
|
||||
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");//切换图标
|
||||
})
|
||||
};
|
||||
// 文档分享 - 复制链接
|
||||
copyUrl = function(){
|
||||
var crt_url_val = document.getElementById("copy_crt_url");
|
||||
crt_url_val.select();
|
||||
window.clipb
|
||||
document.execCommand("Copy");
|
||||
layer.msg("链接复制成功!")
|
||||
}
|
||||
// 生成二维码
|
||||
var qrcode = new QRCode("url_qrcode", {
|
||||
text: document.URL,
|
||||
width: 200,
|
||||
height: 200,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#ffffff",
|
||||
correctLevel : QRCode.CorrectLevel.H
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 统计代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{{ static_code | safe }}
|
||||
{% endif %}
|
||||
<!-- 统计代码结束 -->
|
||||
{% block custom_script %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
166
template/app_doc/tag_doc_single.html
Normal file
@ -0,0 +1,166 @@
|
||||
<!-- 继承自模板:app_doc/tag_doc_base.html -->
|
||||
{% extends 'app_doc/tag_doc_base.html' %}
|
||||
<!-- 引入静态文件 -->
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block keyword %}{{ doc.name }},{{ project.name }},{% endblock %}
|
||||
{% block description %}{{doc.pre_content | slice:"0:100"}}{% endblock %}
|
||||
{% block title %}{{ doc.name }} - 标签:{{ tag.name }}{% endblock %}
|
||||
|
||||
{% block head_toolbar %}
|
||||
{% 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">修改</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">添加</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">管理</span>
|
||||
</a>
|
||||
{% elif colla_user > 0 %}
|
||||
<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">修改</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">添加</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<!-- 文档目录 -->
|
||||
<div id="toc-container" class='sidebar'></div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content_head %}
|
||||
<h1>{{ doc.name }}</h1><hr>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<textarea style="display: none;">{{ doc.pre_content }}</textarea>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_bottom_block %}
|
||||
<div class="layui-row" style="margin-bottom: 10px;padding-left: 20px;">
|
||||
{% if doc_tags.count > 0 %}
|
||||
<i class="fa fa-tag"></i>
|
||||
{% for tag in doc_tags %}
|
||||
<a href="{% url 'tag_docs' tag.tag.id %}" style="font-size: 12px;line-height: 14px;height: 16px;padding: 0 5px;margin-left: 0;">{{tag.tag.name}}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space20" style="padding-left: 20px;">
|
||||
<span tooltip="文档创建人">
|
||||
<i class="fa fa-user"></i> {{ doc.create_user.username }}
|
||||
</span>
|
||||
|
||||
<span tooltip="所属文集" >
|
||||
<i class="fa fa-book"></i> <a href="{% url 'pro_index' project.id %}">{{project.name}}</a>
|
||||
</span>
|
||||
|
||||
<span tooltip="文档更新时间">
|
||||
<i class="fa fa-clock-o"></i> {{ doc.modify_time }}
|
||||
</span>
|
||||
|
||||
<button id="share" class="doc-bottom-btn" tooltip="分享本文档">
|
||||
<i class="fa fa-share-alt" ></i> 分享
|
||||
</button>
|
||||
|
||||
{% if request.user == doc.create_user or request.user.is_superuser %}
|
||||
<button class="doc-bottom-btn" tooltip="下载文档Markdown" id="download_doc">
|
||||
<i class="fa fa-download"></i> 下载
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_previous_next %}
|
||||
{% load doc_filter %}
|
||||
<div class="layui-row" style="margin-top: 10px;padding:10px;display:flex;justify-content:space-around;">
|
||||
<!-- <hr> -->
|
||||
<div>
|
||||
{% if doc.id|get_doc_previous == None %}
|
||||
<button class="layui-btn layui-btn-disabled layui-btn-sm layui-btn-radius"><i class="layui-icon layui-icon-prev "></i>上一篇</button>
|
||||
{% else %}
|
||||
<a href="{% url 'doc' doc.top_doc doc.id|get_doc_previous %}" class="layui-btn layui-btn-primary layui-btn-sm layui-btn-radius"><i class="layui-icon layui-icon-prev "></i>上一篇</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% if doc.id|get_doc_next == None %}
|
||||
<button class="layui-btn layui-btn-disabled layui-btn-sm layui-btn-radius">下一篇<i class="layui-icon layui-icon-next"></i></button>
|
||||
{% else %}
|
||||
<a href="{% url 'doc' doc.top_doc doc.id|get_doc_next %}" class="layui-btn layui-btn-primary layui-btn-sm layui-btn-radius">下一篇<i class="layui-icon layui-icon-next"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block right_widget %}
|
||||
<div class="tocMenu" style="display: none;">目录</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block custom_script %}
|
||||
<!-- 下载选项卡模板 -->
|
||||
<div id="download_div" style="display: none;">
|
||||
<div class="layui-row" style="margin: 10px;">
|
||||
<a class="" download='{{doc.name}}.md' href="{% url 'download_doc_md' doc.id %}" target="_blank">
|
||||
<i class="fa fa-download"></i> 下载Markdown文件
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{% static 'toc/doctoc.js' %}"></script>
|
||||
<script src="{% static 'viewerjs/viewer.js' %}"></script>
|
||||
<script>
|
||||
var layer = layui.layer;
|
||||
// 手机屏幕上默认最小化目录
|
||||
if(window.outerWidth < 1300){
|
||||
console.log('最小化目录');
|
||||
// setTimeout(function(){
|
||||
$(".sidebar").toggleClass("doc-toc-hide");
|
||||
// },300)
|
||||
}
|
||||
// 切换文档目录显示与否
|
||||
$(".tocMenu").click(function() {
|
||||
console.log("隐藏文档目录")
|
||||
$(".sidebar").toggleClass("doc-toc-hide");
|
||||
});
|
||||
|
||||
//修改a标签链接新窗口打开
|
||||
$('#content').on('click','a',function(e){
|
||||
e.target.target = '_blank';
|
||||
});
|
||||
// 图片放大显示
|
||||
var img_options = {
|
||||
url: 'data-original',
|
||||
fullscreen:false,//全屏
|
||||
rotatable:false,//旋转
|
||||
scalable:false,//翻转
|
||||
button:false,//关闭按钮
|
||||
toolbar:false,
|
||||
title:false,
|
||||
};
|
||||
var viewer = new Viewer(document.getElementById('content'), img_options);
|
||||
|
||||
// 显示文档下载弹出框
|
||||
$("#download_doc").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['350px','150px'],
|
||||
shadeClose: true,
|
||||
content: $('#download_div')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
150
template/app_doc/tag_docs.html
Normal file
@ -0,0 +1,150 @@
|
||||
<!-- 继承自模板:app_doc/tag_doc_base.html -->
|
||||
{% extends 'app_doc/tag_doc_base.html' %}
|
||||
<!-- 引入静态文件 -->
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block keyword %}{{ tag.name }},{% endblock %}
|
||||
{% block title %}标签:{{ tag.name }}{% endblock %}
|
||||
|
||||
{% block content_head %}
|
||||
<h1>标签:{{ tag.name }}</h1><hr>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<div id="tag-relation-chart" style="max-width: max-content;width: 900px;height: 600px;"></div>
|
||||
{% endblock %}
|
||||
|
||||
{% block doc_bottom_block %}
|
||||
<div class="layui-row layui-col-space20" style="padding-left: 20px;">
|
||||
<span tooltip="标签创建人">
|
||||
<i class="fa fa-user"></i> {{ tag.create_user }}
|
||||
</span>
|
||||
|
||||
<button id="share" class="doc-bottom-btn" tooltip="分享本文档">
|
||||
<i class="fa fa-share-alt" ></i> 分享
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block custom_script %}
|
||||
<script src="{% static 'toc/doctoc.js' %}"></script>
|
||||
<script src="{% static 'viewerjs/viewer.js' %}"></script>
|
||||
<script>
|
||||
var layer = layui.layer;
|
||||
// 手机屏幕上默认最小化目录
|
||||
if(window.outerWidth < 1300){
|
||||
console.log('最小化目录');
|
||||
// setTimeout(function(){
|
||||
$(".sidebar").toggleClass("doc-toc-hide");
|
||||
// },300)
|
||||
}
|
||||
// 切换文档目录显示与否
|
||||
$(".tocMenu").click(function() {
|
||||
console.log("隐藏文档目录")
|
||||
$(".sidebar").toggleClass("doc-toc-hide");
|
||||
});
|
||||
|
||||
//修改a标签链接新窗口打开
|
||||
$('#content').on('click','a',function(e){
|
||||
e.target.target = '_blank';
|
||||
});
|
||||
|
||||
// 显示文档下载弹出框
|
||||
$("#download_doc").click(function(r){
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['350px','150px'],
|
||||
shadeClose: true,
|
||||
content: $('#download_div')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 渲染标签关系图 -->
|
||||
<script type="text/javascript">
|
||||
// 基于准备好的dom,初始化echarts实例
|
||||
var tagChart = echarts.init(document.getElementById('tag-relation-chart'),null,{renderer: 'svg'});
|
||||
// 指定图表的配置项和数据
|
||||
var option = {
|
||||
// title: {
|
||||
// text: "标签:{{tag.name}} 文档关系网络图",
|
||||
// top: "top",
|
||||
// left: "left"
|
||||
// },
|
||||
tooltip: {},
|
||||
animationDuration: 3000,
|
||||
animationEasingUpdate: 'quinticInOut',
|
||||
series: [{
|
||||
name: '{{tag.name}}',
|
||||
type: 'graph',
|
||||
layout: 'circular',
|
||||
|
||||
force: {
|
||||
repulsion: 300
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
data:{{ tag_cate | safe }},
|
||||
},
|
||||
data:{{ tag_nodes_list | safe }},
|
||||
links:{{ tag_links_list |safe }},
|
||||
categories: {{ tag_cate | safe }},
|
||||
focusNodeAdjacency: true, // 突出显示节点以及节点的边和邻接节点
|
||||
roam: true, // 开启鼠标缩放和平移漫游
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
|
||||
}
|
||||
},
|
||||
emphasis: { // 高亮的图形样式
|
||||
label: {
|
||||
position: 'right',
|
||||
show: true
|
||||
},
|
||||
lineStyle: {
|
||||
width: 10
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderColor: '#fff',
|
||||
borderWidth: 1,
|
||||
shadowBlur: 10,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.3)'
|
||||
},
|
||||
lineStyle: {
|
||||
color: 'source',
|
||||
curveness: 0.3
|
||||
},
|
||||
}]
|
||||
};
|
||||
//点击事件
|
||||
tagChart.on('click', function (params) {
|
||||
console.log(params)
|
||||
if (params.dataType == 'node') {
|
||||
if (params.name != "{{tag.name}}") {
|
||||
window.location = "/tag_docs/" + params.data.id +'/';
|
||||
}
|
||||
}else if(params.dataType == 'edge'){
|
||||
window.open("/project-"+params.data.pid+'/doc-'+params.data.id+'/', '_blank')
|
||||
}
|
||||
});
|
||||
|
||||
// 使用刚指定的配置项和数据显示图表。
|
||||
tagChart.setOption(option);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
@ -8,7 +8,7 @@
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>用户登录 - MrDoc</title>
|
||||
<title>用户登录 - MrDoc觅道文档</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}" crossorigin="anonymous">
|
||||
@ -36,6 +36,9 @@
|
||||
.register-link{
|
||||
font-size: 12px;
|
||||
}
|
||||
button.layui-btn-normal{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 移动端输入框样式 */
|
||||
@media screen and (max-width: 450px){
|
||||
.layui-form-item .layui-input-inline {
|
||||
|
@ -30,6 +30,9 @@
|
||||
.register-link{
|
||||
font-size: 12px;
|
||||
}
|
||||
.layui-btn-normal{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* 移动端输入框样式 */
|
||||
@media screen and (max-width: 450px){
|
||||
.layui-form-item .layui-input-inline {
|
||||
@ -56,23 +59,23 @@
|
||||
{% if enable_register_code %}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="register_code" required lay-verify="required" placeholder="请输入注册码" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="register_code" required lay-verify="required" placeholder="请输入注册码" autocomplete="off" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="username" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{{username}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="email" name="email" required lay-verify="required" placeholder="请输入电子邮箱" autocomplete="off" class="layui-input">
|
||||
<input type="email" name="email" required lay-verify="required" placeholder="请输入电子邮箱" autocomplete="off" class="layui-input" value="{{email}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
||||
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input" value="{{password}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|