又一次合并
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans 'Page not found' %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{% trans 'Page not found' %}</h2>
|
||||
|
||||
<p>{% trans "We're sorry, but the requested page could not be found." %}</p>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Server error' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{% trans 'Server error (500)' %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans 'Server Error <em>(500)</em>' %}</h1>
|
||||
<p>{% trans "There's been an error. It's been reported to the site administrators via email and should be fixed shortly. Thanks for your patience."
|
||||
%}</p>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,322 @@
|
||||
{% load i18n %}
|
||||
{% load admin_urls static admin_list simpletags %}
|
||||
<div class="actions">
|
||||
|
||||
<input type="hidden" name="action" value=""/>
|
||||
|
||||
{% if has_add_permission %}
|
||||
{% url cl.opts|admin_urlname:'add' as add_url %}
|
||||
|
||||
<el-button type="primary" icon="el-icon-plus" url="{% add_preserved_filters add_url is_popup to_field %}">
|
||||
{% trans 'Add' %}
|
||||
</el-button>
|
||||
{% endif %}
|
||||
|
||||
{% for field in action_form.fields.action.choices %}
|
||||
{% if field.0 %}
|
||||
|
||||
{% if field.0 == 'delete_selected' %}
|
||||
<el-button type="danger" data-name="{{ field.0 }}"
|
||||
icon="el-icon-delete" @click="delSelected('{{ field.0 }}')">{% trans 'Delete' %}</el-button>
|
||||
{% else %}
|
||||
<input type="hidden" name="select_across" v-model="select_across" value="0" class="select-across">
|
||||
<input type="hidden" name="file_format" v-model="file_format">
|
||||
{% if field.0 == 'export_admin_action' %}
|
||||
<el-select filterable v-model="file_format" style="width: 80px;">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button icon="fas fa-download" data-name="{{ field.0 }}">{{ field.1 }}</el-button>
|
||||
{% else %}
|
||||
<el-button :eid="customButton.{{ field.0 }}.eid"
|
||||
:icon="customButton.{{ field.0 }}.icon" :style="customButton.{{ field.0 }}.style"
|
||||
:confirm="customButton.{{ field.0 }}.confirm"
|
||||
:type="customButton.{{ field.0 }}.type" data-name="{{ field.0 }}">{{ field.1 }}
|
||||
</el-button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if cl.formset and cl.result_count %}
|
||||
<input type="hidden" name="_save" value="{% trans 'Save' %}"/>
|
||||
<el-button icon="el-icon-circle-check" type="success"
|
||||
@click="formSubmit()">{% trans 'Save' %}</el-button>
|
||||
{% endif %}
|
||||
|
||||
<el-button data-name="delete_selected" v-for="item in exts" :key="item.name" @click="extClick(item)">
|
||||
<span :class="getIcon(item.name)"></span>
|
||||
<span v-text="item.name"></span>
|
||||
</el-button>
|
||||
|
||||
{% block actions-counter %}
|
||||
{% if actions_selection_counter %}
|
||||
<span class="action-counter" data-actions-icnt="{{ cl.result_list|length }}">{{ selection_note }}</span>
|
||||
{% if cl.result_count != cl.result_list|length %}
|
||||
<span class="all">{{ selection_note_all }}</span>
|
||||
<span class="question">
|
||||
<a href="#"
|
||||
title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
|
||||
</span>
|
||||
<span class="clear">
|
||||
<a href="#" onclick="unSelect()">{% trans "Clear selection" %}</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
<el-button-group class="btn-group">
|
||||
{% if cl.search_fields or cl.has_filters %}
|
||||
<a href="javascript:;" @click="searchDisplay()" class="el-button el-button--default"><span
|
||||
class="el-icon-search"></span></a>
|
||||
{% endif %}
|
||||
<a href="javascript:;" @click="reload()" class="el-button el-button--default"><span
|
||||
class="el-icon-refresh"></span></a>
|
||||
<a href="javascript:;" @click="openNewPage()" class="el-button el-button--default"><span
|
||||
class="el-icon-news"></span></a>
|
||||
|
||||
</el-button-group>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/automatic/dicts.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/automatic/segment.js' %}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var _action = new Vue({
|
||||
el: '.actions',
|
||||
data: {
|
||||
select_across: 0,
|
||||
file_format: 1,
|
||||
show: true,
|
||||
options: [{
|
||||
value: 0,
|
||||
label: 'csv'
|
||||
}, {
|
||||
value: 1,
|
||||
label: 'xls'
|
||||
}, {
|
||||
value: 2,
|
||||
label: 'xlsx'
|
||||
}, {
|
||||
value: 3,
|
||||
label: 'tsv'
|
||||
}, {
|
||||
value: 4,
|
||||
label: 'ods'
|
||||
}, {
|
||||
value: 5,
|
||||
label: 'json'
|
||||
}, {
|
||||
value: 6,
|
||||
label: 'yaml'
|
||||
}, {
|
||||
value: 7,
|
||||
label: 'html'
|
||||
}],
|
||||
customButton:{% autoescape off %}{% custom_button %}{% endautoescape %},
|
||||
exts: []
|
||||
},
|
||||
created() {
|
||||
if (localStorage && typeof (localStorage.searchStatus) != 'undefined') {
|
||||
this.show = localStorage.searchStatus == 'true';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'show': function (newValue) {
|
||||
obj = document.querySelector('.xfull')
|
||||
if (!newValue) {
|
||||
//隐藏
|
||||
document.getElementById('toolbar').style.display = 'none';
|
||||
if (obj) {
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
} else {
|
||||
//显示
|
||||
document.getElementById('toolbar').style.display = 'inherit';
|
||||
if (obj) {
|
||||
obj.style.display = 'inherit';
|
||||
}
|
||||
}
|
||||
if (localStorage) {
|
||||
localStorage['searchStatus'] = newValue;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchDisplay: function () {
|
||||
|
||||
this.show = !this.show;
|
||||
|
||||
},
|
||||
reload: function () {
|
||||
window.location.reload()
|
||||
},
|
||||
openNewPage: function () {
|
||||
window.open(window.location.href)
|
||||
},
|
||||
getIcon: getIcon,
|
||||
extClick: function (item) {
|
||||
window.location.href = item.url;
|
||||
},
|
||||
formSubmit: function () {
|
||||
$("#changelist-form").submit();
|
||||
},
|
||||
delSelected: function (name) {
|
||||
|
||||
$("#changelist-form input[name='action']").val(name);
|
||||
|
||||
$("#changelist-form [name='_save']").removeAttr('name');
|
||||
|
||||
$("#changelist-form [name!='']").each(function () {
|
||||
var obj = $(this);
|
||||
if (obj.attr('name') && obj.attr('name').indexOf('form-') == 0) {
|
||||
obj.removeAttr('name');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var self = this;
|
||||
|
||||
function showMessage(msgs) {
|
||||
msgs.forEach(item => {
|
||||
this.$notify({
|
||||
title: getLanuage('Tips'),
|
||||
message: item.msg,
|
||||
type: item.tag,
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 增加非空判断!
|
||||
if ($("#changelist-form").serializeArray().length <= 2) {
|
||||
this.$message.error(getLanuage("Please select at least one option!"));
|
||||
return ;
|
||||
}
|
||||
|
||||
//#67 #66 修复删除问题,改为弹出确认
|
||||
|
||||
this.$confirm(getLanuage('Are you sure you want to delete the selected?'))
|
||||
.then(_ => {
|
||||
$.ajax({
|
||||
type: "POST",//方法类型
|
||||
url: "",//url
|
||||
data: $("#changelist-form").serialize() + '&post=yes',
|
||||
success: function (result) {
|
||||
var msgs = $(result).find('#out_message').html().replace('var messages=', '');
|
||||
showMessage.call(self, JSON.parse(msgs));
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
},
|
||||
error: function () {
|
||||
this.$notify({
|
||||
title: getLanuage('Tips'),
|
||||
message: 'Network error',
|
||||
type: 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}).catch(_ => {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function selectAll() {
|
||||
_action.select_across = 1;
|
||||
}
|
||||
|
||||
function unSelect() {
|
||||
_action.select_across = 0;
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
$(".actions button[data-name!='delete_selected']").click(function () {
|
||||
var url = $(this).attr("url");
|
||||
var eid = $(this).attr('eid');
|
||||
var confirm = $(this).attr('confirm');
|
||||
|
||||
if (confirm) {
|
||||
new Vue().$confirm(confirm, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => done.call(this));
|
||||
|
||||
} else {
|
||||
done.call(this)
|
||||
}
|
||||
|
||||
function done() {
|
||||
|
||||
if (eid) {
|
||||
for (var i in _action.customButton) {
|
||||
var temp = _action.customButton[i];
|
||||
if (temp.eid == eid) {
|
||||
|
||||
if (typeof (temp.action_type) != 'undefined') {
|
||||
|
||||
if (!temp.action_url) {
|
||||
this.$notify({
|
||||
title: 'error',
|
||||
message: 'action must contain attributes:action_url! ',
|
||||
type: 'error',
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
switch (temp.action_type) {
|
||||
case 0:
|
||||
window.location.href = temp.action_url;
|
||||
break;
|
||||
case 1:
|
||||
parent.window.app.openTab({
|
||||
url: temp.action_url,
|
||||
icon: temp.icon || 'fa fa-file',
|
||||
name: temp.short_description,
|
||||
breadcrumbs: []
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
window.open(temp.action_url)
|
||||
break;
|
||||
}
|
||||
console.log('中断后续操作')
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (url) {
|
||||
window.location.href = url;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(this).attr('data-name')) {
|
||||
var name = $(this).attr("data-name");
|
||||
$("#changelist-form input[name='action']").val(name);
|
||||
|
||||
$("#changelist-form [name='_save']").removeAttr('name');
|
||||
|
||||
$("#changelist-form [name!='']").each(function () {
|
||||
var obj = $(this);
|
||||
if (obj.attr('name') && obj.attr('name').indexOf('form-') == 0) {
|
||||
obj.removeAttr('name');
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#changelist-form").submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends "admin/index.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}
|
||||
|
||||
{% if not is_popup %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
›
|
||||
{% for app in app_list %}
|
||||
{{ app.name }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
@@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html>
|
||||
{% load i18n static simpletags %}
|
||||
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
|
||||
{% include 'admin/includes/css-part.html' %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}">
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/css/base.css' %}?_=2.7">
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/theme/simpleui.css' %}">
|
||||
|
||||
{% include 'admin/includes/js-part.html' %}
|
||||
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/language.js' %}?_=2.1.2"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/locale/en-us.js' %}?_=2.1.2"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/locale/' %}{% get_language %}.js"></script>
|
||||
|
||||
{% if ""|get_language_code != 'zh-hans' %}
|
||||
|
||||
<script type="text/javascript"
|
||||
src="{% static '/admin/simpleui-x/elementui/umd/locale/en.js' %}?_=2.1.2"></script>
|
||||
<script type="text/javascript">
|
||||
ELEMENT.locale(ELEMENT.lang.en)
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/cookie.js' %}"></script>
|
||||
{% block extrastyle %}{% endblock %}
|
||||
{% if LANGUAGE_BIDI %}
|
||||
<link rel="stylesheet" type="text/css" href="
|
||||
{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}?_=20180905"/>{% endif %}
|
||||
{% block extrahead %}{% endblock %}
|
||||
{% block responsive %}
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}?_=20180905"/>
|
||||
{% if LANGUAGE_BIDI %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}?_=20180905"/>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block blockbots %}
|
||||
<meta name="robots" content="NONE,NOARCHIVE"/>{% endblock %}
|
||||
<script type="text/javascript" src="{% static '/admin/js/vendor/jquery/jquery.min.js' %}"></script>
|
||||
</head>
|
||||
{% load i18n %}
|
||||
|
||||
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
|
||||
data-admin-utc-offset="{% now "Z" %}">
|
||||
|
||||
{% verbatim dynamicCss %}
|
||||
{% endverbatim dynamicCss %}
|
||||
|
||||
<div id="theme">
|
||||
<link v-if="theme && theme!=''" rel="stylesheet" :href="theme">
|
||||
|
||||
{% if "SIMPLEUI_DEFAULT_THEME"|get_config %}
|
||||
<link v-else rel="stylesheet"
|
||||
href="{% static 'admin/simpleui-x/theme/' %}{{ "SIMPLEUI_DEFAULT_THEME"|get_config }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var fontConfig = new Vue({
|
||||
data: {
|
||||
fontSize: null
|
||||
},
|
||||
watch: {
|
||||
fontSize: function (newValue) {
|
||||
if (newValue != 0) {
|
||||
var fontStyle = document.getElementById('fontStyle');
|
||||
if (!fontStyle) {
|
||||
fontStyle = document.createElement('style');
|
||||
fontStyle.id = 'fontStyle';
|
||||
fontStyle.type = 'text/css';
|
||||
document.head.append(fontStyle);
|
||||
}
|
||||
fontStyle.innerHTML = '*{font-size:' + newValue + 'px!important;}'
|
||||
|
||||
} else {
|
||||
var fontStyle = document.getElementById('fontStyle');
|
||||
if (fontStyle) {
|
||||
fontStyle.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
var val = getCookie('fontSize');
|
||||
if (val) {
|
||||
this.fontSize = parseInt(val);
|
||||
} else {
|
||||
this.fontSize = 0;
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
});
|
||||
|
||||
|
||||
new Vue({
|
||||
el: '#theme',
|
||||
data: {
|
||||
theme: '',
|
||||
},
|
||||
created: function () {
|
||||
this.theme = getCookie('theme');
|
||||
|
||||
var self = this;
|
||||
//向父组件注册事件
|
||||
if (parent.addEvent) {
|
||||
parent.addEvent('theme', function (theme) {
|
||||
self.theme = theme;
|
||||
});
|
||||
|
||||
parent.addEvent('font', function (font) {
|
||||
fontConfig.fontSize = font;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
window.addEventListener('beforeunload', () => {
|
||||
if (window.beforeLoad) {
|
||||
window.beforeLoad();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- Container -->
|
||||
<div id="container">
|
||||
|
||||
{% block messages %}
|
||||
{% autoescape off %}
|
||||
{% load_message %}
|
||||
{% endautoescape %}
|
||||
<script type="text/javascript">
|
||||
|
||||
new Vue({
|
||||
created: function () {
|
||||
var self = this;
|
||||
|
||||
messages.forEach(item => {
|
||||
setTimeout(function () {
|
||||
self.$notify({
|
||||
title: getLanuage('Tips'),
|
||||
message: item.msg,
|
||||
type: item.tag,
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
}, 200);
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
{% endblock messages %}
|
||||
|
||||
<div class="menu-content">
|
||||
{% for app in app_list %}
|
||||
{{ app }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<!-- Content -->
|
||||
<div id="content" class="{% block coltype %}colM{% endblock %}">
|
||||
{% has_admindoc_page as has_page %}
|
||||
{% if has_page %}
|
||||
{% url 'django-admindocs-docroot' as rooturl %}
|
||||
{% if request.path != rooturl %}
|
||||
<a href="{% url 'django-admindocs-docroot' %}">{% trans 'Back to View documentation' %}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% block pretitle %}{% endblock %}
|
||||
{% block content_title %}
|
||||
{% if title %}
|
||||
<div style="display: none">{{ title }}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% block object-tools %}{% endblock %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
{% block sidebar %}{% endblock %}
|
||||
<br class="clear"/>
|
||||
</div>
|
||||
<!-- END Content -->
|
||||
|
||||
{% block footer %}
|
||||
<div id="footer"></div>{% endblock %}
|
||||
</div>
|
||||
<!-- END Container -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav-global %}{% endblock %}
|
||||
@@ -0,0 +1,136 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_urls static admin_modify simpletags%}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
|
||||
{{ media }}
|
||||
|
||||
{% endblock %}
|
||||
{% block extrastyle %}{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"/>{% endblock %}
|
||||
{% block content %}
|
||||
<style type="text/css">
|
||||
.inline-group .tabular td.original p {
|
||||
margin-top: -33px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="content-main" class="form-main">
|
||||
{% if '_popup' not in request.GET %}
|
||||
<div class="page-header">
|
||||
<el-page-header @back="goBack" content="{{title}}"/>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block object-tools %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
<ul class="object-tools">
|
||||
{% block object-tools-items %}
|
||||
<li>
|
||||
<el-dialog title="{% trans "History" %}" :visible.sync="dialogTableVisible">
|
||||
<iframe frameborder="0" :src="url" width="100%" height="300"></iframe>
|
||||
</el-dialog>
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
|
||||
<el-button @click="go_url('{% add_preserved_filters history_url %}')" class="historylink"
|
||||
icon="fas fa-history">{% trans "History" %}
|
||||
</el-button>
|
||||
</li>
|
||||
{% if has_absolute_url %}
|
||||
<li>
|
||||
<el-button @click="window.open('{{ absolute_url }}')" class="viewsitelink" icon="fas fa-globe-asia">{% trans "View on site" %}</el-button>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% endblock %}
|
||||
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post"
|
||||
id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
|
||||
<div>
|
||||
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1"/>{% endif %}
|
||||
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}"/>{% endif %}
|
||||
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
|
||||
{% if errors %}
|
||||
<div id="alert">
|
||||
<el-alert
|
||||
title="{% if errors|length == 1 %}
|
||||
{% trans " Please correct the error below." %}
|
||||
{% else %}
|
||||
{% trans "Please correct the errors below." %}
|
||||
{% endif %}"
|
||||
type="error">
|
||||
</el-alert>
|
||||
</div>
|
||||
{{ adminform.form.non_field_errors }}
|
||||
{% endif %}
|
||||
|
||||
{% block field_sets %}
|
||||
{% for fieldset in adminform %}
|
||||
{% include "admin/includes/fieldset.html" %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block after_field_sets %}{% endblock %}
|
||||
|
||||
{% block inline_field_sets %}
|
||||
{% for inline_admin_formset in inline_admin_formsets %}
|
||||
{% include inline_admin_formset.opts.template %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block after_related_objects %}{% endblock %}
|
||||
|
||||
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
|
||||
|
||||
{% block admin_change_form_document_ready %}
|
||||
<script type="text/javascript"
|
||||
id="django-admin-form-add-constants"
|
||||
src="{% static 'admin/js/change_form.js' %}"
|
||||
{% if adminform and add %}
|
||||
data-model-name="{{ opts.model_name }}"
|
||||
{% endif %}>
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{# JavaScript for prepopulated fields #}
|
||||
{% prepopulated_fields_js %}
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
new Vue({
|
||||
el: '.page-header',
|
||||
methods: {
|
||||
goBack: function () {
|
||||
window.location.href = '{% get_model_url %}'
|
||||
}
|
||||
}
|
||||
})
|
||||
if ($(".object-tools").length != 0) {
|
||||
new Vue({
|
||||
el: '.object-tools',
|
||||
data: {
|
||||
dialogTableVisible: false,
|
||||
url: ''
|
||||
},
|
||||
methods: {
|
||||
go_url: function (url) {
|
||||
this.url = url;
|
||||
this.dialogTableVisible = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (document.getElementById('alert')) {
|
||||
new Vue({
|
||||
el: '#alert'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% load i18n admin_urls %}
|
||||
{% block object-tools-items %}
|
||||
<li>
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<a href="{% add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
|
||||
</li>
|
||||
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,116 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_urls static admin_list %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}?_=20180905"/>
|
||||
|
||||
{% if cl.formset %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"/>
|
||||
{% endif %}
|
||||
{% if cl.formset or action_form %}
|
||||
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
|
||||
{% endif %}
|
||||
{{ media.css }}
|
||||
{% if not actions_on_top and not actions_on_bottom %}
|
||||
<style>
|
||||
#changelist table thead th:first-child {
|
||||
width: inherit
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
{{ media.js }}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %}
|
||||
|
||||
{% if not is_popup %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› <a
|
||||
href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ cl.opts.app_config.verbose_name }}</a>
|
||||
› {{ cl.opts.verbose_name_plural|capfirst }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block coltype %}flex{% endblock %}
|
||||
{% block content_title %}
|
||||
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<style>
|
||||
#content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.object-tools {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 20px;
|
||||
height: 50px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.object-tools .import_link, .object-tools .export_link {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% block object-tools %}
|
||||
<ul class="object-tools">
|
||||
{% block object-tools-items %}
|
||||
{% if has_add_permission %}
|
||||
{{ block.super }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
<div id="content-main">
|
||||
|
||||
{% if cl.formset.errors %}
|
||||
<p class="errornote">
|
||||
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}
|
||||
{% trans "Please correct the errors below." %}{% endif %}
|
||||
</p>
|
||||
{{ cl.formset.non_form_errors }}
|
||||
{% endif %}
|
||||
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
|
||||
{% block search %}{% search_form cl %}{% endblock %}
|
||||
{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
|
||||
|
||||
<form id="changelist-form" method="post" {% if cl.formset.is_multipart %}
|
||||
enctype="multipart/form-data" {% endif %} novalidate>{% csrf_token %}
|
||||
{% if cl.formset %}
|
||||
<div>{{ cl.formset.management_form }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% block result_list %}
|
||||
|
||||
{# {% if action_form %}#}
|
||||
{% admin_actions %}
|
||||
{# {% endif %}#}
|
||||
|
||||
{% result_list cl %}
|
||||
|
||||
{% endblock %}
|
||||
{% block pagination %}{% pagination cl %}{% endblock %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(".object-tools").hide().find('li a').each(function () {
|
||||
_action.exts.push({
|
||||
name: $(this).text(),
|
||||
url: $(this).attr('href')
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% load i18n admin_urls %}
|
||||
|
||||
{% block object-tools-items %}
|
||||
{% if has_add_permission %}
|
||||
<li>
|
||||
{% url cl.opts|admin_urlname:'add' as add_url %}
|
||||
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink">
|
||||
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,50 @@
|
||||
{% load i18n static simpletags %}
|
||||
{% if result_hidden_fields %}
|
||||
<div class="hiddenfields">{# DIV for HTML validation #}
|
||||
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{#{% if results %}#}
|
||||
<div class="results">
|
||||
<table id="result_list">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for header in result_headers %}
|
||||
<th scope="col" {{ header.class_attrib }}>
|
||||
{% if header.sortable %}
|
||||
{% if header.sort_priority > 0 %}
|
||||
<div class="sortoptions">
|
||||
<a class="sortremove" href="{{ header.url_remove }}"
|
||||
title="{% trans "Remove from sorting" %}"></a>
|
||||
{% if num_sorted_fields > 1 %}<span class="sortpriority"
|
||||
title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">{{ header.sort_priority }}</span>{% endif %}
|
||||
<a href="{{ header.url_toggle }}"
|
||||
class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}"
|
||||
title="{% trans "Toggle sorting" %}"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="text">{% if header.sortable %}
|
||||
<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>{% else %}
|
||||
<span>{{ header.text|capfirst }}</span>{% endif %}</div>
|
||||
<div class="clear"></div>
|
||||
</th>{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for result in results %}
|
||||
{% if result.form.non_field_errors %}
|
||||
<tr>
|
||||
<td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr class="{% cycle 'row1' 'row2' %}">
|
||||
{% for item in result %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{#{% endif %}#}
|
||||
@@ -0,0 +1,10 @@
|
||||
{% if show %}
|
||||
<div class="xfull">
|
||||
<ul class="toplinks">
|
||||
{% if back %}<li class="date-back"><a href="{{ back.link }}">‹ {{ back.title }}</a></li>{% endif %}
|
||||
{% for choice in choices %}
|
||||
<li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul><br class="clear" />
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% load i18n %}
|
||||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
||||
<ul>
|
||||
{% for choice in choices %}
|
||||
<li{% if choice.selected %} class="selected"{% endif %}>
|
||||
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -0,0 +1,119 @@
|
||||
{% load i18n static simpletags %}
|
||||
|
||||
<div id="home">
|
||||
|
||||
<el-row class="info-card">
|
||||
|
||||
{% if "SIMPLEUI_HOME_QUICK"|get_config != False%}
|
||||
|
||||
{% if "SIMPLEUI_HOME_INFO"|get_config != False %}
|
||||
<el-col :span="18">
|
||||
{% else %}
|
||||
<el-col :span="24">
|
||||
{% endif %}
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<i class="fas fa-link"></i>
|
||||
<span v-text="getLanuage('Quick navigation')"></span>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
{% if "SIMPLEUI_HOME_QUICK"|get_config != False %}
|
||||
|
||||
|
||||
<div v-for="(c,j) in models" :key="c.name" class="quick-wrap">
|
||||
<a href="javascript:;" @click="openTab(c,(j+1)+'')">
|
||||
<span class="icon" :class="c.icon"></span>
|
||||
<span class="card-name" v-text="c.name"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
{% endif %}
|
||||
|
||||
{% if "SIMPLEUI_HOME_INFO"|get_config != False %}
|
||||
<el-col :span="6">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
|
||||
<span><i class="fab fa-stripe-s"></i>Simpleui <span
|
||||
v-text="getLanuage('Home page')"></span></span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="report()"><span
|
||||
v-text="getLanuage('Report issue')"></span></el-button>
|
||||
</div>
|
||||
<div class="float-wrap clearfix">
|
||||
<div style="text-align: center">
|
||||
{% get_app_info %}
|
||||
<a v-if="upgrade.isUpdate" href="javascript:;" @click="upgrade.dialogVisible=true"
|
||||
class="upgrade"><span class="el-icon-top"></span><span
|
||||
v-text="upgrade.version"></span></a>
|
||||
</div>
|
||||
<el-button icon="fas fa-code" @click="openUrl('https://gitee.com/tompeppa/simpleui')">Gitee
|
||||
</el-button>
|
||||
<el-button icon="fab fa-github" @click="openUrl('https://github.com/newpanjing/simpleui')">
|
||||
Github
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
{% endif %}
|
||||
</el-row>
|
||||
|
||||
|
||||
{% if "SIMPLEUI_HOME_ACTION"|get_config != False %}
|
||||
<el-card class="timeline">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{% trans 'Recent actions' %}</span>
|
||||
<el-button v-waves style="float: right; padding: 3px 0" type="text"
|
||||
:icon="timeline?'el-icon-arrow-up':'el-icon-arrow-down'"
|
||||
@click="displayTimeline()"></el-button>
|
||||
</div>
|
||||
{% load log %}
|
||||
{% get_admin_log 10 as admin_log for_user user %}
|
||||
{% if admin_log %}
|
||||
<transition name="el-zoom-in-top">
|
||||
<div class="block" v-if="timeline">
|
||||
<el-timeline>
|
||||
{% for entry in admin_log %}
|
||||
<el-timeline-item timestamp="{{ entry.action_time }}" placement="top">
|
||||
<el-card>
|
||||
<p>{{ entry.user }} {{ entry.action_time }}</p>
|
||||
<h4>{{ entry.content_type }}: {{ entry }}</h4>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
{% endfor %}
|
||||
</el-timeline>
|
||||
</div>
|
||||
</transition>
|
||||
{% endif %}
|
||||
</el-card>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
title="Upgrade Simpleui"
|
||||
:visible.sync="upgrade.dialogVisible"
|
||||
width="50%">
|
||||
<el-alert
|
||||
:title="'You can upgrade to '+upgrade.version"
|
||||
type="success">
|
||||
</el-alert>
|
||||
<div style="padding: 10px">
|
||||
<div>
|
||||
<h3>
|
||||
Run Command:
|
||||
</h3>
|
||||
<el-alert
|
||||
title="pip install django-simpleui -U"
|
||||
type="info">
|
||||
</el-alert>
|
||||
|
||||
</div>
|
||||
<div><h3>Change logs:</h3></div>
|
||||
<div v-text="upgrade.body"></div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -0,0 +1,8 @@
|
||||
{% load static simpletags %}
|
||||
{% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/elementui/theme-chalk/index.css' %}">
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/fontawesome-free-5.8.1-web/css/all.min.css' %}">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css">
|
||||
{% endif %}
|
||||
@@ -0,0 +1,219 @@
|
||||
<fieldset class="module aligned {{ fieldset.classes }}">
|
||||
{% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
|
||||
{% if fieldset.description %}
|
||||
<div class="description">{{ fieldset.description|safe }}</div>
|
||||
{% endif %}
|
||||
{% for line in fieldset %}
|
||||
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
||||
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
|
||||
{% for field in line %}
|
||||
<div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
|
||||
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
|
||||
{% if field.is_checkbox %}
|
||||
{{ field.field }}{{ field.label_tag }}
|
||||
{% else %}
|
||||
{{ field.label_tag }}
|
||||
{% if field.is_readonly %}
|
||||
<div class="readonly">{{ field.contents }}</div>
|
||||
{% else %}
|
||||
{{ field.field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<div class="help">{{ field.field.help_text|safe }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!--<script type="text/javascript" src="/static/admin/js/image_pro.js"></script>-->
|
||||
<!--<script type="text/javascript" src="/static/admin/js/imagePreview.js"></script>-->
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
/**
|
||||
* Created by hucf on 2019/11/20.
|
||||
*/
|
||||
var ImagePreview = {
|
||||
default_params:{},
|
||||
init:function (param) {
|
||||
if (param) {
|
||||
$.extend(this.default_params, param);
|
||||
}
|
||||
ip_global_img_list = [];
|
||||
var id = this.default_params.id;
|
||||
if (typeof id == 'string') {
|
||||
if ((ip_global_img_list = $("#"+id).find("img")).length == 0) {
|
||||
return;
|
||||
}
|
||||
} else if (typeof id == 'object' && id != null) {
|
||||
ip_global_img_list = $(id);
|
||||
}
|
||||
this.fnGenerateHtml();
|
||||
this.fnBindEvent(ip_global_img_list);
|
||||
},
|
||||
fnBindEvent:function (ip_global_img_list) {
|
||||
if (ip_global_img_list.length == 0) {
|
||||
return;
|
||||
}
|
||||
$(ip_global_img_list).on("click", this.onClickEvent);
|
||||
this.onDragEvent($("#ip-img-preview"));
|
||||
$("#ip-img-preview").on('mousewheel DOMMouseScroll', this.onMouseScrollEvent);
|
||||
|
||||
$('#ip-img-floatshadow').on("click", function () {
|
||||
$('#ip-img-preview').hide();
|
||||
$("#ip-left").hide();
|
||||
$("#ip-right").hide();
|
||||
$('#ip-img-floatshadow').hide();
|
||||
$('#ip-img-preview').attr("src", "");
|
||||
});
|
||||
$("#ip-left").hover(this.fnMouseOver,this.fnMouseOut).click(this.fnPrev);
|
||||
$("#ip-right").hover(this.fnMouseOver,this.fnMouseOut).click(this.fnNext);
|
||||
},
|
||||
fnGenerateHtml:function () {
|
||||
$("body").append('<img id="ip-img-preview" style="position: fixed;left: 50%;top: 50%;transform: translate(-50%, -50%);z-index: 19941206;cursor: move;display: none"/><div id="ip-img-floatshadow" style="z-index: 19941205;background-color: #000;opacity: .5;top: 0;left: 0;width: 100%;height: 100%;position: fixed;display: none" title="点击空白处关闭"></div>');
|
||||
$("body").append('<div id="ip-left" style="display: none; width: 100px; height: 100px;left: 5px; top: 50%; position:fixed;z-index:19941207; cursor: pointer;">' +
|
||||
'<div style="left:-30px;border: 50px solid;border-color: transparent #1CB9C4 transparent transparent;position: absolute;"></div></div>');
|
||||
$("body").append('<div id="ip-right" style="display: none; width: 100px; height: 100px; right: 5px; top: 50%; position:fixed; z-index:19941207;cursor: pointer;">' +
|
||||
'<div style="left:30px;border: 50px solid;border-color: transparent transparent transparent #1CB9C4;position: absolute;"></div></div>');
|
||||
},
|
||||
fnMouseOver:function () {
|
||||
$(this).css("background", "rgb(134, 134, 134)");
|
||||
$(this).css("border", "1px solid rgb(111, 111, 111)");
|
||||
},
|
||||
fnMouseOut:function () {
|
||||
$(this).css("background", "");
|
||||
$(this).css("border", "");
|
||||
},
|
||||
fnPrev:function () {
|
||||
if (typeof(ip_global_cur) == "number" && ip_global_cur>0) {
|
||||
ImagePreview.fnReset();
|
||||
$("#ip-img-preview").animate({left:"48%"}, 100);
|
||||
$("#ip-img-preview").attr("src", ip_global_img_list[--ip_global_cur].src);
|
||||
$("#ip-img-preview").animate({left:"50.5%"}, 100);
|
||||
$("#ip-img-preview").animate({left:"50%"}, 100);
|
||||
ImagePreview.fnAdjustMaxWidth();
|
||||
}
|
||||
},
|
||||
fnNext:function () {
|
||||
if (typeof(ip_global_cur) == "number" && ip_global_cur<ip_global_img_list.length-1) {
|
||||
ImagePreview.fnReset();
|
||||
$("#ip-img-preview").animate({left:"52%"}, 100);
|
||||
$("#ip-img-preview").attr("src", ip_global_img_list[++ip_global_cur].src);
|
||||
$("#ip-img-preview").animate({left:"49.5%"}, 100);
|
||||
$("#ip-img-preview").animate({left:"50%"}, 100);
|
||||
ImagePreview.fnAdjustMaxWidth();
|
||||
}
|
||||
},
|
||||
fnGetIndexOfCurImg:function (cur) {
|
||||
for (var i=0; i<ip_global_img_list.length; i++) {
|
||||
if ($(ip_global_img_list[i]).is(cur)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
},
|
||||
onClickEvent:function (e) {
|
||||
ImagePreview.fnReset();
|
||||
$("#ip-img-preview").attr("src", $(this).attr("src"));
|
||||
ImagePreview.fnAdjustMaxWidth();
|
||||
ip_global_cur = ImagePreview.fnGetIndexOfCurImg($(this));
|
||||
$("#ip-img-floatshadow").fadeIn();
|
||||
$("#ip-img-preview").fadeIn();
|
||||
$("#ip-left").fadeIn();
|
||||
$("#ip-right").fadeIn();
|
||||
},
|
||||
fnAdjustMaxWidth:function () {
|
||||
//最长边判定,避免超出屏幕画幅的展示
|
||||
var widthFlag = true;
|
||||
var max = $("#ip-img-preview").width();
|
||||
if (max < $("#ip-img-preview").height()) {
|
||||
widthFlag = false;
|
||||
max = $("#ip-img-preview").height();
|
||||
}
|
||||
if (widthFlag && $(window).width() < max) {
|
||||
$("#ip-img-preview").css("width","75%");
|
||||
} else if (!widthFlag && $(window).height() < max) {
|
||||
$("#ip-img-preview").css("height","75%");
|
||||
}
|
||||
},
|
||||
fnReset:function () {
|
||||
$("#ip-img-preview").css("left","50%");
|
||||
$("#ip-img-preview").css("top","50%");
|
||||
$("#ip-img-preview").css("width","");
|
||||
$("#ip-img-preview").css("height","");
|
||||
},
|
||||
onMouseScrollEvent:function (e) {
|
||||
e.preventDefault();
|
||||
var wheel = e.originalEvent.wheelDelta || -e.originalEvent.detail;
|
||||
var delta = Math.max(-1, Math.min(1, wheel));
|
||||
if (delta < 0) { //向下滚动
|
||||
$(this).width($(this).width() / 1.1);
|
||||
$(this).height($(this).height() / 1.1);
|
||||
} else { //向上滚动
|
||||
$(this).width($(this).width() * 1.1);
|
||||
$(this).height($(this).height() * 1.1);
|
||||
}
|
||||
},
|
||||
onDragEvent:function (obj) {
|
||||
obj.bind("mousedown", start);
|
||||
function start(event) {
|
||||
if (event.button == 0) {
|
||||
gapX = event.clientX - obj.offset().left;
|
||||
gapY = event.clientY - obj.offset().top;
|
||||
$(document).bind("mousemove", move);
|
||||
$(document).bind("mouseup", stop);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function move(event) {
|
||||
obj.css({
|
||||
"left": (event.clientX - gapX + obj.width() / 2) + "px",
|
||||
"top": (event.clientY - gapY + obj.height() / 2) + "px"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function stop() {
|
||||
$(document).unbind("mousemove", move);
|
||||
$(document).unbind("mouseup", stop);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
console.log("============================")
|
||||
|
||||
|
||||
|
||||
var image_document = document.getElementsByTagName("a");
|
||||
console.log(image_document)
|
||||
for (var i = 0; i < image_document.length; i++) {
|
||||
let text_list = image_document[i].href.split('.')
|
||||
console.log("text_list",text_list)
|
||||
let image_list = ["jpg", "png"]
|
||||
for (let j = 0; j <image_list.length ; j++) {
|
||||
console.log("image_list[i]-====", image_list[j])
|
||||
console.log("text_list[text_list.length-1]===",text_list[text_list.length-1])
|
||||
if (text_list[text_list.length-1] == image_list[j] )
|
||||
{
|
||||
console.log("oho=====")
|
||||
var herf = image_document[i].href
|
||||
console.log(herf)
|
||||
var image_html = image_document[i].outerHTML
|
||||
image_document[i].outerHTML = '<div id="imgBox"><img style="width: 200px" id="img" src="' + herf + '"/></div>'
|
||||
}
|
||||
}
|
||||
}
|
||||
// ImagePreview.init({id:"imgBox"});
|
||||
ImagePreview.init({id:$("#imgBox img")});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
#imgs img {
|
||||
width: 24%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,8 @@
|
||||
{% load static simpletags %}
|
||||
{% if "SIMPLEUI_STATIC_OFFLINE"|get_config %}
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/vue.min.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/elementui/index.js' %}"></script>
|
||||
{% else %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,377 @@
|
||||
<!DOCTYPE html>
|
||||
{% load i18n static %}
|
||||
{% load simpletags %}
|
||||
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
|
||||
<!--
|
||||
The project use: django-simpleui
|
||||
source code:
|
||||
https://github.com/newpanjing/simpleui
|
||||
-->
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
|
||||
{% block title %}
|
||||
<title>{{ site_title }}</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block icon %}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{% include 'admin/includes/css-part.html' %}
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/css/index.css' %}?_=3.2">
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/waves/waves.min.css' %}?_=2.1">
|
||||
{% endblock %}
|
||||
{% block head %}
|
||||
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<style type="text/css">
|
||||
.el-tabs__nav .el-tabs__item:nth-child(1) .el-icon-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
[v-block] {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
{% verbatim dynamicCss %}
|
||||
{% endverbatim dynamicCss %}
|
||||
|
||||
{% block menus %}
|
||||
{% autoescape off %}
|
||||
{% menus %}
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
<div id="main" @click="mainClick($event)" v-block>
|
||||
{% block theme_css %}
|
||||
<link v-if="theme && theme!=''" rel="stylesheet" :href="theme">
|
||||
|
||||
{% if "SIMPLEUI_DEFAULT_THEME"|get_config %}
|
||||
<link v-else rel="stylesheet"
|
||||
href="{% static 'admin/simpleui-x/theme/' %}{{ "SIMPLEUI_DEFAULT_THEME"|get_config }}">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
<el-drawer
|
||||
class="lite-menus"
|
||||
title="{{site_header}}"
|
||||
:visible.sync="drawer"
|
||||
:show-close="false"
|
||||
size="50%"
|
||||
direction="ltr">
|
||||
<el-menu unique-opened="true" :default-active="menuActive">
|
||||
<div v-for="(item,i) in menus" :key="item">
|
||||
<el-menu-item v-if="!item.models" :index="item.eid+''" @click="openTab(item,item.eid)">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title" v-text="item.name"></span>
|
||||
</el-menu-item>
|
||||
|
||||
|
||||
<el-submenu v-else :index="item.eid+''">
|
||||
<template slot="title">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title" v-text="item.name"></span>
|
||||
</template>
|
||||
|
||||
<el-menu-item-group v-for="(sub,j) in item.models" :title="sub.name" :key="sub.name">
|
||||
<el-menu-item :index="sub.eid+''" @click="openTab(sub,item.eid)">
|
||||
<i :class="sub.icon"></i>
|
||||
<span slot="title" v-text="sub.name"></span>
|
||||
</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
</el-submenu>
|
||||
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-drawer>
|
||||
|
||||
<el-container :style="{height: height+'px'}">
|
||||
|
||||
<el-aside v-if="!fold" width="auto" class="menu" {% block menu_style %}{% endblock %}>
|
||||
{% block logo %}
|
||||
<div class="logo-wrap" v-if="!fold">
|
||||
<div class="float-wrap">
|
||||
<div class="left">
|
||||
{% if "SIMPLEUI_LOGO"|get_config %}
|
||||
<img src="{{ "SIMPLEUI_LOGO"|get_config |safe }}">
|
||||
{% else %}
|
||||
<img src="{% static '/admin/simpleui-x/img/logo.png' %}">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="left">
|
||||
<span>{{ site_header }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<el-menu unique-opened="true" :default-active="menuActive" :collapse="fold">
|
||||
<div v-for="(item,i) in menus" :key="item">
|
||||
<el-menu-item v-if="!item.models" :index="item.eid+''" @click="openTab(item,item.eid)">
|
||||
<i :class="item.icon"></i>
|
||||
<span v-if="menuTextShow" slot="title" v-text="item.name"></span>
|
||||
</el-menu-item>
|
||||
|
||||
|
||||
<el-submenu v-else :index="item.eid+''">
|
||||
<template slot="title">
|
||||
<i :class="item.icon"></i>
|
||||
<span v-if="menuTextShow" slot="title" v-text="item.name"></span>
|
||||
</template>
|
||||
|
||||
<el-menu-item-group v-for="(sub,j) in item.models" :title="sub.name" :key="sub.name">
|
||||
<el-menu-item :index="sub.eid+''" @click="openTab(sub,item.eid)">
|
||||
<i :class="sub.icon"></i>
|
||||
<span slot="title" v-text="sub.name"></span>
|
||||
</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
</el-submenu>
|
||||
|
||||
</div>
|
||||
</el-menu>
|
||||
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
{% block header %}
|
||||
<el-header class="navbar" style="font-size: 12px;padding: 10px;height: auto">
|
||||
<div class="float-wrap">
|
||||
<div class="left">
|
||||
<el-button v-waves circle icon="fas fa-bars"
|
||||
style="margin-right: 10px;border: none" @click="foldClick()"></el-button>
|
||||
{% block breadcrumb %}
|
||||
<el-breadcrumb v-if="!mobile" style="display: inline-block;" separator="/">
|
||||
{% verbatim myclode %}
|
||||
<el-breadcrumb-item><i :class="menus[0].icon"
|
||||
:key="menus[0].name"></i>{{ menus[0].name }}
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-for="item in breadcrumbs"
|
||||
:key="item">
|
||||
<span :class="getIcon(item.name,item.icon)"></span>
|
||||
<span v-text="item.name"></span>
|
||||
</el-breadcrumb-item>
|
||||
{% endverbatim myclode %}
|
||||
</el-breadcrumb>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<el-button icon="fas fa-font" circle v-waves @click="fontClick()"></el-button>
|
||||
|
||||
<el-button
|
||||
:icon="this.zoom?'fas fa-compress-arrows-alt':'fas fa-expand-arrows-alt'"
|
||||
@click="goZoom()" circle></el-button>
|
||||
<el-button icon="fas fa-home" @click="goIndex('{{ 'SIMPLEUI_INDEX'|get_config }}')" circle
|
||||
v-waves></el-button>
|
||||
{% verbatim mycode %}
|
||||
<el-button @click="themeDialogVisible=true" v-waves>
|
||||
<i class="fas fa-palette"></i>
|
||||
<span v-text="getLanuage('Change theme')"></span><i
|
||||
class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
|
||||
{% endverbatim mycode %}
|
||||
<el-dropdown>
|
||||
<el-button v-waves>
|
||||
<i class="fas fa-user"></i>
|
||||
{{ user }}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
{% verbatim mycode %}
|
||||
<el-dropdown-item v-waves icon="far fa-edit"
|
||||
@click.native="changePassword()">{{ language.change_password }}
|
||||
</el-dropdown-item>
|
||||
{% endverbatim mycode %}
|
||||
{% has_enable_admindoc as has_admindoc %}
|
||||
{% if has_admindoc %}
|
||||
<el-dropdown-item icon="el-icon-document"
|
||||
@click.native="openTab({eid:100000,name:'{% trans 'Documentation' %}',icon:'el-icon-document',url:'{% url 'django-admindocs-docroot' %}'})"
|
||||
divided>{% trans 'Documentation' %}</el-dropdown-item>
|
||||
{% endif %}
|
||||
|
||||
{% verbatim mycode %}
|
||||
<el-dropdown-item icon="el-icon-close"
|
||||
@click.native="logout()"
|
||||
divided>{{ language.logout }}</el-dropdown-item>
|
||||
{% endverbatim mycode %}
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
{% endblock %}
|
||||
<el-main>
|
||||
<el-tabs v-model="tabModel" {% block tabs_type %}type="border-card" {% endblock %} editable
|
||||
:style="isResize?'height:100%':'height: calc(100% - 97px)'" @edit="handleTabsEdit"
|
||||
@tab-click="tabClick">
|
||||
|
||||
<el-tab-pane v-for="(item,index) in tabs" :closable="index!=0" :label="item.name" :name="item.id"
|
||||
:key="item.id" lazy="true">
|
||||
|
||||
{% home_page %}
|
||||
|
||||
{% if home %}
|
||||
<span v-if="index==0" slot="label"><i
|
||||
class="{{ icon }}"></i><span>{{ title }}</span>
|
||||
</span>
|
||||
<span v-else slot="label" @contextmenu.prevent="contextmenu(item,$event)">
|
||||
{% else %}
|
||||
<span slot="label" @contextmenu.prevent="contextmenu(item,$event)">
|
||||
{% endif %}
|
||||
|
||||
{% block tab-item %}
|
||||
<i :class="item.loading?'el-icon-loading':item.icon"></i>
|
||||
<span v-text="item.name"></span>
|
||||
{% endblock %}
|
||||
</span>
|
||||
|
||||
<div v-if="index==0" style="height:100%">
|
||||
{% if home %}
|
||||
<iframe :src="'{{ home }}'"></iframe>
|
||||
{% else %}
|
||||
{% include './home.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div v-else class="iframe-wrap">
|
||||
<iframe :src="item.url" :id="item.id" @load="iframeLoad(item,$event)"></iframe>
|
||||
{% if "SIMPLEUI_LOADING"|get_config != False %}
|
||||
<div v-if="loading" class="loading" @dblclick="loading=false">
|
||||
<div class="center">
|
||||
<span class="el-icon-loading"></span>
|
||||
<span>loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
</el-tabs>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
||||
<ul v-if="popup.show" class="el-dropdown-menu el-popper"
|
||||
:style="{position: 'absolute',top: popup.top+'px',left: popup.left+'px'}" x-placement="top-end">
|
||||
<li v-for="(item,index) in popup.menus" tabindex="-1" class="el-dropdown-menu__item"
|
||||
@click="item.handler(popup.tab,item)"><i :class="item.icon"></i><span
|
||||
v-text="item.text"></span>
|
||||
</li>
|
||||
</ul>
|
||||
<el-dialog title="{% trans 'Change password' %}" :visible.sync="pwdDialog.show">
|
||||
<iframe frameborder="0" :src="pwdDialog.url" width="100%" height="500"></iframe>
|
||||
</el-dialog>
|
||||
|
||||
{% block theme_dialog %}
|
||||
<el-dialog
|
||||
:title="getLanuage('Change theme')"
|
||||
:visible.sync="themeDialogVisible"
|
||||
:width="small?'90%':'50%'">
|
||||
{% block theme_body %}
|
||||
<div class="change-theme clearfix">
|
||||
<div v-waves :class="{'theme-item':true,active:themeName==item.text}" v-for="(item,i) in themes"
|
||||
:key="item.text"
|
||||
:title="getLanuage(item.text)" @click="setTheme(item)">
|
||||
<div class="theme-menu" :style="{background:item.menu}">
|
||||
<div class="theme-logo" :style="{background: item.logo}"></div>
|
||||
</div>
|
||||
<div class="theme-top" :style="{background: item.top}"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</el-dialog>
|
||||
{% endblock %}
|
||||
|
||||
{% block font_dialog %}
|
||||
<el-dialog
|
||||
:title="getLanuage('Set font size')"
|
||||
:visible.sync="fontDialogVisible"
|
||||
:width="small?'90%':'50%'">
|
||||
<el-slider v-model="fontSlider" :min="12" :max="100" show-input @change="fontSlideChange"></el-slider>
|
||||
<div style="text-align: right;padding-top: 20px">
|
||||
<el-button type="primary" @click="reset()" v-text="getLanuage('Reset')"></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block base_script %}
|
||||
<script type="text/javascript">
|
||||
{% if home %}
|
||||
var home = {
|
||||
id: '0',
|
||||
index: '1',
|
||||
name: '{{ title }}',
|
||||
icon: '{{ icon }}',
|
||||
active: true,
|
||||
eid: '1'
|
||||
}
|
||||
{% else %}
|
||||
var home = {
|
||||
id: '0',
|
||||
index: '1',
|
||||
eid: '1',
|
||||
name: "{% trans 'Home' %}",
|
||||
icon: 'fas fa-home'
|
||||
};
|
||||
{% endif %}
|
||||
menus.unshift(home);
|
||||
window.language = {
|
||||
change_password: '{% trans 'Change password' %}',
|
||||
logout: '{% trans 'Log out' %}',
|
||||
yes: '{% trans 'Yes' %}',
|
||||
no: '{% trans 'No' %}',
|
||||
confirm: '{% trans 'Are you sure?' %}'
|
||||
}
|
||||
window.themeUrl = '{% static '/admin/simpleui-x/theme/' %}';
|
||||
window.urls = {
|
||||
changePassword: "{% url 'admin:password_change' %}",
|
||||
logout: "{% url 'admin:logout' %}"
|
||||
}
|
||||
var lanuageCode = '{% get_language %}';
|
||||
|
||||
function localeError(e) {
|
||||
console.warn("Please add the {% get_language %}.js language file to the '/simpleui-x/theme' directory.")
|
||||
console.log("See simpleui i18n:https://github.com/newpanjing/simpleui/blob/master/i18n.md")
|
||||
console.log("或者加入QQ群:786576510 (Join QQ Group.)")
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
{% include 'admin/includes/js-part.html' %}
|
||||
|
||||
<script type="text/javascript">
|
||||
__simpleui_version = '{% simple_version %}';
|
||||
</script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/automatic/dicts.js' %}?_={% get_version %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/automatic/segment.js' %}?_={% get_version %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/locale/en-us.js' %}?_={% get_version %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/locale/' %}{% get_language %}.js?_={% get_version %}"
|
||||
onerror="localeError()"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/cookie.js' %}?_={% get_version %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/theme/theme.js' %}?_={% get_version %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/waves/waves.min.js' %}?_={% get_version %}"></script>
|
||||
{% block index_js %}
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/index.js' %}?_={% get_version %}"></script>
|
||||
{% endblock %}
|
||||
{% block autoupdate %}
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
{% load_analysis %}
|
||||
{% block script %}
|
||||
{# 预留脚本block 可以实现基础该页面,添加自定义脚本#}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {{ title }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>{% trans "Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user." %}</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
{% load i18n static simpletags %}
|
||||
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
|
||||
<!--
|
||||
The project use: django-simpleui
|
||||
source code:
|
||||
https://github.com/newpanjing/simpleui
|
||||
-->
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
{% block title %}
|
||||
<title>{{ site_title }}-{% trans 'Log in' %}</title>
|
||||
{% endblock %}
|
||||
{% block icon %}
|
||||
{# <link rel="icon" href="{% static '/admin/simpleui-x/img/favicon.png' %}">#}
|
||||
{% endblock %}
|
||||
|
||||
{% include 'admin/includes/css-part.html' %}
|
||||
|
||||
{% block css %}
|
||||
<link rel="stylesheet" href="{% static '/admin/simpleui-x/css/login.css' %}?_=2.1">
|
||||
{% endblock %}
|
||||
{% block bg %}
|
||||
<style type="text/css">
|
||||
.bg {
|
||||
background: #f0f2f5;
|
||||
background-image: url('{% static '/admin/simpleui-x/img/bg.svg' %}');
|
||||
min-height: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
background-size: 100%;
|
||||
padding: 20px 0;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{# You can add code here. #}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body class="bg">
|
||||
|
||||
<div class="login-main">
|
||||
{% block logo %}
|
||||
<div class="logo">
|
||||
{% if "SIMPLEUI_LOGO"|get_config %}
|
||||
<img src="{{ "SIMPLEUI_LOGO"|get_config |safe }}">
|
||||
{% else %}
|
||||
<img src="{% static '/admin/simpleui-x/img/logo.png' %}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="header">{{ site_header }}</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block errors %}
|
||||
{% if form.non_field_errors %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<el-alert
|
||||
title="{{ error }}"
|
||||
type="error">
|
||||
</el-alert>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if form.errors and not form.non_field_errors %}
|
||||
<p class="errornote">
|
||||
{% if form.errors.items|length == 1 %}
|
||||
<el-alert title="{% trans "Please correct the error below." %}" type="error"></el-alert>
|
||||
{% else %}
|
||||
<el-alert title="{% trans "Please correct the errors below." %}" type="error"></el-alert>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block form %}
|
||||
<form class="simpleui-form" action="{{ app_path }}" method="post" id="login-form">
|
||||
{% csrf_token %}
|
||||
<div class="simpleui-input-inline">
|
||||
<el-input prefix-icon="fas fa-user" v-model="username" name="username"
|
||||
placeholder="{% trans 'username' %}"></el-input>
|
||||
</div>
|
||||
<div class="simpleui-input-inline">
|
||||
<el-input prefix-icon="fas fa-lock" type="password" v-model="password" name="password"
|
||||
@keyup.enter.native="login()"
|
||||
placeholder="{% trans 'password' %}" show-password></el-input>
|
||||
</div>
|
||||
<div class="simpleui-input-inline login-btn">
|
||||
<el-button :icon="loading?'el-icon-loading':''" @click="login()"
|
||||
type="primary">{% trans 'Log in' %}</el-button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="next" value="{{ next }}"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
{% include 'admin/includes/js-part.html' %}
|
||||
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/js/login.js' %}?_=3.3"></script>
|
||||
|
||||
{% block particles %}
|
||||
{% if 'SIMPLEUI_LOGIN_PARTICLES'|get_config != False %}
|
||||
<!--
|
||||
Close login page particles see link:
|
||||
关闭登录页粒子动画请查看:
|
||||
https://github.com/newpanjing/simpleui/blob/master/QUICK.md#关闭登录页粒子动画
|
||||
-->
|
||||
<style type="text/css">
|
||||
#particles-js {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
z-index: -1;
|
||||
}
|
||||
</style>
|
||||
<!-- particles.js container -->
|
||||
<div id="particles-js"></div>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/particles/particles.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static '/admin/simpleui-x/particles/app.js' %}"></script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,50 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_urls %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
|
||||
› <a
|
||||
href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
|
||||
› {% trans 'History' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
body, #container {
|
||||
background: #FFF;
|
||||
}
|
||||
</style>
|
||||
<div id="content-main">
|
||||
<div class="module">
|
||||
|
||||
{% if action_list %}
|
||||
<table id="change-history" class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans 'Date/time' %}</th>
|
||||
<th scope="col">{% trans 'User' %}</th>
|
||||
<th scope="col">{% trans 'Action' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for action in action_list %}
|
||||
<tr>
|
||||
<th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
|
||||
<td>{{ action.user.get_username }}{% if action.user.get_full_name %} (
|
||||
{{ action.user.get_full_name }}){% endif %}</td>
|
||||
<td>{{ action.get_change_message }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,34 @@
|
||||
{% load admin_list %}
|
||||
{% load i18n %}
|
||||
{% load simpletags %}
|
||||
<div id="pagination">
|
||||
{% if pagination_required %}
|
||||
<el-pagination
|
||||
background
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="{{ cl.page_num }}+1"
|
||||
:page-size="{{ cl.list_per_page }}"
|
||||
layout="total,prev, pager, next, jumper"
|
||||
:total="{{ cl.result_count }}">
|
||||
</el-pagination>
|
||||
{% endif %}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
new Vue({
|
||||
el: "#pagination",
|
||||
data: {},
|
||||
methods: {
|
||||
handleCurrentChange:function (page) {
|
||||
page_go(page-1);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function page_go(p) {
|
||||
$("#changelist-search input[name='p']").val(p);
|
||||
$("#changelist-search").submit();
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
{% load i18n static %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>{% trans 'Popup closing...' %}</title></head>
|
||||
<body>
|
||||
<script type="text/javascript"
|
||||
id="django-admin-popup-response-constants"
|
||||
src="{% static "admin/js/popup_response.js" %}"
|
||||
data-popup-response="{{ popup_response_data }}">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
{% load l10n static %}
|
||||
<script type="text/javascript"
|
||||
id="django-admin-prepopulated-fields-constants"
|
||||
src="{% static "admin/js/prepopulate_init.js" %}"
|
||||
data-prepopulated-fields="{{ prepopulated_fields_json }}">
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
{% load i18n static %}
|
||||
<div class="related-widget-wrapper">
|
||||
{{ widget }}
|
||||
{% block links %}
|
||||
{% spaceless %}
|
||||
{% if can_change_related %}
|
||||
<a class="related-widget-wrapper-link change-related" id="change_id_{{ name }}"
|
||||
data-href-template="{{ change_related_template_url }}?{{ url_params }}"
|
||||
title="{% blocktrans %}Change selected {{ model }}{% endblocktrans %}">
|
||||
<img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if can_add_related %}
|
||||
<a class="related-widget-wrapper-link add-related" id="add_id_{{ name }}"
|
||||
href="{{ add_related_url }}?{{ url_params }}"
|
||||
title="{% blocktrans %}Add another {{ model }}{% endblocktrans %}">
|
||||
<img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if can_delete_related %}
|
||||
<a class="related-widget-wrapper-link delete-related" id="delete_id_{{ name }}"
|
||||
data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
|
||||
title="{% blocktrans %}Delete selected {{ model }}{% endblocktrans %}">
|
||||
<img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
@@ -0,0 +1,245 @@
|
||||
{% load i18n static %}
|
||||
{% load simpletags %}
|
||||
{% if cl.search_fields or cl.has_filters %}
|
||||
<script type="text/javascript">
|
||||
function preSubmit() {
|
||||
$('#changelist-search').find("input[name!='']").each(function () {
|
||||
if ($(this).val() == '') {
|
||||
$(this).removeAttr('name');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% autoescape off %}
|
||||
{% load_dates %}
|
||||
{% endautoescape %}
|
||||
<!-- search_form.html -->
|
||||
<div id="toolbar">
|
||||
<form id="changelist-search" method="get" onsubmit="preSubmit(this)">
|
||||
<input type="hidden" name="p" value=""/>
|
||||
<div class="simpleui-form"><!-- DIV needed for valid HTML -->
|
||||
|
||||
{% if cl.search_fields %}
|
||||
|
||||
<el-input class="simpleui-form-item"
|
||||
clearable
|
||||
name="{{ search_var }}"
|
||||
:placeholder="placeholder"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput" @keyup.enter.native="formSubmit()">
|
||||
</el-input>
|
||||
{% endif %}
|
||||
|
||||
{% if cl.has_filters %}
|
||||
|
||||
{% for spec in cl.filter_specs %}
|
||||
{% if spec|get_date_type == 'date' or spec|get_date_type == 'datetime' %}
|
||||
|
||||
<el-date-picker class="simpleui-form-item"
|
||||
v-model="{{ spec.field_path }}"
|
||||
@change="change{{ spec|get_date_type|capfirst }}"
|
||||
type="{{ spec|get_date_type }}range"
|
||||
start-placeholder="{{ spec.title }}"
|
||||
end-placeholder="{{ spec.title }}">
|
||||
</el-date-picker>
|
||||
|
||||
<input type="hidden" v-model="{{ spec.field_generic }}gte"
|
||||
name="{{ spec.field_generic }}gte"/>
|
||||
<input type="hidden" v-model="{{ spec.field_generic }}lt"
|
||||
name="{{ spec.field_generic }}lt"/>
|
||||
|
||||
{% elif spec|has_filter %}
|
||||
<input type="hidden" v-model="{{ spec.parameter_name }}" name="{{ spec.parameter_name }}"/>
|
||||
<el-select class="simpleui-form-item" filterable v-model="{{ spec.parameter_name }}" clearable placeholder="{{ spec.title }}">
|
||||
{% for option in spec.lookup_choices %}
|
||||
<el-option label="{{ option.1 }}" value="{{ option.0 }}"></el-option>
|
||||
{% endfor %}
|
||||
</el-select>
|
||||
|
||||
{% else %}
|
||||
|
||||
<input type="hidden" v-model="{{ spec.lookup_kwarg }}" name="{{ spec.lookup_kwarg }}"/>
|
||||
<el-select class="simpleui-form-item" filterable v-model="{{ spec.lookup_kwarg }}" clearable
|
||||
placeholder="{{ spec.title }}">
|
||||
{% if spec|get_date_type == 'time' %}
|
||||
{% for option in spec.lookup_choices %}
|
||||
<el-option label="{{ option }}" value="{{ option|to_str }}"></el-option>
|
||||
{% endfor %}
|
||||
{% elif spec.lookup_choices %}
|
||||
{% if spec.lookup_choices.query %}
|
||||
{% for option in spec.lookup_choices %}
|
||||
<el-option label="{{ option }}" value="{{ option }}"></el-option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for option in spec.lookup_choices %}
|
||||
<el-option label="{{ option.1 }}" value="{{ option.0 }}"></el-option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% elif spec.field.choices %}
|
||||
{% for option in spec.field.choices %}
|
||||
<el-option label="{{ option.1 }}" value="{{ option.0 }}"></el-option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% get_boolean_choices as choices %}
|
||||
{% for c in choices %}
|
||||
<el-option label="{{ c.1 }}" value="{{ c.0 }}"></el-option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</el-select>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<el-button type="primary" icon="el-icon-search" @click="formSubmit()">{% trans 'Search' %}</el-button>
|
||||
|
||||
|
||||
{% if show_result_count %}
|
||||
<span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}</a>)</span>
|
||||
{% endif %}
|
||||
|
||||
{% for pair in cl.params.items %}
|
||||
{% if pair.0 != search_var %}
|
||||
{% if pair.0.0 == '_' or pair.0 == 'o'%}
|
||||
<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>
|
||||
{% else %}
|
||||
<input type="hidden" class="form-params" data-name="{{ pair.0 }}" value="{{ pair.1 }}"/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.getLanuage = function (key) {
|
||||
console.log(key)
|
||||
if (!window.Lanuages) {
|
||||
return "";
|
||||
}
|
||||
var val = Lanuages[key];
|
||||
if (!val || val == "") {
|
||||
val = key;
|
||||
}
|
||||
return val
|
||||
}
|
||||
Date.prototype.format = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"h+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt))
|
||||
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt))
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
}
|
||||
var searchApp = new Vue({
|
||||
el: '#toolbar',
|
||||
data: {
|
||||
placeholder: '{% trans 'Search' %}{% autoescape off %}{% search_placeholder %}'{% endautoescape %},
|
||||
searchInput: '{{ cl.query }}',
|
||||
{% if cl.has_filters %}
|
||||
{% for spec in cl.filter_specs %}
|
||||
{% if spec.links %}
|
||||
'{{ spec.field_path }}': '',
|
||||
'{{ spec.field_generic }}gte': '',
|
||||
'{{ spec.field_generic }}lt': '',
|
||||
{% elif spec|has_filter %}
|
||||
'{{ spec.parameter_name }}':'',
|
||||
{% else %}
|
||||
'{{ spec.lookup_kwarg }}': '',
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
},
|
||||
created: function () {
|
||||
var self = this;
|
||||
var date_field = [];
|
||||
{% if cl.has_filters %}
|
||||
{% for spec in cl.filter_specs %}
|
||||
{% if spec.links %}
|
||||
date_field.push('{{ spec.field_path }}')
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
$('.form-params').each(function () {
|
||||
var key = $(this).attr('data-name');
|
||||
var value = $(this).val();
|
||||
self[key] = value;
|
||||
});
|
||||
try {
|
||||
date_field.forEach(key => {
|
||||
var start = self[key + "__gte"];
|
||||
var end = self[key + "__lt"];
|
||||
self[key] = [start, end];
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn('日期值回显失败,也许是django版本问题,请至github报告此问题:https://github.com/newpanjing/simpleui/issues');
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
{% if cl.has_filters %}
|
||||
{% for spec in cl.filter_specs %}
|
||||
{% if spec.links %}
|
||||
'{{ spec.field_path }}': function (newValue, oldValue) {
|
||||
var type = '{{ spec | get_date_type }}'
|
||||
try {
|
||||
if (newValue) {
|
||||
if (newValue[0] != "" && newValue[1] != "") {
|
||||
|
||||
if (type == 'date') {
|
||||
this['{{ spec.field_generic }}gte'] = newValue[0].format('yyyy-MM-dd');
|
||||
this['{{ spec.field_generic }}lt'] = newValue[1].format('yyyy-MM-dd');
|
||||
} else if (type == 'datetime') {
|
||||
this['{{ spec.field_generic }}gte'] = newValue[0].format('yyyy-MM-dd hh:mm:ss{% get_tz_suffix %}');
|
||||
this['{{ spec.field_generic }}lt'] = newValue[1].format('yyyy-MM-dd hh:mm:ss{% get_tz_suffix %}');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (type == 'date') {
|
||||
this['{{ spec.field_generic }}gte'] = '';
|
||||
this['{{ spec.field_generic }}lt'] = '';
|
||||
} else if (type == 'datetime') {
|
||||
this['{{ spec.field_generic }}gte'] = '';
|
||||
this['{{ spec.field_generic }}lt'] = '';
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
{#console.log(newValue)#}
|
||||
{#console.log(oldValue)#}
|
||||
},
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
},
|
||||
methods: {
|
||||
|
||||
changeDate: function (d1, d2) {
|
||||
console.log(arguments)
|
||||
},
|
||||
changeDatetime: function (d1, d2) {
|
||||
console.log(arguments)
|
||||
},
|
||||
formSubmit: function () {
|
||||
preSubmit();
|
||||
document.getElementById('changelist-search').submit();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
{% else %}
|
||||
<form id="changelist-search" method="get">
|
||||
<input type="hidden" name="p" value=""/>
|
||||
</form>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,53 @@
|
||||
{% load i18n admin_urls simpletags%}
|
||||
<div class="submit-row">
|
||||
{% if '_popup' not in request.GET %}
|
||||
<el-button type="button" icon="el-icon-arrow-left" @click="prev()"
|
||||
style="float: left;margin-right: 10px;margin-bottom: 10px;">
|
||||
<span v-text="getLanuage('Go back')"></span>
|
||||
</el-button>
|
||||
{% endif %}
|
||||
{% if show_delete_link %}
|
||||
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
|
||||
<el-button icon="el-icon-delete" type="danger" @click="del('{% add_preserved_filters delete_url %}')"
|
||||
style="float: left">{% trans "Delete" %}</el-button>
|
||||
{% endif %}
|
||||
{% if show_save_as_new %}
|
||||
<el-button type="primary"
|
||||
@click="formSubmit('_saveasnew','{% trans 'Save as new' %}',$event)">{% trans 'Save as new' %}</el-button>
|
||||
{% endif %}
|
||||
{% if show_save_and_add_another %}
|
||||
<input type="submit" class="el-button el-button--primary" value="{% trans 'Save and add another' %}"
|
||||
name="_addanother">
|
||||
{% endif %}
|
||||
{% if show_save_and_continue %}
|
||||
|
||||
<input type="submit" class="el-button el-button--primary" value="{% trans 'Save and continue editing' %}"
|
||||
name="_continue">
|
||||
{% endif %}
|
||||
{% if show_save %}
|
||||
<input type="submit" class="el-button el-button--primary" value="{% trans 'Save' %}" name="_save">
|
||||
{% endif %}
|
||||
<input type="hidden" name="actionName" value="actionValue" id="actionName">
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var submitrows=document.getElementsByClassName('submit-row');
|
||||
for(var i=0;i<submitrows.length;i++){
|
||||
new Vue({
|
||||
el: submitrows[i],
|
||||
data: {},
|
||||
methods: {
|
||||
del: function (url) {
|
||||
window.location.href = url;
|
||||
},
|
||||
formSubmit: function (name, v, e) {
|
||||
$("#actionName").attr('name', name).val(v);
|
||||
$("form").submit();
|
||||
},
|
||||
prev: function () {
|
||||
window.location.href='{% get_model_url %}'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,21 @@
|
||||
{#{% extends "admin/base_site.html" %}#}
|
||||
{% load i18n %}
|
||||
{##}
|
||||
{#{% block breadcrumbs %}<div class="breadcrumbs"><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a></div>{% endblock %}#}
|
||||
{##}
|
||||
{#{% block content %}#}
|
||||
{##}
|
||||
{#<p>{% trans "Thanks for spending some quality time with the Web site today." %}</p>#}
|
||||
{##}
|
||||
{#<p><a href="{% url 'admin:index' %}">{% trans 'Log in again' %}</a></p>#}
|
||||
{##}
|
||||
{#{% endblock %}#}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;url={% url 'admin:login' %}">
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="{% url 'admin:index' %}">{% trans 'Log in again' %}</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}
|
||||
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} /
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>{% endblock %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password change' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
||||
{% block content %}
|
||||
<p>{% trans 'Your password was changed.' %}</p>
|
||||
<style type="text/css">
|
||||
#content {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,98 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n static %}
|
||||
{% block extrastyle %}{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}
|
||||
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}
|
||||
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} /
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>{% endblock %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password change' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content %}
|
||||
{% if request.GET.dialog == '1' %}
|
||||
<style type="text/css">
|
||||
body, #container{
|
||||
background: #FFF;
|
||||
}
|
||||
#content{
|
||||
box-shadow: none;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
<div id="content-main" class="form-main">
|
||||
<div>
|
||||
<el-alert
|
||||
title="{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}"
|
||||
type="success">
|
||||
</el-alert>
|
||||
|
||||
{% if form.errors %}
|
||||
{% if form.errors.items|length == 1 %}
|
||||
<el-alert
|
||||
title="{% trans "Please correct the error below." %}"
|
||||
type="error">
|
||||
</el-alert>
|
||||
{% else %}
|
||||
<el-alert
|
||||
title="{% trans "Please correct the errors below." %}"
|
||||
type="error">
|
||||
</el-alert>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<el-form ref="form" :model="form" label-width="100px" method="post" id="password_form">
|
||||
|
||||
{% csrf_token %}
|
||||
<el-form-item label="{% trans 'Old password' %}">
|
||||
<el-input v-model="form.oldPassword" name="old_password" show-password></el-input>
|
||||
{{ form.old_password.errors }}
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="{% trans 'New password' %}">
|
||||
<el-input v-model="form.newPassword1" name="new_password1" show-password></el-input>
|
||||
{{ form.new_password1.errors }}
|
||||
{% if form.new_password1.help_text %}
|
||||
<div class="help">{{ form.new_password1.help_text|safe }}</div>
|
||||
{% endif %}
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="{% trans 'Confirm password:' %}">
|
||||
<el-input v-model="form.newPassword2" name="new_password2" show-password></el-input>
|
||||
{{ form.new_password2.errors }}
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="formSubmit()"
|
||||
style="float: right;"
|
||||
icon="el-icon-edit-outline">{% trans 'Change my password' %}</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
new Vue({
|
||||
el: '#content-main',
|
||||
data: {
|
||||
form: {
|
||||
oldPassword: '',
|
||||
new_password1: '',
|
||||
new_password2: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formSubmit: function () {
|
||||
document.getElementById('password_form').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password reset' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
|
||||
|
||||
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n static %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password reset confirmation' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{% if validlink %}
|
||||
|
||||
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||
|
||||
<form method="post">{% csrf_token %}
|
||||
<fieldset class="module aligned">
|
||||
<div class="form-row field-password1">
|
||||
{{ form.new_password1.errors }}
|
||||
<label for="id_new_password1">{% trans 'New password:' %}</label>
|
||||
{{ form.new_password1 }}
|
||||
</div>
|
||||
<div class="form-row field-password2">
|
||||
{{ form.new_password2.errors }}
|
||||
<label for="id_new_password2">{% trans 'Confirm password:' %}</label>
|
||||
{{ form.new_password2 }}
|
||||
</div>
|
||||
<input type="submit" value="{% trans 'Change my password' %}">
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
|
||||
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password reset' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p>
|
||||
|
||||
<p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}</p>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{% load i18n %}{% autoescape off %}
|
||||
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
|
||||
|
||||
{% trans "Please go to the following page and choose a new password:" %}
|
||||
{% block reset_link %}
|
||||
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||
{% endblock %}
|
||||
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
|
||||
|
||||
{% trans "Thanks for using our site!" %}
|
||||
|
||||
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
|
||||
|
||||
{% endautoescape %}
|
||||
@@ -0,0 +1,29 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n static %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Password reset' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<p>{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}</p>
|
||||
|
||||
<form method="post">{% csrf_token %}
|
||||
<fieldset class="module aligned">
|
||||
<div class="form-row field-email">
|
||||
{{ form.email.errors }}
|
||||
<label for="id_email">{% trans 'Email address:' %}</label>
|
||||
{{ form.email }}
|
||||
</div>
|
||||
<input type="submit" value="{% trans 'Reset my password' %}">
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user