From 79212e060377b859099e36da999a79ebf3cd29d8 Mon Sep 17 00:00:00 2001 From: yangjian Date: Tue, 8 Jun 2021 14:33:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E8=AE=BE=E7=BD=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=95=BF=E4=BB=A3=E7=A0=81=E6=98=BE=E7=A4=BA=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_admin/views.py | 6 ++++++ template/app_doc/docs_base.html | 5 +++++ template/app_doc/share/share_doc.html | 5 +++++ template/app_doc/tag_doc_base.html | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/app_admin/views.py b/app_admin/views.py index 8c920ac..cb19e5b 100644 --- a/app_admin/views.py +++ b/app_admin/views.py @@ -831,6 +831,7 @@ def admin_setting(request): index_project_sort = request.POST.get('index_project_sort','1') # 首页文集默认排序 close_register = request.POST.get('close_register',None) # 禁止注册 require_login = request.POST.get('require_login',None) # 全站登录 + long_code = request.POST.get('long_code', None) # 长代码显示 static_code = request.POST.get('static_code',None) # 统计代码 ad_code = request.POST.get('ad_code',None) # 广告位1 ad_code_2 = request.POST.get('ad_code_2',None) # 广告位2 @@ -905,6 +906,11 @@ def admin_setting(request): name='img_scale', defaults={'value': img_scale, 'types': 'basic'} ) + # 更新长代码展示状态 + SysSetting.objects.update_or_create( + name='long_code', + defaults={'value': long_code, 'types': 'basic'} + ) # 更新邮箱启用状态 SysSetting.objects.update_or_create( name='enable_email', diff --git a/template/app_doc/docs_base.html b/template/app_doc/docs_base.html index 7c14c49..024b6a0 100644 --- a/template/app_doc/docs_base.html +++ b/template/app_doc/docs_base.html @@ -46,6 +46,11 @@ max-width: 350px; } {% endif %} + {% if long_code == 'on' %} + pre.linenums,.vditor-reset > pre > code{ + max-height: max-content!important; + } + {% endif %} /* html{ filter: invert(1) hue-rotate(180deg); } */ diff --git a/template/app_doc/share/share_doc.html b/template/app_doc/share/share_doc.html index 30af7e8..39445a4 100644 --- a/template/app_doc/share/share_doc.html +++ b/template/app_doc/share/share_doc.html @@ -39,6 +39,11 @@ max-width: 350px; } {% endif %} + {% if long_code == 'on' %} + pre.linenums,.vditor-reset > pre > code{ + max-height: max-content!important; + } + {% endif %} /* html{ filter: invert(1) hue-rotate(180deg); } */ diff --git a/template/app_doc/tag_doc_base.html b/template/app_doc/tag_doc_base.html index 11c9d93..e2711c8 100644 --- a/template/app_doc/tag_doc_base.html +++ b/template/app_doc/tag_doc_base.html @@ -40,6 +40,11 @@ max-width: 350px; } {% endif %} + {% if long_code == 'on' %} + pre.linenums,.vditor-reset > pre > code{ + max-height: max-content!important; + } + {% endif %} /* html{ filter: invert(1) hue-rotate(180deg); } */