File tree Expand file tree Collapse file tree 5 files changed +46
-5
lines changed
Expand file tree Collapse file tree 5 files changed +46
-5
lines changed Original file line number Diff line number Diff line change 1+ default_app_config = 'simpleui.apps.SimpleApp'
2+
3+
14def get_version ():
2- return '3.6 '
5+ return '3.7 '
Original file line number Diff line number Diff line change 1+ from django .apps import AppConfig
2+
3+
4+ class SimpleApp (AppConfig ):
5+ name = 'simpleui'
6+
7+ def ready (self ):
8+ # 如果是django3+ 就使用中间件,删除header中的X-Frame-Options
9+
10+ try :
11+ import django
12+ version = django .get_version ()
13+ if int (version .split ('.' )[0 ]) >= 3 :
14+ from django .conf import settings
15+ mname = 'simpleui.middlewares.SimpleMiddleware'
16+ if mname not in settings .MIDDLEWARE :
17+ settings .MIDDLEWARE .append (mname )
18+ except Exception as e :
19+ pass
20+ pass
Original file line number Diff line number Diff line change 1+ import os
2+
3+ try :
4+
5+ from django .utils .deprecation import MiddlewareMixin # Django 1.10.x
6+ except ImportError :
7+ MiddlewareMixin = object # Django 1.4.x - Django 1.9.x
8+
9+
10+ class SimpleMiddleware (MiddlewareMixin ):
11+
12+ def process_response (self , request , response ):
13+ response ['X-Frame-Options' ] = 'ALLOW-FROM'
14+ return response
Original file line number Diff line number Diff line change 1919
2020 </ style >
2121 < div id ="content-main " class ="form-main ">
22+ {% if '_popup' not in request.GET %}
2223 < div class ="page-header ">
2324 < el-page-header @back ="goBack " content ="{{title}} "/>
2425 </ div >
26+ {% endif %}
2527 {% block object-tools %}
2628 {% if change %}{% if not is_popup %}
2729 < ul class ="object-tools ">
Original file line number Diff line number Diff line change 11{% load i18n admin_urls simpletags%}
22< div class ="submit-row ">
3- < el-button type ="button " icon ="el-icon-arrow-left " @click ="prev() "
4- style ="float: left;margin-right: 10px;margin-bottom: 10px; ">
5- < span v-text ="getLanuage('Go back') "> </ span >
6- </ el-button >
3+ {% if '_popup' not in request.GET %}
4+ < el-button type ="button " icon ="el-icon-arrow-left " @click ="prev() "
5+ style ="float: left;margin-right: 10px;margin-bottom: 10px; ">
6+ < span v-text ="getLanuage('Go back') "> </ span >
7+ </ el-button >
8+ {% endif %}
79 {% if show_delete_link %}
810 {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
911 < el-button icon ="el-icon-delete " type ="danger " @click ="del('{% add_preserved_filters delete_url %}') "
You can’t perform that action at this time.
0 commit comments