HCG1 installation
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<link rel="stylesheet" href="{% static 'layer/theme/default/layer.css' %}">
|
||||
<script src="{% static 'jquery/jquery-2.1.3.min.js' %}"></script>
|
||||
|
||||
{% block css %} {% endblock %}
|
||||
</head>
|
||||
{% block js %}{% endblock %}
|
||||
<body style="background: white">
|
||||
{% block main %} {% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "popup/base.html" %}
|
||||
{% block css %}
|
||||
{% load static %}
|
||||
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="{% static 'layui/layui.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="layui-container" style="margin: 4px">
|
||||
<form class="layui-form" enctype="multipart/form-data"
|
||||
action="{{ request.path }}{% if to_field %}?to_field={{ to_field }}{% endif %}"
|
||||
method="post">
|
||||
{% include 'post/form.html' %}
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn">新增</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends "popup/base.html" %}
|
||||
|
||||
{% block main %}
|
||||
<script>
|
||||
var to_field = '#{{ to_field }}', op = '{{ op }}', id = '{{ id }}', value = '{{ value }}';
|
||||
if (to_field) {
|
||||
switch (op) {
|
||||
case 'create':
|
||||
if (id) {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
$option = '<option value=' + id + ' selected>' + value + '</option>';
|
||||
$(to_field, window.parent.document).append($option);
|
||||
$(to_field + '_change,' + to_field + '_delete', window.parent.document).removeClass('layui-btn-disabled');
|
||||
}
|
||||
break;
|
||||
case 'update':
|
||||
if (id) {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
$(to_field + ' option[value=' + id + ']', window.parent.document).html(value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user