This commit is contained in:
baoliang 2020-09-18 14:03:55 +08:00
commit 3f5928a9cf
62 changed files with 4812 additions and 3391 deletions

View File

@ -47,6 +47,7 @@ INSTALLED_APPS = [
'monitor', 'monitor',
'polls', 'polls',
'django_summernote', 'django_summernote',
'graph',
] ]
MIDDLEWARE = [ MIDDLEWARE = [

View File

@ -17,14 +17,21 @@ from django.contrib import admin
from django.urls import path, re_path, include from django.urls import path, re_path, include
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
# from wagtail.admin import urls as wagtailadmin_urls
# from wagtail.documents import urls as wagtaildocs_urls
# from wagtail.core import urls as wagtail_urls
urlpatterns = [ urlpatterns = [
path('polls/', include('polls.urls')), path('polls/', include('polls.urls')),
# re_path(r'^cms/', include(wagtailadmin_urls)),
# re_path(r'^documents/', include(wagtaildocs_urls)),
# re_path(r'^pages/', include(wagtail_urls)),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('', include('dashboard.urls')), path('', include('dashboard.urls')),
path('captcha/', include('captcha.urls')), path('captcha/', include('captcha.urls')),
path('management/', include('management.urls')), path('management/', include('management.urls')),
path('monitor/', include('monitor.urls')), path('monitor/', include('monitor.urls')),
path('summernote/', include('django_summernote.urls')), path('summernote/', include('django_summernote.urls')),
path('graph/', include('graph.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -1,5 +1,4 @@
import uuid import uuid
from django_summernote.fields import SummernoteTextField
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db import models from django.db import models
@ -15,19 +14,19 @@ class Level(models.Model):
return self.name return self.name
class Group_type(models.Model): class Group_type(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
type = models.CharField('群组类型', max_length=256, null=True, blank=True) type = models.CharField('矩阵类型', max_length=256, null=True, blank=True)
def __str__(self): def __str__(self):
return self.type return self.type
# 群组 # 矩阵
class Group(models.Model): class Group(models.Model):
GROUP_STATUS_CHOICES = ( GROUP_STATUS_CHOICES = (
('0', '关闭'), ('0', '关闭'),
('1', '开启') ('1', '开启')
) )
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('群组名称', max_length=256, null=True, blank=True) name = models.CharField('矩阵名称', max_length=256, null=True, blank=True)
presentation = models.TextField('群组描述', null=True, blank=True) presentation = models.TextField('矩阵描述', null=True, blank=True)
image = models.FileField(upload_to='groupimage', null=True, blank=True) image = models.FileField(upload_to='groupimage', null=True, blank=True)
type = models.ForeignKey( type = models.ForeignKey(
Group_type, on_delete=models.CASCADE, null=True, blank=True) Group_type, on_delete=models.CASCADE, null=True, blank=True)
@ -38,6 +37,7 @@ class Group(models.Model):
district = models.CharField('', max_length=256, null=True, blank=True) district = models.CharField('', max_length=256, null=True, blank=True)
town = models.CharField('', max_length=256, null=True, blank=True) town = models.CharField('', max_length=256, null=True, blank=True)
village = models.CharField('', max_length=256, null=True, blank=True) village = models.CharField('', max_length=256, null=True, blank=True)
user = models.ForeignKey(User,on_delete=models.CASCADE,blank=True,null=True)
created = models.DateTimeField('创建时间', auto_now_add=True) created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True) updated = models.DateTimeField('更新时间', auto_now=True)
@ -45,7 +45,7 @@ class Group(models.Model):
def __str__(self): def __str__(self):
return self.name return self.name
# 群组管理员 # 矩阵管理员
class Group_admin(models.Model): class Group_admin(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey( user = models.ForeignKey(
@ -57,7 +57,7 @@ class Group_admin(models.Model):
def __str__(self): def __str__(self):
return self.group.name return self.group.name
# 群组成员 # 矩阵成员
class Group_user(models.Model): class Group_user(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey( user = models.ForeignKey(
@ -94,8 +94,8 @@ class Organization(models.Model):
district = models.CharField('', max_length=256, null=True, blank=True) district = models.CharField('', max_length=256, null=True, blank=True)
town = models.CharField('', max_length=256, null=True, blank=True) town = models.CharField('', max_length=256, null=True, blank=True)
village = models.CharField('', max_length=256, null=True, blank=True) village = models.CharField('', max_length=256, null=True, blank=True)
# group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True) level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True)
# level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True) directly = models.CharField('直属',max_length=256,null=True,blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True) created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True) updated = models.DateTimeField('更新时间', auto_now=True)
@ -171,7 +171,7 @@ class Weixin_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
title = models.CharField('文章标题', max_length=256, null=True, blank=True) title = models.CharField('文章标题', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True) site = models.CharField('位置', max_length=256, null=True, blank=True)
date = models.CharField('发文时间', max_length=256, null=True, blank=True) date = models.DateField('发文时间', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True) original = models.BooleanField('是否原创', null=True, blank=True)
url = models.CharField('文章链接', max_length=256, null=True, blank=True) url = models.CharField('文章链接', max_length=256, null=True, blank=True)
author = models.CharField('作者', max_length=256, null=True, blank=True) author = models.CharField('作者', max_length=256, null=True, blank=True)
@ -235,7 +235,7 @@ class Weibo_data(models.Model):
'转发图片url', max_length=256, null=True, blank=True) '转发图片url', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True) original = models.BooleanField('是否原创', null=True, blank=True)
site = models.CharField('发布位置', max_length=256, null=True, blank=True) site = models.CharField('发布位置', max_length=256, null=True, blank=True)
date = models.CharField('发布时间', max_length=256, null=True, blank=True) date = models.DateField('发布时间', max_length=256, null=True, blank=True)
tool = models.CharField('发布工具', max_length=256, null=True, blank=True) tool = models.CharField('发布工具', max_length=256, null=True, blank=True)
like = models.CharField('点赞数', max_length=256, null=True, blank=True) like = models.CharField('点赞数', max_length=256, null=True, blank=True)
transpond = models.CharField('转发数', max_length=256, null=True, blank=True) transpond = models.CharField('转发数', max_length=256, null=True, blank=True)
@ -278,7 +278,7 @@ class Toutiao_data(models.Model):
commentcount = models.CharField( commentcount = models.CharField(
'评论数', max_length=256, null=True, blank=True) '评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('时间', max_length=256, null=True, blank=True) date = models.DateField('时间', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True) content = models.TextField('正文', null=True, blank=True)
comment = models.TextField('评论', null=True, blank=True) comment = models.TextField('评论', null=True, blank=True)
toutiao = models.ForeignKey( toutiao = models.ForeignKey(
@ -335,7 +335,7 @@ class Douyin_data(models.Model):
'监测时间内发文量', max_length=256, null=True, blank=True) '监测时间内发文量', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True) comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('最近发文日期', max_length=256, null=True, blank=True) date = models.DateField('最近发文日期', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True) created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True) updated = models.DateTimeField('更新时间', auto_now=True)
@ -361,7 +361,7 @@ class Qita_jc(models.Model):
'监测时间内发文量', max_length=256, null=True, blank=True) '监测时间内发文量', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True) comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('最近发文日期', max_length=256, null=True, blank=True) date = models.DateField('最近发文日期', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True) created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True) updated = models.DateTimeField('更新时间', auto_now=True)
@ -391,11 +391,12 @@ class News(models.Model):
) )
id = models.UUIDField('id',primary_key=True,default=uuid.uuid4) id = models.UUIDField('id',primary_key=True,default=uuid.uuid4)
type = models.CharField('文章类型',max_length=256,null=True,blank=True,choices=NEWMEDIA_NEWS_CHOICES) type = models.CharField('文章类型',max_length=256,null=True,blank=True,choices=NEWMEDIA_NEWS_CHOICES)
source = models.CharField('文章来源',max_length=256,null=True,blank=True)
title = models.CharField('文章标题',max_length=256,null=True,blank=True) title = models.CharField('文章标题',max_length=256,null=True,blank=True)
image = models.FileField( image = models.FileField(
upload_to='news/%Y/%m/%d/', null=True, blank=True) upload_to='news/%Y/%m/%d/', null=True, blank=True)
author = models.CharField('作者',max_length=256,null=True,blank=True) author = models.CharField('作者',max_length=256,null=True,blank=True)
date = models.CharField('发表日期',null=True,blank=True,max_length=256) date = models.DateField('发表日期',null=True,blank=True,max_length=256)
content = models.TextField('内容',null=True,blank=True) content = models.TextField('内容',null=True,blank=True)
def __str__(self): def __str__(self):

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -35,7 +35,7 @@
<span class="title">新媒体舆情</span> <span class="title">新媒体舆情</span>
</a> </a>
</li> </li>
{# <li class="open">#} {# <li class="open">#}
<li class=""> <li class="">
<a href="javascript:;"> <a href="javascript:;">
<i class="fa fa-map-marker"></i> <i class="fa fa-map-marker"></i>
@ -69,6 +69,12 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="">
<a href="">
<i class="fa fa-th"></i>
<span class="title">评论互动监测</span>
</a>
</li>
<li class=""> <li class="">
<a href="javascript:;"> <a href="javascript:;">
<i class="fa fa-suitcase"></i> <i class="fa fa-suitcase"></i>
@ -84,15 +90,15 @@
<li class=""> <li class="">
<a href="javascript:;"> <a href="javascript:;">
<i class="fa fa-sliders"></i> <i class="fa fa-sliders"></i>
<span class="title">群组管理</span> <span class="title">矩阵管理</span>
<span class="arrow "></span> <span class="arrow "></span>
</a> </a>
<ul class="sub-menu"> <ul class="sub-menu">
<li> <li>
<a class="" href="{% url 'group-management-create' %}">新建群组</a> <a class="" href="{% url 'group-management-create' %}">新建矩阵</a>
</li> </li>
<li> <li>
<a class="" href="{% url 'group-management-management' %}">编辑群组</a> <a class="" href="{% url 'group-management-management-init' %}">编辑矩阵</a>
</li> </li>
<li> <li>
<a class="" href="">搜索添加单位</a> <a class="" href="">搜索添加单位</a>
@ -125,10 +131,22 @@
<a class="" href="{% url 'organization-management-create' %}">新建单位</a> <a class="" href="{% url 'organization-management-create' %}">新建单位</a>
</li> </li>
<li> <li>
<a class="" href="">搜索添加用户</a> <a class="" href="{% url 'organization-management-management' %}">编辑单位</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-sliders"></i>
<span class="title">新闻管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'news-management-create' %}">发布新闻</a>
</li> </li>
<li> <li>
<a class="" href="{% url 'organization-management-management' %}">编辑单位</a> <a class="" href="{% url 'new-management' %}">新闻管理</a>
</li> </li>
</ul> </ul>
</li> </li>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<div id="pages" class="text-center">
<nav>
<ul class="pagination">
<li class="step-links">
{% if douyin.has_previous %}
<a class='active' href="?page={{ douyin.previous_page_number }}">上一页</a>
{% endif %}
<span class="current">
第{{ douyin.number }}页 共{{ douyin.paginator.num_pages }}页</span>
{% if toutiao.has_next %}
<a class='active' href="?page={{ douyin.next_page_number }}">下一页</a>
{% endif %}
</li>
</ul>
</nav>
</div>

View File

@ -1,188 +1,189 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block css %} {% block css %}
<style> <style>
body.login_page { body.login_page {
background-color: rgba(116, 77, 144, 1.0) background-color: rgba(116, 77, 144, 1.0)
/*#744d90*/; /*#744d90*/;
background-image: url('{% static 'image/login-bg.png' %}'); background-image: url('{% static 'image/login-bg.png' %}');
background-attachment: fixed; background-attachment: fixed;
height: 100%; height: 100%;
max-height: 100%; max-height: 100%;
min-height: 99%; min-height: 99%;
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
} }
.loginpage h1 a { .loginpage h1 a {
height: 92px; height: 92px;
margin: 0px auto 0px auto; margin: 0px auto 0px auto;
padding: 0; padding: 0;
text-decoration: none; text-decoration: none;
-moz-background-size: 345px 92px; -moz-background-size: 345px 92px;
-o-background-size: 345px 92px; -o-background-size: 345px 92px;
background-size: 345px 92px; background-size: 345px 92px;
background-color: transparent; background-color: transparent;
min-height: 92px; min-height: 92px;
width: auto; width: auto;
background-image: url("{% static 'image/login-logo.png' %}"); background-image: url("{% static 'image/login-logo.png' %}");
background-position: center top; background-position: center top;
background-repeat: no-repeat; background-repeat: no-repeat;
text-indent: -9999px; text-indent: -9999px;
outline: 0; outline: 0;
overflow: hidden; overflow: hidden;
display: block; display: block;
} }
</style> </style>
{% endblock %} {% endblock %}
{% block header %}{% endblock %} {% block header %}{% endblock %}
{% block content %} {% block content %}
<body class=" login_page"> <body class=" login_page">
<div class="register-wrapper"> <div class="register-wrapper">
{% if messages %} {% if messages %}
<div class="alert alert-danger alert-dismissible" role="alert"> <div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div id="register" <div id="register"
class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8"> class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8">
<h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1> <h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1>
<form name="loginform" id="loginform" action="{% url 'dashboard-register' %}" method="post" <form name="loginform" id="loginform" action="{% url 'dashboard-register' %}" method="post"
enctype="multipart/form-data">{% csrf_token %} enctype="multipart/form-data">{% csrf_token %}
<p> <p style="display: inline-block">
<label for="name">单位<br/> <label for="name">单位<br/>
<select class="form-control" name="organization"> <select class="form-control" name="organization">
{% for o in organization %} {% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option> <option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %} {% endfor %}
</select> </select>
</label> </label>
</p> </p>
<p> <a href="{% url 'organization-management-create' %}"><span class="glyphicon glyphicon-plus" aria-hidden="true" style="margin-left: 40px"></span></a>
<label for="name">姓名<br/> <p>
<input type="text" name="name" id="user_login" class="input" value="" size="20"/></label> <label for="name">姓名<br/>
</p> <input type="text" name="name" id="user_login" class="input" value="" size="20"/></label>
<p> </p>
<label for="sex">性别<br/> <p>
<label style="text-align: center"> <label for="sex">性别<br/>
<input type="radio" name="sex" id="inlineRadio1" value="1" checked="checked"> <label style="text-align: center">
<input type="radio" name="sex" id="inlineRadio2" value="2" style="margin-left: 50px"> <input type="radio" name="sex" id="inlineRadio1" value="1" checked="checked">
</label> <input type="radio" name="sex" id="inlineRadio2" value="2" style="margin-left: 50px">
</label> </label>
</p> </label>
</p>
<p>
<label for="email">邮箱<br/> <p>
<input type="text" name="email" id="user_login" class="input" value="" size="20"/></label> <label for="email">邮箱<br/>
</p> <input type="text" name="email" id="user_login" class="input" value="" size="20"/></label>
<p> </p>
<label for="phone">电话<br/> <p>
<input type="text" name="username" id="user_login" class="input" value="" size="20"/></label> <label for="phone">电话<br/>
</p> <input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>
{# <p>#} </p>
{# <label for="username">用户名<br/>#} {# <p>#}
{# <input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>#} {# <label for="username">用户名<br/>#}
{# </p>#} {# <input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>#}
<p> {# </p>#}
<label for="password">密码<br/> <p>
<input type="password" name="password" id="user_pass" class="input" value="" size="20"/></label> <label for="password">密码<br/>
</p> <input type="password" name="password" id="user_pass" class="input" value="" size="20"/></label>
<p> </p>
<label for="confirm_password">确认密码<br/> <p>
<input type="password" name="confirm_password" id="user_pass1" class="input" value="" <label for="confirm_password">确认密码<br/>
size="20"/></label> <input type="password" name="confirm_password" id="user_pass1" class="input" value=""
</p> size="20"/></label>
<p> </p>
<label for="image">头像<br/> <p>
<input type="file" id="exampleInputFile" name="image"></label> <label for="image">头像<br/>
</p> <input type="file" id="exampleInputFile" name="image"></label>
<p class="div_index_yan"> </p>
<span> <p class="div_index_yan">
<a href="#" class="next-captcha"> <span>
<img src="{{ image_url }}" class="captcha" alt="captcha"> <a href="#" class="next-captcha">
</a> <img src="{{ image_url }}" class="captcha" alt="captcha">
</span> </a>
<input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}"> </span>
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码"> <input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}">
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码">
</p>
<p class="forgetmenot"> </p>
<label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox" <p class="forgetmenot">
id="rememberme" value="forever" <label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox"
class="skin-square-orange" checked> I id="rememberme" value="forever"
agree to terms to conditions</label> class="skin-square-orange" checked> I
</p> agree to terms to conditions</label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block" <p class="submit">
value="注册"/> <input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block"
</p> value="注册"/>
</form> </p>
</form>
<p id="nav">
<a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a> <p id="nav">
<a class="pull-right" href="{% url 'dashboard-login' %}" title="Sign Up">登录</a> <a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a>
</p> <a class="pull-right" href="{% url 'dashboard-login' %}" title="Sign Up">登录</a>
<div class="clearfix"></div> </p>
<div class="clearfix"></div>
</div>
</div> </div>
<!-- General section box modal start --> </div>
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label" <!-- General section box modal start -->
aria-hidden="true"> <div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label"
<div class="modal-dialog animated bounceInDown"> aria-hidden="true">
<div class="modal-content"> <div class="modal-dialog animated bounceInDown">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <div class="modal-header">
<h4 class="modal-title">Section Settings</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div> <h4 class="modal-title">Section Settings</h4>
<div class="modal-body"> </div>
<div class="modal-body">
Body goes here...
Body goes here...
</div>
<div class="modal-footer"> </div>
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button> <div class="modal-footer">
<button class="btn btn-success" type="button">Save changes</button> <button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
</div> <button class="btn btn-success" type="button">Save changes</button>
</div> </div>
</div> </div>
</div> </div>
<!-- modal end --> </div>
</body> <!-- modal end -->
{% endblock %} </body>
{% block add_js %} {% endblock %}
<script> {% block add_js %}
$(function () { <script>
$(".next-captcha").click(function (e) { $(function () {
e.preventDefault(); $(".next-captcha").click(function (e) {
$.getJSON("{% url 'refresh-captcha' %}", function (json) { e.preventDefault();
// This should update your captcha image src and captcha hidden input $.getJSON("{% url 'refresh-captcha' %}", function (json) {
// debugger; // This should update your captcha image src and captcha hidden input
var status = json['status']; // debugger;
console.log(status); var status = json['status'];
console.log("6666666666666666666666666666666"); console.log(status);
var new_cptch_key = json['new_cptch_key']; console.log("6666666666666666666666666666666");
var new_cptch_image = json['new_cptch_image']; var new_cptch_key = json['new_cptch_key'];
id_captcha_0 = $("#id_reg_captcha_0"); var new_cptch_image = json['new_cptch_image'];
img = $(".captcha"); id_captcha_0 = $("#id_reg_captcha_0");
id_captcha_0.attr("value", new_cptch_key); img = $(".captcha");
img.attr("src", new_cptch_image); id_captcha_0.attr("value", new_cptch_key);
}); img.attr("src", new_cptch_image);
});
});
}) });
</script> })
{% endblock %} </script>
{% endblock %}

View File

@ -17,5 +17,5 @@ urlpatterns = [
path('get/district/',views.get_district), path('get/district/',views.get_district),
path('get/town/',views.get_town), path('get/town/',views.get_town),
path('get/village/',views.get_village), path('get/village/',views.get_village),
path('add/news/',views.add_news,name='add-news'),
] ]

View File

@ -1,5 +1,6 @@
from captcha.helpers import captcha_image_url from captcha.helpers import captcha_image_url
from captcha.models import CaptchaStore from captcha.models import CaptchaStore
from dateutil import relativedelta
from django.contrib import messages from django.contrib import messages
from django.contrib.auth import logout, authenticate, login from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -8,9 +9,8 @@ from django.http import HttpResponseRedirect, JsonResponse
from django.shortcuts import render from django.shortcuts import render
import datetime import datetime
# Create your views here. # Create your views here.
from dashboard.models import Userprofile, Organization, Area_code_2020, Weixin, Weibo, Toutiao, Qita, News from dashboard.models import Userprofile, Organization, Area_code_2020, Weixin, Weibo, Toutiao, Qita, News, Douyin
def refresh_captcha(request): def refresh_captcha(request):
@ -19,12 +19,23 @@ def refresh_captcha(request):
to_json_response['new_cptch_key'] = CaptchaStore.generate_key() to_json_response['new_cptch_key'] = CaptchaStore.generate_key()
to_json_response['new_cptch_image'] = captcha_image_url(to_json_response['new_cptch_key']) to_json_response['new_cptch_image'] = captcha_image_url(to_json_response['new_cptch_key'])
return JsonResponse(to_json_response) return JsonResponse(to_json_response)
def index(request): def index(request):
weixin_count = Weixin.objects.all().count() weixin_count = Weixin.objects.all().count()
weibo_count = Weibo.objects.all().count() weibo_count = Weibo.objects.all().count()
toutiao_count = Toutiao.objects.all().count() toutiao_count = Toutiao.objects.all().count()
qita_count = Qita.objects.all().count() qita_count = Qita.objects.all().count()
return render(request,'dashboard/index.html',{'weixin_count':weixin_count,'weibo_count':weibo_count,'toutiao_count':toutiao_count,'qita_count':qita_count}) douyin_count = Douyin.objects.all().count()
organization_count = Organization.objects.all().count()
year = datetime.datetime.now().year
month_from = datetime.datetime.now().month
month_to = int(month_from)-1
return render(request, 'dashboard/index.html',
{'weixin_count': weixin_count, 'weibo_count': weibo_count, 'toutiao_count': toutiao_count,
'qita_count': qita_count, 'douyin_count': douyin_count, 'organization_count': organization_count,'year':year,'month_from':month_from,'month_to':month_to})
def user_login(request): def user_login(request):
username = None username = None
password = None password = None
@ -48,7 +59,7 @@ def user_login(request):
except CaptchaStore.DoesNotExist: except CaptchaStore.DoesNotExist:
messages.error(request, '验证码错误') messages.error(request, '验证码错误')
return HttpResponseRedirect('/login/') return HttpResponseRedirect('/login/')
print(username,password) print(username, password)
if username is not None and password is not None: if username is not None and password is not None:
try: try:
user = authenticate(username=username, password=password) user = authenticate(username=username, password=password)
@ -63,10 +74,14 @@ def user_login(request):
messages.error(request, '账号或密码错误,请您确认账号和密码') messages.error(request, '账号或密码错误,请您确认账号和密码')
except: except:
messages.error(request, '账号或密码错误,请您确认账号和密码') messages.error(request, '账号或密码错误,请您确认账号和密码')
return render(request,'dashboard/login.html',{'hash_key':hash_key,'image_url':image_url}) return render(request, 'dashboard/login.html', {'hash_key': hash_key, 'image_url': image_url})
def user_logout(request): def user_logout(request):
logout(request) logout(request)
return HttpResponseRedirect('/') return HttpResponseRedirect('/')
def register(request): def register(request):
username = None username = None
email = None email = None
@ -115,7 +130,7 @@ def register(request):
messages.error(request, '请选择头像') messages.error(request, '请选择头像')
else: else:
image = request.FILES.get('image') image = request.FILES.get('image')
print(str(image)+"1111111111111111111111111111111111111111111") print(str(image) + "1111111111111111111111111111111111111111111")
if request.POST.get('sex') == '1': if request.POST.get('sex') == '1':
sex = '' sex = ''
elif request.POST.get('sex') == '2': elif request.POST.get('sex') == '2':
@ -141,41 +156,49 @@ def register(request):
return HttpResponseRedirect('/register/') return HttpResponseRedirect('/register/')
if username is not None and password is not None and confirm_password is not None and email is not None and flag: if username is not None and password is not None and confirm_password is not None and email is not None and flag:
user = User.objects.create_user(username,email,password) user = User.objects.create_user(username, email, password)
user.is_active = True user.is_active = True
# user.is_staff = True # user.is_staff = True
# user.first_name = phone # user.first_name = phone
user.save() user.save()
userprofile = Userprofile(name=name,image=image,user_id=user.id,organization_id=o,sex=sex,status=0) userprofile = Userprofile(name=name, image=image, user_id=user.id, organization_id=o, sex=sex, status=0)
userprofile.save() userprofile.save()
messages.success(request, '注册成功,请登录') messages.success(request, '注册成功,请登录')
return HttpResponseRedirect('/login/') return HttpResponseRedirect('/login/')
return render(request, 'dashboard/register.html', {'hash_key': hash_key, 'image_url': image_url,'organization':organization}) return render(request, 'dashboard/register.html',
{'hash_key': hash_key, 'image_url': image_url, 'organization': organization})
def get_province(request): def get_province(request):
# #
province = Area_code_2020.objects.filter(level=1) province = Area_code_2020.objects.filter(level=1)
res = [] res = []
for i in province: for i in province:
res.append([i.code,i.name,i.level,i.pcode]) res.append([i.code, i.name, i.level, i.pcode])
return JsonResponse({"province":res}) return JsonResponse({"province": res})
def get_city(request): def get_city(request):
code = request.GET.get('code') code = request.GET.get('code')
print(code) print(code)
# #
cities = Area_code_2020.objects.filter(pcode=code) cities = Area_code_2020.objects.filter(pcode=code)
res = [] res = []
for i in cities: for i in cities:
res.append([i.code,i.name,i.level,i.pcode]) res.append([i.code, i.name, i.level, i.pcode])
return JsonResponse({"city": res}) return JsonResponse({"city": res})
def get_district(request): def get_district(request):
code = request.GET.get('code') code = request.GET.get('code')
# #
district = Area_code_2020.objects.filter(pcode=code) district = Area_code_2020.objects.filter(pcode=code)
res = [] res = []
for i in district: for i in district:
res.append([i.code, i.name, i.level, i.pcode]) res.append([i.code, i.name, i.level, i.pcode])
return JsonResponse({"district": res}) return JsonResponse({"district": res})
def get_town(request): def get_town(request):
code = request.GET.get('code') code = request.GET.get('code')
# 乡 # 乡
@ -184,6 +207,8 @@ def get_town(request):
for i in town: for i in town:
res.append([i.code, i.name, i.level, i.pcode]) res.append([i.code, i.name, i.level, i.pcode])
return JsonResponse({"town": res}) return JsonResponse({"town": res})
def get_village(request): def get_village(request):
code = request.GET.get('code') code = request.GET.get('code')
# 村 # 村
@ -192,24 +217,6 @@ def get_village(request):
for i in village: for i in village:
res.append([i.code, i.name, i.level, i.pcode]) res.append([i.code, i.name, i.level, i.pcode])
return JsonResponse({"village": res}) return JsonResponse({"village": res})
def add_news(request):
if request.method == 'POST':
type = request.POST.get('type')
title = request.POST.get('title')
author = request.POST.get('author')
date = request.POST.get('date')
content = request.POST.get('content')
print(str(title), str(content))
news = News(type = type,title=title, author=author, date=date, content=content)
news.save()
messages.success(request, '添加成功!!!')
return HttpResponseRedirect('/add/news/')
type = News.NEWMEDIA_NEWS_CHOICES
results = []
for i in type:
o = dict()
o['choices'] = list(i)[0]
results.append(o)
return render(request,'dashboard/add_news.html',{'type':results})

0
graph/__init__.py Normal file
View File

3
graph/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
graph/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class GraphConfig(AppConfig):
name = 'graph'

3
graph/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,41 @@
function initChart (element,year,month_from,month_to) {
var dataCount = echarts.init(document.getElementById(element));
var dataCountOption = {
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '直接访问',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
};
dataCount.setOption(dataCountOption)
}

22
graph/static/graph/js/echarts.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
graph/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

8
graph/urls.py Normal file
View File

@ -0,0 +1,8 @@
from django.contrib import admin
from django.urls import path
from dashboard import views
urlpatterns = [
]

9
graph/views.py Normal file
View File

@ -0,0 +1,9 @@
import datetime
from django.shortcuts import render
# Create your views here.
def index_data_count_chart(request):
pass

View File

@ -2727,7 +2727,7 @@
if (this.options.connect && this.connect.length) { if (this.options.connect && this.connect.length) {
this.index = this.find(this.options.toggle).index(active); this.index = this.find(this.options.toggle).data(active);
if (this.index == -1 ) { if (this.index == -1 ) {
this.index = 0; this.index = 0;
@ -2781,7 +2781,7 @@
var anim = ['@-animation-slide-top', '@-animation-slide-bottom']; var anim = ['@-animation-slide-top', '@-animation-slide-bottom'];
if (current && current.index() > next.index()) { if (current && current.data() > next.data()) {
anim.reverse(); anim.reverse();
} }
@ -2800,7 +2800,7 @@
var anim = ['@-animation-slide-left', '@-animation-slide-right']; var anim = ['@-animation-slide-left', '@-animation-slide-right'];
if (current && current.index() > next.index()) { if (current && current.data() > next.data()) {
anim.reverse(); anim.reverse();
} }
@ -2928,7 +2928,7 @@
var link = $(this); var link = $(this);
$this.element.children(':not(.@-tab-responsive)').eq(link.data('index')).trigger('click'); $this.element.children(':not(.@-tab-responsive)').eq(link.data('data-count.js')).trigger('click');
}); });
this.on('show.uk.switcher change.uk.tab', function(e, tab) { this.on('show.uk.switcher change.uk.tab', function(e, tab) {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,196 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<!-- START TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">编辑矩阵</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">矩阵信息表单</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-8 col-sm-9 col-xs-10">
<form method="post"
action="{% url 'group-management-update' group.id %}" enctype="multipart/form-data">{% csrf_token %}
<div class="form-group">
<label class="form-label" for="name">矩阵名称</label>
<div class="controls">
<input type="text" class="form-control" name="name"
value="{{ group.name }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="presentation">矩阵介绍</label>
<div class="controls">
<input type="text" class="form-control"
name="presentation" value="{{ group.presentation }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="image">图标
<div class="controls">
<input type="file" name="image"><img
src="{{ group.image.url }}"
style="width: 80px;height: 80px;"
class="img-circle">
</div>
</label>
</div>
<div class="form-group">
<label class="form-label" for="type">矩阵类型</label>
<div class="controls">
<select class="form-control" name="type">
<option value="{{ group.type.id }}">{{ group.type }}</option>
{% for g in group_type %}
<option value="{{ g.id }}">{{ g.type }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="status">矩阵状态</label>
<div class="controls">
<select class="form-control" name="status">
<option value="{{ group.status }}">{{ group.status }}</option>
{% for g in group_status_choices_list %}
<option value="{{ g }}">{{ g }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="administrativedivision">行政区划</label>
<div class="controls">
<select id="province" name="province">
<option value="{{ group.province }}">{{ group.province }}</option>
</select>
<select id="city" name="city" style="margin-left: 20px">
<option value="{{ group.cities }}">{{ group.cities }}</option>
</select>
<select id="district" name="district" style="margin-left: 20px">
<option value="{{ group.district }}">{{ group.district }}</option>
</select>
<select id="town" name="town" style="margin-left: 20px">
<option value="{{ group.town }}">{{ group.town }}</option>
</select>
<select id="village" name="village" style="margin-left: 20px">
<option value="{{ group.village }}">{{ group.village }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="stauts">管理员</label>
<div class="controls" style="margin-left: 5%">
<a href="{% url 'group-admin-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加管理员</span></a>
<table class="table table-hover" style="margin-top: 20px">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">单位名称</th>
<th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for g_a in g_a_list %}
<tr>
<td style="vertical-align: middle;text-align: center"><img
src="{{ g_a.image }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ g_a.username }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'group-admin-delete' g_a.id group.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="form-label" for="stauts">成员</label>
<div class="controls" style="margin-left: 5%">
<a href="{% url 'group-user-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加成员</span></a>
<table class="table table-hover" style="margin-top: 20px">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">单位名称</th>
<th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for g_u in g_u_list %}
<tr>
<td style="vertical-align: middle;text-align: center"><img
src="{{ g_u.image }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ g_u.username }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'group-user-delete' g_u.id group.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<button type="submit" class="btn btn-success">提交</button>
</form>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows "></div>
</div>
</body>
{% endblock %}

View File

@ -1,74 +1,74 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">添加群组管理员</h1></div> <h1 class="title">添加矩阵管理员</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">群组管理员表单</h2> <h2 class="title pull-left">矩阵管理员表单</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'group-admin-create' pk %}" enctype="multipart/form-data">{% csrf_token %} action="{% url 'group-admin-create' pk %}" enctype="multipart/form-data">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">群组名称</label> <label class="form-label" for="name">矩阵名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name" disabled value="{{ group }}"> <input type="text" class="form-control" name="name" disabled value="{{ group }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="user">管理员</label> <label class="form-label" for="user">管理员</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="user"> <select class="form-control" name="user">
{% for u in usee %} {% for u in usee %}
<option value="{{ u.id }}">{{ u.username }}</option> <option value="{{ u.id }}">{{ u.username }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success">点击创建</button> <button type="submit" class="btn btn-success">点击创建</button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</section> </section>
</section> </section>
<div class="chatapi-windows "></div> <div class="chatapi-windows "></div>
</div> </div>
</body> </body>
{% endblock %} {% endblock %}

View File

@ -1,99 +1,104 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block css %} {% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<body class=" "><!-- START TOPBAR --> <body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">群组管理</h1></div> <h1 class="title">矩阵管理</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12"> <div class="col-lg-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">群组列表</h2> {# <h2 class="title pull-left">矩阵列表</h2>#}
</header> <ul class="nav nav-pills">
<div class="content-body"> <li role="presentation"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<div class="row"> <li role="presentation" class="active"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<div class="col-md-12 col-sm-12 col-xs-12"> <li role="presentation"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<table class="table table-hover"> </ul>
<thead> </header>
<tr> <div class="content-body">
<th style="text-align: center">头像</th> <div class="row">
<th style="text-align: center">群组名称</th> <div class="col-md-12 col-sm-12 col-xs-12">
<th style="text-align: center">群组类型</th> <table class="table table-hover">
<th style="text-align: center">管理员个数</th> <thead>
<th style="text-align: center">成员个数</th> <tr>
<th style="text-align: center">状态</th> <th style="text-align: center">头像</th>
<th style="text-align: center">操作</th> <th style="text-align: center">矩阵名称</th>
</tr> <th style="text-align: center">矩阵类型</th>
</thead> <th style="text-align: center">管理员个数</th>
<tbody> <th style="text-align: center">成员个数</th>
{% for r in res %} <th style="text-align: center">状态</th>
<tr> <th style="text-align: center">操作</th>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;" </tr>
class="img-circle"></td> </thead>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td> <tbody>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td> {% for r in res_g_a %}
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td> <tr>
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td> <td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
<td style="vertical-align: middle;text-align: center">{{ r.status }}</td> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<a href="{% url 'group-management-update' r.id %}" <td style="vertical-align: middle;text-align: center">{{ r.type }}</td>
class="btn btn-primary btn-mini">编辑</a> <td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
<a href="{% url 'group-management-delete' r.id %}" <td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
class="btn btn-danger btn-mini">删除</a> <td style="vertical-align: middle;text-align: center">{{ r.status }}</td>
</td> <td style="vertical-align: middle;text-align: center">
</tr> <a href="{% url 'group-management-update' r.id %}"
{% endfor %} class="btn btn-primary btn-mini">编辑</a>
</tbody> <a href="{% url 'group-management-delete' r.id %}"
</table> class="btn btn-danger btn-mini">删除</a>
<div class="metadata-pagination"> </td>
{% include 'dashboard/paginator/group-management-paginate.html' %} </tr>
</div> {% endfor %}
</div> </tbody>
</div> </table>
</div> <div class="metadata-pagination">
</section> {% include 'dashboard/paginator/group-management-paginate.html' %}
</div> </div>
</section> </div>
</section> </div>
<div class="chatapi-windows "> </div>
</div> </section>
</div> </div>
</body> </section>
{% endblock %} </section>
{% block add_js %} <div class="chatapi-windows ">
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script> </div>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script> </div>
{% endblock %} </body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
{% endblock %}

View File

@ -1,197 +1,197 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">新建群组</h1></div> <h1 class="title">新建矩阵</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">群组信息表单</h2> <h2 class="title pull-left">矩阵信息表单</h2>
{# <div class="actions panel_actions pull-right">#} {# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#} {# <i class="box_toggle fa fa-chevron-down"></i>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#} {# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}
{# <i class="box_close fa fa-times"></i>#} {# <i class="box_close fa fa-times"></i>#}
{# </div>#} {# </div>#}
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'group-management-create' %}" enctype="multipart/form-data">{% csrf_token %} action="{% url 'group-management-create' %}" enctype="multipart/form-data">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">群组名称</label> <label class="form-label" for="name">矩阵名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name"> <input type="text" class="form-control" name="name">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="presentation">群组介绍</label> <label class="form-label" for="presentation">矩阵介绍</label>
<div class="controls"> <div class="controls">
<textarea type="text" class="form-control" <textarea type="text" class="form-control"
name="presentation"></textarea> name="presentation"></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="image">图标 <label class="form-label" for="image">图标
<div class="controls"> <div class="controls">
<input type="file" name="image"> <input type="file" name="image">
</div> </div>
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="type">群组类型</label> <label class="form-label" for="type">矩阵类型</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="type"> <select class="form-control" name="type">
{% for g in group_type %} {% for g in group_type %}
<option value="{{ g.id }}">{{ g.type }}</option> <option value="{{ g.id }}">{{ g.type }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="status">群组状态</label> <label class="form-label" for="status">矩阵状态</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="status"> <select class="form-control" name="status">
{% for g in group_status_choices_list %} {% for g in group_status_choices_list %}
<option value="{{ g }}">{{ g }}</option> <option value="{{ g }}">{{ g }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="administrativedivision">行政区划</label> <label class="form-label" for="administrativedivision">行政区划</label>
<div class="controls"> <div class="controls">
<select id="province" name="province"> <select id="province" name="province">
<option value="">请选择省</option> <option value="">请选择省</option>
</select> </select>
<select id="city" name="city" style="margin-left: 20px"> <select id="city" name="city" style="margin-left: 20px">
<option value="">请选择市</option> <option value="">请选择市</option>
</select> </select>
<select id="district" name="district" style="margin-left: 20px"> <select id="district" name="district" style="margin-left: 20px">
<option value="">请选择区/县</option> <option value="">请选择区/县</option>
</select> </select>
<select id="town" name="town" style="margin-left: 20px"> <select id="town" name="town" style="margin-left: 20px">
<option value="">请选择乡/镇</option> <option value="">请选择乡/镇</option>
</select> </select>
<select id="village" name="village" style="margin-left: 20px"> <select id="village" name="village" style="margin-left: 20px">
<option value="">请选择村/街道</option> <option value="">请选择村/街道</option>
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success">点击创建</button> <button type="submit" class="btn btn-success">点击创建</button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</section> </section>
</section> </section>
<div class="chatapi-windows "></div> <div class="chatapi-windows "></div>
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %} {% block add_js %}
<script> <script>
$(function () { $(function () {
$.get('/get/province/', function (data) { $.get('/get/province/', function (data) {
for (var i = 0, len = data.province.length; i < len; i++) { for (var i = 0, len = data.province.length; i < len; i++) {
$new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>"); $new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>");
$("#province").append($new); $("#province").append($new);
} }
}) })
//当省份改变后 //当省份改变后
$("#province").change(function () { $("#province").change(function () {
$("#city").empty().append('<option value="">请选择市</option>'); $("#city").empty().append('<option value="">请选择市</option>');
$("#district").empty().append('<option value="">请选择区/县</option>'); $("#district").empty().append('<option value="">请选择区/县</option>');
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/city/', url: '/get/city/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.city.length; i < len; i++) { for (var i = 0, len = data.city.length; i < len; i++) {
$new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>"); $new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>");
$("#city").append($new); $("#city").append($new);
} }
}) })
}) })
//当城市改变后 //当城市改变后
$("#city").change(function () { $("#city").change(function () {
$("#district").empty().append('<option value="">请选择区/县</option>'); $("#district").empty().append('<option value="">请选择区/县</option>');
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/district/', url: '/get/district/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.district.length; i < len; i++) { for (var i = 0, len = data.district.length; i < len; i++) {
$new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>"); $new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>");
$("#district").append($new); $("#district").append($new);
} }
}) })
}) })
//当县改变后 //当县改变后
$("#district").change(function () { $("#district").change(function () {
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/town/', url: '/get/town/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.town.length; i < len; i++) { for (var i = 0, len = data.town.length; i < len; i++) {
$new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>"); $new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>");
$("#town").append($new); $("#town").append($new);
} }
}) })
}) })
//当乡改变后 //当乡改变后
$("#district").change(function () { $("#district").change(function () {
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/village/', url: '/get/village/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.village.length; i < len; i++) { for (var i = 0, len = data.village.length; i < len; i++) {
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>"); $new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>");
$("#village").append($new); $("#village").append($new);
} }
}) })
}) })
}) })
</script> </script>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,104 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
{% endblock %}
{% block content %}
<body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">矩阵管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" class="active"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
</ul>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">矩阵名称</th>
<th style="text-align: center">矩阵类型</th>
<th style="text-align: center">管理员个数</th>
<th style="text-align: center">成员个数</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for r in res_g_i %}
<tr>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.status }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'group-management-update' r.id %}"
class="btn btn-primary btn-mini">编辑</a>
<a href="{% url 'group-management-delete' r.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/group-management-paginate.html' %}
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
{% endblock %}

View File

@ -1,270 +1,270 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">编辑群组</h1></div> <h1 class="title">编辑矩阵</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">群组信息表单</h2> <h2 class="title pull-left">矩阵信息表单</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'group-management-update' group.id %}" enctype="multipart/form-data">{% csrf_token %} action="{% url 'group-management-update' group.id %}" enctype="multipart/form-data">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">群组名称</label> <label class="form-label" for="name">矩阵名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name" <input type="text" class="form-control" name="name"
value="{{ group.name }}"> value="{{ group.name }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="presentation">群组介绍</label> <label class="form-label" for="presentation">矩阵介绍</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" <input type="text" class="form-control"
name="presentation" value="{{ group.presentation }}"> name="presentation" value="{{ group.presentation }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="image">图标 <label class="form-label" for="image">图标
<div class="controls"> <div class="controls">
<input type="file" name="image"><img <input type="file" name="image"><img
src="{{ group.image.url }}" src="{{ group.image.url }}"
style="width: 80px;height: 80px;" style="width: 80px;height: 80px;"
class="img-circle"> class="img-circle">
</div> </div>
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="type">群组类型</label> <label class="form-label" for="type">矩阵类型</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="type"> <select class="form-control" name="type">
<option value="{{ group.type.id }}">{{ group.type }}</option> <option value="{{ group.type.id }}">{{ group.type }}</option>
{% for g in group_type %} {% for g in group_type %}
<option value="{{ g.id }}">{{ g.type }}</option> <option value="{{ g.id }}">{{ g.type }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="status">群组状态</label> <label class="form-label" for="status">矩阵状态</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="status"> <select class="form-control" name="status">
<option value="{{ group.status }}">{{ group.status }}</option> <option value="{{ group.status }}">{{ group.status }}</option>
{% for g in group_status_choices_list %} {% for g in group_status_choices_list %}
<option value="{{ g }}">{{ g }}</option> <option value="{{ g }}">{{ g }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="administrativedivision">行政区划</label> <label class="form-label" for="administrativedivision">行政区划</label>
<div class="controls"> <div class="controls">
<select id="province" name="province"> <select id="province" name="province">
<option value="{{ group.province }}">{{ group.province }}</option> <option value="{{ group.province }}">{{ group.province }}</option>
</select> </select>
<select id="city" name="city" style="margin-left: 20px"> <select id="city" name="city" style="margin-left: 20px">
<option value="{{ group.cities }}">{{ group.cities }}</option> <option value="{{ group.cities }}">{{ group.cities }}</option>
</select> </select>
<select id="district" name="district" style="margin-left: 20px"> <select id="district" name="district" style="margin-left: 20px">
<option value="{{ group.district }}">{{ group.district }}</option> <option value="{{ group.district }}">{{ group.district }}</option>
</select> </select>
<select id="town" name="town" style="margin-left: 20px"> <select id="town" name="town" style="margin-left: 20px">
<option value="{{ group.town }}">{{ group.town }}</option> <option value="{{ group.town }}">{{ group.town }}</option>
</select> </select>
<select id="village" name="village" style="margin-left: 20px"> <select id="village" name="village" style="margin-left: 20px">
<option value="{{ group.village }}">{{ group.village }}</option> <option value="{{ group.village }}">{{ group.village }}</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="stauts">管理员</label> <label class="form-label" for="stauts">管理员</label>
<div class="controls" style="margin-left: 5%"> <div class="controls" style="margin-left: 5%">
<a href="{% url 'group-admin-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加管理员</span></a> <a href="{% url 'group-admin-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加管理员</span></a>
<table class="table table-hover" style="margin-top: 20px"> <table class="table table-hover" style="margin-top: 20px">
<thead> <thead>
<tr> <tr>
<th style="text-align: center">头像</th> <th style="text-align: center">头像</th>
<th style="text-align: center">用户名</th> <th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th> <th style="text-align: center">姓名</th>
<th style="text-align: center">单位名称</th> <th style="text-align: center">单位名称</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for g_a in g_a_list %} {% for g_a in g_a_list %}
<tr> <tr>
<td style="vertical-align: middle;text-align: center"><img <td style="vertical-align: middle;text-align: center"><img
src="{{ g_a.image }}" src="{{ g_a.image }}"
style="width: 80px;height: 80px;" style="width: 80px;height: 80px;"
class="img-circle"></td> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ g_a.username }}</td> <td style="vertical-align: middle;text-align: center">{{ g_a.username }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.name }}</td> <td style="vertical-align: middle;text-align: center">{{ g_a.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ g_a.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_a.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ g_a.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">
<a href="{% url 'group-admin-delete' g_a.id group.id %}" <a href="{% url 'group-admin-delete' g_a.id group.id %}"
class="btn btn-danger btn-mini">删除</a> class="btn btn-danger btn-mini">删除</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="stauts">成员</label> <label class="form-label" for="stauts">成员</label>
<div class="controls" style="margin-left: 5%"> <div class="controls" style="margin-left: 5%">
<a href="{% url 'group-user-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加成员</span></a> <a href="{% url 'group-user-create' group.id %}"><span class="glyphicon glyphicon-plus" aria-hidden="true">添加成员</span></a>
<table class="table table-hover" style="margin-top: 20px"> <table class="table table-hover" style="margin-top: 20px">
<thead> <thead>
<tr> <tr>
<th style="text-align: center">头像</th> <th style="text-align: center">头像</th>
<th style="text-align: center">用户名</th> <th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th> <th style="text-align: center">姓名</th>
<th style="text-align: center">单位名称</th> <th style="text-align: center">单位名称</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for g_u in g_u_list %} {% for g_u in g_u_list %}
<tr> <tr>
<td style="vertical-align: middle;text-align: center"><img <td style="vertical-align: middle;text-align: center"><img
src="{{ g_u.image }}" src="{{ g_u.image }}"
style="width: 80px;height: 80px;" style="width: 80px;height: 80px;"
class="img-circle"></td> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ g_u.username }}</td> <td style="vertical-align: middle;text-align: center">{{ g_u.username }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.name }}</td> <td style="vertical-align: middle;text-align: center">{{ g_u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ g_u.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ g_u.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ g_u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">
<a href="{% url 'group-user-delete' g_u.id group.id %}" <a href="{% url 'group-user-delete' g_u.id group.id %}"
class="btn btn-danger btn-mini">删除</a> class="btn btn-danger btn-mini">删除</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success">提交修改</button> <button type="submit" class="btn btn-success">提交修改</button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</section> </section>
</section> </section>
<div class="chatapi-windows "></div> <div class="chatapi-windows "></div>
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %} {% block add_js %}
<script> <script>
$(function () { $(function () {
$.get('/get/province/', function (data) { $.get('/get/province/', function (data) {
for (var i = 0, len = data.province.length; i < len; i++) { for (var i = 0, len = data.province.length; i < len; i++) {
$new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>"); $new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>");
$("#province").append($new); $("#province").append($new);
} }
}) })
//当省份改变后 //当省份改变后
$("#province").change(function () { $("#province").change(function () {
$("#city").empty().append('<option value="">请选择市</option>'); $("#city").empty().append('<option value="">请选择市</option>');
$("#district").empty().append('<option value="">请选择区/县</option>'); $("#district").empty().append('<option value="">请选择区/县</option>');
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/city/', url: '/get/city/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.city.length; i < len; i++) { for (var i = 0, len = data.city.length; i < len; i++) {
$new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>"); $new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>");
$("#city").append($new); $("#city").append($new);
} }
}) })
}) })
//当城市改变后 //当城市改变后
$("#city").change(function () { $("#city").change(function () {
$("#district").empty().append('<option value="">请选择区/县</option>'); $("#district").empty().append('<option value="">请选择区/县</option>');
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/district/', url: '/get/district/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.district.length; i < len; i++) { for (var i = 0, len = data.district.length; i < len; i++) {
$new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>"); $new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>");
$("#district").append($new); $("#district").append($new);
} }
}) })
}) })
//当县改变后 //当县改变后
$("#district").change(function () { $("#district").change(function () {
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $("#town").empty().append('<option value="">请选择乡/镇</option>');
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/town/', url: '/get/town/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.town.length; i < len; i++) { for (var i = 0, len = data.town.length; i < len; i++) {
$new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>"); $new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>");
$("#town").append($new); $("#town").append($new);
} }
}) })
}) })
//当乡改变后 //当乡改变后
$("#district").change(function () { $("#district").change(function () {
$("#village").empty().append('<option value="">请选择村/街道</option>'); $("#village").empty().append('<option value="">请选择村/街道</option>');
$.ajax({ $.ajax({
url: '/get/village/', url: '/get/village/',
type: 'get', type: 'get',
data: {"code": $(this).val()} data: {"code": $(this).val()}
}).done(function (data) { }).done(function (data) {
for (var i = 0, len = data.village.length; i < len; i++) { for (var i = 0, len = data.village.length; i < len; i++) {
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>"); $new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>");
$("#village").append($new); $("#village").append($new);
} }
}) })
}) })
}) })
</script> </script>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,97 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
{% endblock %}
{% block content %}
<body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">矩阵管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" class="active"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
</ul>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">矩阵名称</th>
<th style="text-align: center">矩阵类型</th>
<th style="text-align: center">管理员个数</th>
<th style="text-align: center">成员个数</th>
<th style="text-align: center">状态</th>
</tr>
</thead>
<tbody>
{% for r in res_g_u %}
<tr>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.admin_count }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.status }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/group-management-paginate.html' %}
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
{% endblock %}

View File

@ -1,74 +1,74 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">添加群组成员</h1></div> <h1 class="title">添加矩阵成员</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">群组成员表单</h2> <h2 class="title pull-left">矩阵成员表单</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'group-user-create' pk %}" enctype="multipart/form-data">{% csrf_token %} action="{% url 'group-user-create' pk %}" enctype="multipart/form-data">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">群组名称</label> <label class="form-label" for="name">矩阵名称</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name" disabled value="{{ group }}"> <input type="text" class="form-control" name="name" disabled value="{{ group }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="user">管理员</label> <label class="form-label" for="user">管理员</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="user"> <select class="form-control" name="user">
{% for u in usee %} {% for u in usee %}
<option value="{{ u.id }}">{{ u.username }}</option> <option value="{{ u.id }}">{{ u.username }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success">点击创建</button> <button type="submit" class="btn btn-success">点击创建</button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</section> </section>
</section> </section>
<div class="chatapi-windows "></div> <div class="chatapi-windows "></div>
</div> </div>
</body> </body>
{% endblock %} {% endblock %}

View File

@ -0,0 +1,105 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<!-- START TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">新建新媒体</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">新建抖音</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-8 col-sm-9 col-xs-10">
<form method="post"
action="{% url 'newmedia-management-create-douyin' %}"
enctype="multipart/form-data">{% csrf_token %}
<div class="form-group">
<label class="form-label" for="code">抖音号</label>
<div class="controls">
<input type="text" class="form-control" name="code">
</div>
</div>
<div class="form-group">
<label class="form-label" for="douyinid">ID</label>
<div class="controls">
<input type="text" class="form-control" name="douyinid">
</div>
</div>
<div class="form-group">
<label class="form-label" for="alias">别名</label>
<div class="controls">
<input type="text" class="form-control" name="alias">
</div>
</div>
<div class="form-group">
<label class="form-label" for="organization">单位</label>
<div class="controls">
<select class="form-control" name="organization">
{% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="image">图标
<div class="controls">
<input type="file" name="image">
</div>
</label>
</div>
<div class="form-group">
<label class="form-label" for="status">状态</label>
<div class="controls">
<select class="form-control" name="status">
{% for w in douyin_status_choices_list %}
<option value="{{ w }}">{{ w }}</option>
{% endfor %}
</select>
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button>
</form>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows "></div>
</div>
</body>
{% endblock %}

View File

@ -1,109 +1,119 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block css %} {% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
<style> <style>
.c { .c {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
} }
a:hover { a:hover {
text-decoration: none; text-decoration: none;
} }
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<body class=" "><!-- START TOPBAR --> <body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">新建新媒体</h1></div> <h1 class="title">新建新媒体</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12"> <div class="col-lg-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">新媒体列表</h2> <h2 class="title pull-left">新媒体列表</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-create-weixin' %}"><img <a href="{% url 'newmedia-management-create-weixin' %}"><img
src="{% static 'dashboard/image/weixin.png' %}" src="{% static 'dashboard/image/weixin.png' %}"
class='fa fa-thumbs-up '></a> class='fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-create-weixin' %}"><span>微信</span></a> <a href="{% url 'newmedia-management-create-weixin' %}"><span>微信</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="" {% url 'newmedia-management-create-weibo' %}><img <a href="" {% url 'newmedia-management-create-weibo' %}><img
src="{% static 'dashboard/image/weibo.png' %}" src="{% static 'dashboard/image/weibo.png' %}"
class=' fa fa-thumbs-up '></a> class=' fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-create-weibo' %}"><span>微博</span></a> <a href="{% url 'newmedia-management-create-weibo' %}"><span>微博</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-create-toutiao' %}"><img <a href="{% url 'newmedia-management-create-toutiao' %}"><img
src="{% static 'dashboard/image/toutiao.png' %}" src="{% static 'dashboard/image/toutiao.png' %}"
class='fa fa-thumbs-up '></a> class='fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-create-toutiao' %}"><span>今日头条</span></a> <a href="{% url 'newmedia-management-create-toutiao' %}"><span>今日头条</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-create-qita' %}"><img src="{% static 'dashboard/image/qita.png' %}" <a href="{% url 'newmedia-management-create-douyin' %}"><img
class='fa fa-thumbs-up '></a> src="{% static 'dashboard/image/douyin.jpg' %}"
</div> class='fa fa-thumbs-up '></a>
<div class="stats"> </div>
<a href="{% url 'newmedia-management-create-qita' %}"><span>其他新媒体</span></a> <div class="stats">
</div> <a href="{% url 'newmedia-management-create-douyin' %}"><span>抖音</span></a>
</div> </div>
</div> </div>
</div> <div class="col-md-3 col-sm-6 col-xs-6 c">
</section> <div class="r4_counter db_box">
</div> <a href="{% url 'newmedia-management-create-qita' %}"><img src="{% static 'dashboard/image/qita.png' %}"
</section> class='fa fa-thumbs-up '></a>
</section> </div>
<div class="chatapi-windows "> <div class="stats">
</div> <a href="{% url 'newmedia-management-create-qita' %}"><span>其他新媒体</span></a>
</div> </div>
</body> </div>
{% endblock %} </div>
{% block add_js %} </div>
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script> </section>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script> </div>
{% endblock %} </section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
{% endblock %}

View File

@ -0,0 +1,84 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
{% endblock %}
{% block content %}
<body class=" ">
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">新媒体编辑</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">抖音列表</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th>
<th style="text-align: center">责任主体</th>
<th style="text-align: center">主体类型</th>
<th style="text-align: center">行政区划</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.organization_type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.status }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'newmedia-management-update-douyin' w.id %}"
class="btn btn-primary btn-mini">编辑</a>
<a href="{% url 'newmedia-management-delete-douyin' w.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/douyin-management-paginate.html' %}
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
<script>
</script>
{% endblock %}

View File

@ -1,110 +1,120 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block css %} {% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
<style> <style>
.c { .c {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
} }
a:hover { a:hover {
text-decoration: none; text-decoration: none;
} }
</style> </style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<body class=" "><!-- START TOPBAR --> <body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">编辑新媒体</h1></div> <h1 class="title">编辑新媒体</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12"> <div class="col-lg-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">新媒体列表</h2> <h2 class="title pull-left">新媒体列表</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-edit-weixin' %}"><img <a href="{% url 'newmedia-management-edit-weixin' %}"><img
src="{% static 'dashboard/image/weixin.png' %}" src="{% static 'dashboard/image/weixin.png' %}"
class='fa fa-thumbs-up '></a> class='fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-edit-weixin' %}"><span>微信</span></a> <a href="{% url 'newmedia-management-edit-weixin' %}"><span>微信</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-edit-weibo' %}"><img <a href="{% url 'newmedia-management-edit-weibo' %}"><img
src="{% static 'dashboard/image/weibo.png' %}" src="{% static 'dashboard/image/weibo.png' %}"
class=' fa fa-thumbs-up '></a> class=' fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-edit-weibo' %}"><span>微博</span></a> <a href="{% url 'newmedia-management-edit-weibo' %}"><span>微博</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-edit-toutiao' %}"><img <a href="{% url 'newmedia-management-edit-toutiao' %}"><img
src="{% static 'dashboard/image/toutiao.png' %}" src="{% static 'dashboard/image/toutiao.png' %}"
class='fa fa-thumbs-up '></a> class='fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-edit-toutiao' %}"><span>今日头条</span></a> <a href="{% url 'newmedia-management-edit-toutiao' %}"><span>今日头条</span></a>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-6 c"> <div class="col-md-3 col-sm-6 col-xs-6 c">
<div class="r4_counter db_box"> <div class="r4_counter db_box">
<a href="{% url 'newmedia-management-edit-qita' %}"><img <a href="{% url 'newmedia-management-edit-douyin' %}"><img
src="{% static 'dashboard/image/qita.png' %}" src="{% static 'dashboard/image/douyin.jpg' %}"
class='fa fa-thumbs-up '></a> class='fa fa-thumbs-up '></a>
</div> </div>
<div class="stats"> <div class="stats">
<a href="{% url 'newmedia-management-edit-qita' %}"><span>其他新媒体</span></a> <a href="{% url 'newmedia-management-edit-douyin' %}"><span>抖音</span></a>
</div> </div>
</div> </div>
</div> <div class="col-md-3 col-sm-6 col-xs-6 c">
</div> <div class="r4_counter db_box">
</section> <a href="{% url 'newmedia-management-edit-qita' %}"><img
</div> src="{% static 'dashboard/image/qita.png' %}"
</section> class='fa fa-thumbs-up '></a>
</section> </div>
<div class="chatapi-windows "> <div class="stats">
</div> <a href="{% url 'newmedia-management-edit-qita' %}"><span>其他新媒体</span></a>
</div> </div>
</body> </div>
{% endblock %} </div>
{% block add_js %} </div>
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script> </section>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script> </div>
{% endblock %} </section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
{% endblock %}

View File

@ -0,0 +1,113 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<!-- START TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">新媒体编辑</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">抖音编辑</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-8 col-sm-9 col-xs-10">
<form method="post"
action="{% url 'newmedia-management-update-douyin' douyin.id %}"
enctype="multipart/form-data">{% csrf_token %}
<div class="form-group">
<label class="form-label" for="code">头条号</label>
<div class="controls">
<input type="text" class="form-control" name="code"
value="{{ douyin.code }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="toutiaoid">ID</label>
<div class="controls">
<input type="text" class="form-control" name="toutiaoid"
value="{{ douyin.douyinid }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="alias">别名</label>
<div class="controls">
<input type="text" class="form-control" name="alias"
value="{{ douyin.alias }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="organization">单位</label>
<div class="controls">
<select class="form-control" name="organization">
<option value="{{ douyin.organization.id }}">{{ douyin.organization.name }}</option>
{% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="image">图标
<div class="controls">
<input type="file" name="image"><img
src="{{ douyin.image.url }}"
style="width: 80px;height: 80px;"
class="img-circle">
</div>
</label>
</div>
<div class="form-group">
<label class="form-label" for="status">状态</label>
<div class="controls">
<select class="form-control" name="status">
<option value="{{ douyin.status }}">{{ douyin.status }}</option>
{% for w in douyin_status_choices_list %}
<option value="{{ w }}">{{ w }}</option>
{% endfor %}
</select>
</div>
</div>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button>
</form>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows "></div>
</div>
</body>
{% endblock %}

View File

@ -5,14 +5,21 @@
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css"> <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote.css" rel="stylesheet"> <link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote.css" rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-bs4.css" rel="stylesheet"> <link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-bs4.css"
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-lite.css" rel="stylesheet"> rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/django_summernote.css" rel="stylesheet"> <link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-lite.css"
rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/django_summernote.css"
rel="stylesheet">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container" > <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<div class="container">
{% if messages %} {% if messages %}
<div class="alert alert-danger alert-dismissible" role="alert"> <div class="alert alert-danger alert-dismissible" role="alert">
@ -42,7 +49,7 @@
<label for="title">新闻分类</label> <label for="title">新闻分类</label>
<select class="form-control" name="type"> <select class="form-control" name="type">
{% for t in type %} {% for t in type %}
<option value="{{ t.choices }}">{{ t.choices }}</option> <option value="{{ t.choices }}">{{ t.choices }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
@ -62,8 +69,8 @@
<div class="row"> <div class="row">
<label for="country">正文</label> <label for="country">正文</label>
<div > <div>
<textarea id="summernote" name="content" class="input-block-level" ></textarea> <textarea id="summernote" name="content" class="input-block-level"></textarea>
</div> </div>
<div style="margin-top: 20px;text-align: center;padding-bottom: 20px"> <div style="margin-top: 20px;text-align: center;padding-bottom: 20px">
@ -83,15 +90,15 @@
<script src="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/jquery.ui.widget.js"></script> <script src="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/jquery.ui.widget.js"></script>
<script src="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/jquery.iframe-transport.js"></script> <script src="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/jquery.iframe-transport.js"></script>
<script> <script>
window.onload = function () { window.onload = function () {
$('#summernote').summernote({ $('#summernote').summernote({
lang : 'zh-CN', lang: 'zh-CN',
minHeight : 300, minHeight: 300,
dialogsFade : true, dialogsFade: true,
dialogsInBody : true, dialogsInBody: true,
disableDragAndDrop : false, disableDragAndDrop: false,
}); });
}; };
</script> </script>
{# <script type="text/javascript" src="/extra_apps/DjangoUeditor/static/ueditor/ueditor.config.js"></script>#} {# <script type="text/javascript" src="/extra_apps/DjangoUeditor/static/ueditor/ueditor.config.js"></script>#}
{# <script type="text/javascript" src="/extra_apps/DjangoUeditor/static/ueditor/ueditor.all.min.js"></script>#} {# <script type="text/javascript" src="/extra_apps/DjangoUeditor/static/ueditor/ueditor.all.min.js"></script>#}

View File

@ -0,0 +1,56 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block title %}祁连山生态监测数据管理平台{% endblock %}
{% block css %}
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote.css" rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-bs4.css"
rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/summernote-lite.css"
rel="stylesheet">
<link href="/static/django-summernote-0.8.11.4/django_summernote/static/summernote/django_summernote.css"
rel="stylesheet">
{% endblock %}
{% block content %}
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<div class="container">
{% if messages %}
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class="panel-heading" style="margin-top: 100px">
<h3 style="text-align: center;">{{ news.title }}</h3>
</div>
<div class="panel-body">
{# <div class="panel panel-info">#}
<div class="panel-heading">
<div class="col-md-4">新闻类型:{{ news.type }}</div>
<div class="col-md-4">作者:{{ news.author }}</div>
<div class="col-md-4">发布时间:{{ news.date }}</div>
</div>
<div class="panel-body" style="margin-top: 20px">
{{ news.content|safe }}
</div>
{# </div>#}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,105 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
{% endblock %}
{% block content %}
<body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">新闻管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">新闻列表</h2>
{# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}
{# <i class="box_close fa fa-times"></i>#}
{# </div>#}
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="row">
<div class="col-sm-12 col-md-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">标题</th>
<th style="text-align: center">作者</th>
<th style="text-align: center">类型</th>
<th style="text-align: center">时间</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for n in news %}
<tr>
<td style="vertical-align: middle;text-align: left">{{ n.title }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.author }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.date }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'news-management-detail' n.id %}"
class="btn btn-primary btn-mini">查看</a>
<a href="{% url 'news-management-delete' n.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/organization-management-paginate.html' %}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
<script>
</script>
{% endblock %}

View File

@ -1,180 +1,192 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">新建单位</h1></div> <h1 class="title">新建单位</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">单位信息表单</h2> <h2 class="title pull-left">单位信息表单</h2>
{# <div class="actions panel_actions pull-right">#} {# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#} {# <i class="box_toggle fa fa-chevron-down"></i>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#} {# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}
{# <i class="box_close fa fa-times"></i>#} {# <i class="box_close fa fa-times"></i>#}
{# </div>#} {# </div>#}
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'organization-management-create' %}" enctype="multipart/form-data">{% csrf_token %} action="{% url 'organization-management-create' %}"
<div class="form-group"> enctype="multipart/form-data">{% csrf_token %}
<label class="form-label" for="name">单位名</label> <div class="form-group">
<div class="controls"> <label class="form-label" for="name">单位名</label>
<input type="text" class="form-control" name="name"> <div class="controls">
</div> <input type="text" class="form-control" name="name">
</div> </div>
<div class="form-group"> </div>
<label class="form-label" for="image">图标 <div class="form-group">
<div class="controls"> <label class="form-label" for="image">图标
<input type="file" name="image"> <div class="controls">
</div></label> <input type="file" name="image">
</div> </div>
<div class="form-group"> </label>
<label class="form-label" for="organizationtype">单位类型</label> </div>
<div class="controls"> <div class="form-group">
<select class="form-control" name="organizationtype"> <label class="form-label" for="organizationtype">单位类型</label>
{% for o in organizationtype %} <div class="controls">
<option value="{{ o.id }}">{{ o.organizationtype }}</option> <select class="form-control" name="organizationtype">
{% endfor %} {% for o in organizationtype %}
</select> <option value="{{ o.id }}">{{ o.organizationtype }}</option>
</div> {% endfor %}
</div> </select>
<div class="form-group"> </div>
<label class="form-label" for="administrativedivision">行政区划</label> </div>
<div class="controls"> <div class="form-group">
<select id="province" name="province"> <label class="form-label" for="administrativedivision">行政区划</label>
<option value="">请选择省</option> <div class="controls">
</select> <select id="province" name="province">
<select id="city" name="city" style="margin-left: 20px"> <option value="">请选择省</option>
<option value="">请选择市</option> </select>
</select> <select id="city" name="city" style="margin-left: 20px">
<select id="district" name="district" style="margin-left: 20px"> <option value="">请选择市</option>
<option value="">请选择区/县</option> </select>
</select> <select id="district" name="district" style="margin-left: 20px">
<select id="town" name="town" style="margin-left: 20px"> <option value="">请选择区/县</option>
<option value="">请选择乡/镇</option> </select>
</select> <select id="town" name="town" style="margin-left: 20px">
<select id="village" name="village" style="margin-left: 20px"> <option value="">请选择乡/镇</option>
<option value="">请选择村/街道</option> </select>
</select> <select id="village" name="village" style="margin-left: 20px">
</div> <option value="">请选择村/街道</option>
</div> </select>
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建 </div>
</button> </div>
</form> <div class="form-group">
</div> <label class="form-label" for="level">权限</label>
</div> <div class="controls">
</div> <select class="form-control" name="level">
</section> {% for l in level %}
</div> <option value="{{ l.id }}">{{ l.name }}</option>
</section> {% endfor %}
</section> </select>
<div class="chatapi-windows "></div> </div>
</div> </div>
</body> <button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
{% endblock %} </button>
</form>
{% block add_js %} </div>
<script> </div>
$(function () { </div>
$.get('/get/province/', function (data) { </section>
for (var i = 0, len = data.province.length; i < len; i++) { </div>
$new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>"); </section>
$("#province").append($new); </section>
} <div class="chatapi-windows "></div>
}) </div>
//当省份改变后 </body>
$("#province").change(function () { {% endblock %}
$("#city").empty().append('<option value="">请选择市</option>');
$("#district").empty().append('<option value="">请选择区/县</option>'); {% block add_js %}
$("#town").empty().append('<option value="">请选择乡/镇</option>'); <script>
$("#village").empty().append('<option value="">请选择村/街道</option>'); $(function () {
$.ajax({ $.get('/get/province/', function (data) {
url: '/get/city/', for (var i = 0, len = data.province.length; i < len; i++) {
type: 'get', $new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>");
data: {"code": $(this).val()} $("#province").append($new);
}).done(function (data) { }
for (var i = 0, len = data.city.length; i < len; i++) { })
$new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>"); //当省份改变后
$("#city").append($new); $("#province").change(function () {
} $("#city").empty().append('<option value="">请选择市</option>');
}) $("#district").empty().append('<option value="">请选择区/县</option>');
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
//当城市改变后 $("#village").empty().append('<option value="">请选择村/街道</option>');
$("#city").change(function () { $.ajax({
$("#district").empty().append('<option value="">请选择区/县</option>'); url: '/get/city/',
$("#town").empty().append('<option value="">请选择乡/镇</option>'); type: 'get',
$("#village").empty().append('<option value="">请选择村/街道</option>'); data: {"code": $(this).val()}
$.ajax({ }).done(function (data) {
url: '/get/district/', for (var i = 0, len = data.city.length; i < len; i++) {
type: 'get', $new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>");
data: {"code": $(this).val()} $("#city").append($new);
}).done(function (data) { }
for (var i = 0, len = data.district.length; i < len; i++) { })
$new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>"); })
$("#district").append($new); //当城市改变后
} $("#city").change(function () {
}) $("#district").empty().append('<option value="">请选择区/县</option>');
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
//当县改变后 $("#village").empty().append('<option value="">请选择村/街道</option>');
$("#district").change(function () { $.ajax({
$("#town").empty().append('<option value="">请选择乡/镇</option>'); url: '/get/district/',
$("#village").empty().append('<option value="">请选择村/街道</option>'); type: 'get',
$.ajax({ data: {"code": $(this).val()}
url: '/get/town/', }).done(function (data) {
type: 'get', for (var i = 0, len = data.district.length; i < len; i++) {
data: {"code": $(this).val()} $new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>");
}).done(function (data) { $("#district").append($new);
for (var i = 0, len = data.town.length; i < len; i++) { }
$new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>"); })
$("#town").append($new); })
} //当县改变后
}) $("#district").change(function () {
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
//当乡改变后 $("#village").empty().append('<option value="">请选择村/街道</option>');
$("#district").change(function () { $.ajax({
$("#village").empty().append('<option value="">请选择村/街道</option>'); url: '/get/town/',
$.ajax({ type: 'get',
url: '/get/village/', data: {"code": $(this).val()}
type: 'get', }).done(function (data) {
data: {"code": $(this).val()} for (var i = 0, len = data.town.length; i < len; i++) {
}).done(function (data) { $new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>");
for (var i = 0, len = data.village.length; i < len; i++) { $("#town").append($new);
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>"); }
$("#village").append($new); })
} })
}) //当乡改变后
}) $("#district").change(function () {
}) $("#village").empty().append('<option value="">请选择村/街道</option>');
</script> $.ajax({
{% endblock %} url: '/get/village/',
type: 'get',
data: {"code": $(this).val()}
}).done(function (data) {
for (var i = 0, len = data.village.length; i < len; i++) {
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>");
$("#village").append($new);
}
})
})
})
</script>
{% endblock %}

View File

@ -1,186 +1,197 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block content %} {% block content %}
<body class=" "> <body class=" ">
<!-- START TOPBAR --> <!-- START TOPBAR -->
<!-- START CONTAINER --> <!-- START CONTAINER -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">编辑单位</h1></div> <h1 class="title">编辑单位</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">单位信息表单</h2> <h2 class="title pull-left">单位信息表单</h2>
{# <div class="actions panel_actions pull-right">#} {# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#} {# <i class="box_toggle fa fa-chevron-down"></i>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#} {# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}
{# <i class="box_close fa fa-times"></i>#} {# <i class="box_close fa fa-times"></i>#}
{# </div>#} {# </div>#}
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-8 col-sm-9 col-xs-10"> <div class="col-md-8 col-sm-9 col-xs-10">
<form method="post" <form method="post"
action="{% url 'organization-management-update' organization.id %}" action="{% url 'organization-management-update' organization.id %}"
enctype="multipart/form-data">{% csrf_token %} enctype="multipart/form-data">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="form-label" for="name">单位名</label> <label class="form-label" for="name">单位名</label>
<div class="controls"> <div class="controls">
<input type="text" class="form-control" name="name" <input type="text" class="form-control" name="name"
value="{{ organization.name }}"> value="{{ organization.name }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="image">图标 <label class="form-label" for="image">图标
<div class="controls"> <div class="controls">
<input type="file" name="image"><img <input type="file" name="image"><img
src="{{ organization.image.url }}" src="{{ organization.image.url }}"
style="width: 80px;height: 80px;" style="width: 80px;height: 80px;"
class="img-circle"> class="img-circle">
</div> </div>
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="organizationtype">单位类型</label> <label class="form-label" for="organizationtype">单位类型</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="organizationtype"> <select class="form-control" name="organizationtype">
<option value="{{ organization.organizationtype.id }}">{{ organization.organizationtype.organizationtype }}</option> <option value="{{ organization.organizationtype.id }}">{{ organization.organizationtype.organizationtype }}</option>
{% for o in organizationtype %} {% for o in organizationtype %}
<option value="{{ o.id }}">{{ o.organizationtype }}</option> <option value="{{ o.id }}">{{ o.organizationtype }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="administrativedivision">行政区划</label> <label class="form-label" for="administrativedivision">行政区划</label>
<div class="controls"> <div class="controls">
<select id="province" name="province"> <select id="province" name="province">
<option value="{{ organization.province }}">{{ organization.province }}</option> <option value="{{ organization.province }}">{{ organization.province }}</option>
</select> </select>
<select id="city" name="city" style="margin-left: 20px"> <select id="city" name="city" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.cities }}</option> <option value="{{ organization.province }}">{{ organization.cities }}</option>
</select> </select>
<select id="district" name="district" style="margin-left: 20px"> <select id="district" name="district" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.district }}</option> <option value="{{ organization.province }}">{{ organization.district }}</option>
</select> </select>
<select id="town" name="town" style="margin-left: 20px"> <select id="town" name="town" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.town }}</option> <option value="{{ organization.province }}">{{ organization.town }}</option>
</select> </select>
<select id="village" name="village" style="margin-left: 20px"> <select id="village" name="village" style="margin-left: 20px">
<option value="{{ organization.province }}">{{ organization.village }}</option> <option value="{{ organization.province }}">{{ organization.village }}</option>
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-success">提交修改</button> <div class="form-group">
<label class="form-label" for="level">权限</label>
</form> <div class="controls">
</div> <select class="form-control" name="level">
</div> <option value="{{ organization.level.id }}">{{ organization.level.name }}</option>
</div> {% for l in level %}
</section> <option value="{{ l.id }}">{{ l.name }}</option>
</div> {% endfor %}
</section> </select>
</section> </div>
<div class="chatapi-windows "></div> </div>
</div> <button type="submit" class="btn btn-success">提交修改</button>
</body>
{% endblock %} </form>
{% block add_js %} </div>
<script> </div>
$(function () { </div>
$.get('/get/province/', function (data) { </section>
for (var i = 0, len = data.province.length; i < len; i++) { </div>
$new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>"); </section>
$("#province").append($new); </section>
} <div class="chatapi-windows "></div>
}) </div>
//当省份改变后 </body>
$("#province").change(function () { {% endblock %}
$("#city").empty().append('<option value="">请选择市</option>'); {% block add_js %}
$("#district").empty().append('<option value="">请选择区/县</option>'); <script>
$("#town").empty().append('<option value="">请选择乡/镇</option>'); $(function () {
$("#village").empty().append('<option value="">请选择村/街道</option>'); $.get('/get/province/', function (data) {
$.ajax({ for (var i = 0, len = data.province.length; i < len; i++) {
url: '/get/city/', $new = $("<option value=" + data.province[i][0] + ">" + data.province[i][1] + "</option>");
type: 'get', $("#province").append($new);
data: {"code": $(this).val()} }
}).done(function (data) { })
for (var i = 0, len = data.city.length; i < len; i++) { //当省份改变后
$new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>"); $("#province").change(function () {
$("#city").append($new); $("#city").empty().append('<option value="">请选择市</option>');
} $("#district").empty().append('<option value="">请选择区/县</option>');
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
}) $("#village").empty().append('<option value="">请选择村/街道</option>');
//当城市改变后 $.ajax({
$("#city").change(function () { url: '/get/city/',
$("#district").empty().append('<option value="">请选择区/县</option>'); type: 'get',
$("#town").empty().append('<option value="">请选择乡/镇</option>'); data: {"code": $(this).val()}
$("#village").empty().append('<option value="">请选择村/街道</option>'); }).done(function (data) {
$.ajax({ for (var i = 0, len = data.city.length; i < len; i++) {
url: '/get/district/', $new = $("<option value=" + data.city[i][0] + ">" + data.city[i][1] + "</option>");
type: 'get', $("#city").append($new);
data: {"code": $(this).val()} }
}).done(function (data) { })
for (var i = 0, len = data.district.length; i < len; i++) { })
$new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>"); //当城市改变后
$("#district").append($new); $("#city").change(function () {
} $("#district").empty().append('<option value="">请选择区/县</option>');
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
}) $("#village").empty().append('<option value="">请选择村/街道</option>');
//当县改变后 $.ajax({
$("#district").change(function () { url: '/get/district/',
$("#town").empty().append('<option value="">请选择乡/镇</option>'); type: 'get',
$("#village").empty().append('<option value="">请选择村/街道</option>'); data: {"code": $(this).val()}
$.ajax({ }).done(function (data) {
url: '/get/town/', for (var i = 0, len = data.district.length; i < len; i++) {
type: 'get', $new = $("<option value=" + data.district[i][0] + ">" + data.district[i][1] + "</option>");
data: {"code": $(this).val()} $("#district").append($new);
}).done(function (data) { }
for (var i = 0, len = data.town.length; i < len; i++) { })
$new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>"); })
$("#town").append($new); //当县改变后
} $("#district").change(function () {
}) $("#town").empty().append('<option value="">请选择乡/镇</option>');
}) $("#village").empty().append('<option value="">请选择村/街道</option>');
//当乡改变后 $.ajax({
$("#district").change(function () { url: '/get/town/',
$("#village").empty().append('<option value="">请选择村/街道</option>'); type: 'get',
$.ajax({ data: {"code": $(this).val()}
url: '/get/village/', }).done(function (data) {
type: 'get', for (var i = 0, len = data.town.length; i < len; i++) {
data: {"code": $(this).val()} $new = $("<option value=" + data.town[i][0] + ">" + data.town[i][1] + "</option>");
}).done(function (data) { $("#town").append($new);
for (var i = 0, len = data.village.length; i < len; i++) { }
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>"); })
$("#village").append($new); })
} //当乡改变后
}) $("#district").change(function () {
}) $("#village").empty().append('<option value="">请选择村/街道</option>');
}) $.ajax({
</script> url: '/get/village/',
{% endblock %} type: 'get',
data: {"code": $(this).val()}
}).done(function (data) {
for (var i = 0, len = data.village.length; i < len; i++) {
$new = $("<option value=" + data.village[i][0] + ">" + data.village[i][1] + "</option>");
$("#village").append($new);
}
})
})
})
</script>
{% endblock %}

View File

@ -1,111 +1,111 @@
{% extends 'dashboard/base/base.html' %} {% extends 'dashboard/base/base.html' %}
{% load static %} {% load static %}
{% block css %} {% block css %}
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/> <link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END --> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<body class=" "><!-- START TOPBAR --> <body class=" "><!-- START TOPBAR -->
<div class="page-container row-fluid"> <div class="page-container row-fluid">
<div class="page-sidebar "> <div class="page-sidebar ">
{% include 'dashboard/base/left.html' %} {% include 'dashboard/base/left.html' %}
</div> </div>
<section id="main-content" class=" "> <section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'> <section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %} {% if messages %}
<div class="alert alert-success alert-dismissible" role="alert"> <div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
</button> </button>
{% for message in messages %} {% for message in messages %}
{{ message }}.<br/> {{ message }}.<br/>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'> <div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title"> <div class="page-title">
<div class="pull-left"> <div class="pull-left">
<h1 class="title">主体单位管理</h1></div> <h1 class="title">主体单位管理</h1></div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="col-lg-12"> <div class="col-lg-12">
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">单位列表</h2> <h2 class="title pull-left">单位列表</h2>
{# <div class="actions panel_actions pull-right">#} {# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#} {# <i class="box_toggle fa fa-chevron-down"></i>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#} {# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}
{# <i class="box_close fa fa-times"></i>#} {# <i class="box_close fa fa-times"></i>#}
{# </div>#} {# </div>#}
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 col-xs-12"> <div class="col-md-12 col-sm-12 col-xs-12">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12 col-xs-12"> <div class="col-sm-12 col-md-12 col-xs-12">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th style="text-align: center">图标</th> <th style="text-align: center">图标</th>
<th style="text-align: center">单位名称</th> <th style="text-align: center">单位名称</th>
<th style="text-align: center">行政区划</th> <th style="text-align: center">类型</th>
<th style="text-align: center">类型</th> <th style="text-align: center">行政区划</th>
<th style="text-align: center">成员数量</th> <th style="text-align: center">成员数量</th>
<th style="text-align: center">新媒体数量</th> <th style="text-align: center">新媒体数量</th>
<th style="text-align: center">操作</th> <th style="text-align: center">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for r in res %} {% for r in res %}
<tr> <tr>
<td style="vertical-align: middle;text-align: center"><img <td style="vertical-align: middle;text-align: center"><img
src="{{ r.image }}" style="width: 80px;height: 80px;" src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td> <td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.organizationtype }}</td> <td style="vertical-align: middle;text-align: center">{{ r.organizationtype }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ r.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.usercount }}</td> <td style="vertical-align: middle;text-align: center">{{ r.usercount }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.mediacount }}</td> <td style="vertical-align: middle;text-align: center">{{ r.mediacount }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">
<a href="{% url 'organization-management-update' r.id %}" <a href="{% url 'organization-management-update' r.id %}"
class="btn btn-primary btn-mini">编辑</a> class="btn btn-primary btn-mini">编辑</a>
<a href="{% url 'organization-management-delete' r.id %}" <a href="{% url 'organization-management-delete' r.id %}"
class="btn btn-danger btn-mini">删除</a> class="btn btn-danger btn-mini">删除</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<div class="metadata-pagination"> <div class="metadata-pagination">
{% include 'dashboard/paginator/organization-management-paginate.html' %} {% include 'dashboard/paginator/organization-management-paginate.html' %}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</section> </section>
</section> </section>
<div class="chatapi-windows "> <div class="chatapi-windows ">
</div> </div>
</div> </div>
</body> </body>
{% endblock %} {% endblock %}
{% block add_js %} {% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script> <script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script> <script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
<script> <script>
</script> </script>
{% endblock %} {% endblock %}

View File

@ -1,48 +1,59 @@
from django.urls import path from django.urls import path
from management import views from management import views
urlpatterns = [ urlpatterns = [
# 用户管理 # 用户管理
path('user/management/', views.user_management, name='user-management-management'), path('user/management/', views.user_management, name='user-management-management'),
path('user/delete/<str:pk>/', views.user_delete, name='user-management-delete'), path('user/delete/<str:pk>/', views.user_delete, name='user-management-delete'),
path('user/update/<str:pk>/', views.user_update, name='user-management-update'), path('user/update/<str:pk>/', views.user_update, name='user-management-update'),
# 群组管理 # 矩阵管理
path('group/management/', views.group_management, name='group-management-management'), path('group/management/init/', views.group_management_init, name='group-management-management-init'),
path('group/create/', views.group_create, name='group-management-create'), path('group/management/admin/', views.group_management_admin, name='group-management-management-admin'),
path('group/update/<str:pk>/', views.group_update, name='group-management-update'), path('group/management/user/', views.group_management_user, name='group-management-management-user'),
path('group/delete/<str:pk>/', views.group_delete, name='group-management-delete'), path('group/create/', views.group_create, name='group-management-create'),
path('group/update/<str:pk>/', views.group_update, name='group-management-update'),
# 添加群组管理员、成员 path('group/delete/<str:pk>/', views.group_delete, name='group-management-delete'),
path('group/admin/create/<str:pk>/', views.group_admin_create, name='group-admin-create'),
path('group/admin/delete/<str:pk>/<str:group_pk>/', views.group_admin_delete, name='group-admin-delete'), # 添加矩阵管理员、成员
path('group/user/create/<str:pk>/', views.group_user_create, name='group-user-create'), path('group/admin/create/<str:pk>/', views.group_admin_create, name='group-admin-create'),
path('group/user/delete/<str:pk>/<str:group_pk>/', views.group_user_delete, name='group-user-delete'), path('group/admin/delete/<str:pk>/<str:group_pk>/', views.group_admin_delete, name='group-admin-delete'),
path('group/user/create/<str:pk>/', views.group_user_create, name='group-user-create'),
# 主体单位管理 path('group/user/delete/<str:pk>/<str:group_pk>/', views.group_user_delete, name='group-user-delete'),
path('organization/management/', views.organization_management, name='organization-management-management'),
path('organization/create/', views.organization_create, name='organization-management-create'), # 主体单位管理
path('organization/delete/<str:pk>/', views.organization_delete, name='organization-management-delete'), path('organization/management/', views.organization_management, name='organization-management-management'),
path('organization/update/<str:pk>/', views.organization_update, name='organization-management-update'), path('organization/create/', views.organization_create, name='organization-management-create'),
path('organization/delete/<str:pk>/', views.organization_delete, name='organization-management-delete'),
#新媒体管理 path('organization/update/<str:pk>/', views.organization_update, name='organization-management-update'),
path('newmedia/management/create/menu/',views.newmedia_management_create_menu,name='newmedia-management-create-menu'),
path('newmedia/management/edit/menu/',views.newmedia_management_edit_menu,name='newmedia-management-edit-menu'), #新媒体管理
path('newmedia/management/create/weixin/',views.newmedia_management_create_weixin,name='newmedia-management-create-weixin'), path('newmedia/management/create/menu/',views.newmedia_management_create_menu,name='newmedia-management-create-menu'),
path('newmedia/management/create/weibo/',views.newmedia_management_create_weibo,name='newmedia-management-create-weibo'), path('newmedia/management/edit/menu/',views.newmedia_management_edit_menu,name='newmedia-management-edit-menu'),
path('newmedia/management/create/toutiao/',views.newmedia_management_create_toutiao,name='newmedia-management-create-toutiao'), path('newmedia/management/create/weixin/',views.newmedia_management_create_weixin,name='newmedia-management-create-weixin'),
path('newmedia/management/create/qita/',views.newmedia_management_create_qita,name='newmedia-management-create-qita'), path('newmedia/management/create/weibo/',views.newmedia_management_create_weibo,name='newmedia-management-create-weibo'),
path('newmedia/management/edit/weixin/',views.newmedia_management_edit_weixin,name='newmedia-management-edit-weixin'), path('newmedia/management/create/toutiao/',views.newmedia_management_create_toutiao,name='newmedia-management-create-toutiao'),
path('newmedia/management/edit/weibo/',views.newmedia_management_edit_weibo,name='newmedia-management-edit-weibo'), path('newmedia/management/create/douyin/',views.newmedia_management_create_douyin,name='newmedia-management-create-douyin'),
path('newmedia/management/edit/toutiao/',views.newmedia_management_edit_toutiao,name='newmedia-management-edit-toutiao'), path('newmedia/management/create/qita/',views.newmedia_management_create_qita,name='newmedia-management-create-qita'),
path('newmedia/management/edit/qita/',views.newmedia_management_edit_qita,name='newmedia-management-edit-qita'), path('newmedia/management/edit/weixin/',views.newmedia_management_edit_weixin,name='newmedia-management-edit-weixin'),
path('newmedia/management/update/weixin/<str:pk>/',views.newmedia_management_update_weixin,name='newmedia-management-update-weixin'), path('newmedia/management/edit/weibo/',views.newmedia_management_edit_weibo,name='newmedia-management-edit-weibo'),
path('newmedia/management/update/weibo/<str:pk>/',views.newmedia_management_update_weibo,name='newmedia-management-update-weibo'), path('newmedia/management/edit/toutiao/',views.newmedia_management_edit_toutiao,name='newmedia-management-edit-toutiao'),
path('newmedia/management/update/toutiao/<str:pk>/',views.newmedia_management_update_toutiao,name='newmedia-management-update-toutiao'), path('newmedia/management/edit/douyin/',views.newmedia_management_edit_douyin,name='newmedia-management-edit-douyin'),
path('newmedia/management/update/qita/<str:pk>/',views.newmedia_management_update_qita,name='newmedia-management-update-qita'), path('newmedia/management/edit/qita/',views.newmedia_management_edit_qita,name='newmedia-management-edit-qita'),
path('newmedia/management/delete/weixin/<str:pk>/',views.newmedia_management_delete_weixin,name='newmedia-management-delete-weixin'), path('newmedia/management/update/weixin/<str:pk>/',views.newmedia_management_update_weixin,name='newmedia-management-update-weixin'),
path('newmedia/management/delete/weibo/<str:pk>/',views.newmedia_management_delete_weibo,name='newmedia-management-delete-weibo'), path('newmedia/management/update/weibo/<str:pk>/',views.newmedia_management_update_weibo,name='newmedia-management-update-weibo'),
path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'), path('newmedia/management/update/toutiao/<str:pk>/',views.newmedia_management_update_toutiao,name='newmedia-management-update-toutiao'),
path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'), path('newmedia/management/update/douyin/<str:pk>/',views.newmedia_management_update_douyin,name='newmedia-management-update-douyin'),
path('newmedia/management/update/qita/<str:pk>/',views.newmedia_management_update_qita,name='newmedia-management-update-qita'),
] path('newmedia/management/delete/weixin/<str:pk>/',views.newmedia_management_delete_weixin,name='newmedia-management-delete-weixin'),
path('newmedia/management/delete/weibo/<str:pk>/',views.newmedia_management_delete_weibo,name='newmedia-management-delete-weibo'),
path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'),
path('newmedia/management/delete/douyin/<str:pk>/',views.newmedia_management_delete_douyin,name='newmedia-management-delete-douyin'),
path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'),
#新闻管理
path('news/management/',views.new_management,name='new-management'),
path('news/management/create/', views.news_management_create, name='news-management-create'),
path('news/management/detail/<str:pk>/', views.news_management_detail, name='news-management-detail'),
path('news/management/delete/<str:pk>/', views.news_management_delete, name='news-management-delete'),
]

View File

@ -8,11 +8,24 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render from django.shortcuts import render
from dashboard.models import Userprofile, Group, Organization, Level, Organizationtype, Area_code_2020, Weixin, Weibo, \ from dashboard.models import Userprofile, Group, Organization, Level, Organizationtype, Area_code_2020, Weixin, Weibo, \
Toutiao, Qita, Group_type, Group_admin, Group_user Toutiao, Qita, Group_type, Group_admin, Group_user, News, Douyin
def user_management(request): def user_management(request):
userpaginator = User.objects.all().order_by('-date_joined') user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
userpaginator = None
if level == 1:
userpaginator = User.objects.filter(userprofile__organization__province=province).order_by('-date_joined')
elif level == 2:
userpaginator = User.objects.filter(userprofile__organization__province=province,userprofile__organization__cities=cities).order_by('-date_joined')
elif level == 3:
userpaginator = User.objects.filter(userprofile__organization__province=province,
userprofile__organization__cities=cities,userprofile__organization__district=district).order_by('-date_joined')
paginator = Paginator(userpaginator, 6) paginator = Paginator(userpaginator, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -73,10 +86,10 @@ def user_update(request, pk):
userprofile.image = image userprofile.image = image
user.save() user.save()
userprofile.save() userprofile.save()
messages.success(request,"修改成功") messages.success(request, "修改成功")
return HttpResponseRedirect("/") return HttpResponseRedirect("/")
else: else:
messages.error(request,'两次输入密码不一致') messages.error(request, '两次输入密码不一致')
return HttpResponseRedirect('/management/user/update/%s/' % (pk)) return HttpResponseRedirect('/management/user/update/%s/' % (pk))
else: else:
user.email = email user.email = email
@ -94,9 +107,12 @@ def user_update(request, pk):
{'usee': user, 'userprofile': userprofile, 'organization': organization}) {'usee': user, 'userprofile': userprofile, 'organization': organization})
def group_management(request): def group_management_init(request):
group = Group.objects.all().order_by('-created') user = request.user
paginator = Paginator(group, 6) # 创建的矩阵
group_initer = Group.objects.filter(user_id=user.id)
print(group_initer)
paginator = Paginator(group_initer, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
group = paginator.page(page) group = paginator.page(page)
@ -104,18 +120,76 @@ def group_management(request):
group = paginator.page(1) group = paginator.page(1)
except EmptyPage: except EmptyPage:
group = paginator.page(paginator.num_pages) group = paginator.page(paginator.num_pages)
res = [] res_g_i = []
for g in group: for r_g_i in group:
o = dict() o1 = dict()
o['id'] = str(g.id) o1['id'] = str(r_g_i.id)
o['image'] = g.image.url o1['image'] = r_g_i.image.url
o['name'] = g.name o1['name'] = r_g_i.name
o['type'] = g.type o1['type'] = r_g_i.type
o['admin_count'] = Group_admin.objects.filter(group_id=g.id).count() o1['admin_count'] = Group_admin.objects.filter(group_id=r_g_i.id).count()
o['user_count'] = Group_user.objects.filter(group_id=g.id).count() o1['user_count'] = Group_user.objects.filter(group_id=r_g_i.id).count()
o['status'] = g.status o1['status'] = r_g_i.status
res.append(o) res_g_i.append(o1)
return render(request, 'management/group-management.html', {'res': res, 'group': group}) return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i})
def group_management_admin(request):
# 管理的矩阵
user = request.user
group_admin_list = []
for g_a in Group_admin.objects.filter(user_id=user.id):
group_admin = Group.objects.get(id=g_a.group_id)
group_admin_list.append(group_admin)
paginator = Paginator(group_admin_list, 6)
page = int(request.GET.get('page', 1))
try:
group = paginator.page(page)
except PageNotAnInteger:
group = paginator.page(1)
except EmptyPage:
group = paginator.page(paginator.num_pages)
res_g_a = []
for r_g_a in group:
o2 = dict()
o2['id'] = str(r_g_a.id)
o2['image'] = r_g_a.image.url
o2['name'] = r_g_a.name
o2['type'] = r_g_a.type
o2['admin_count'] = Group_admin.objects.filter(group_id=r_g_a.id).count()
o2['user_count'] = Group_user.objects.filter(group_id=r_g_a.id).count()
o2['status'] = r_g_a.status
res_g_a.append(o2)
return render(request, 'management/group-management-admin.html', {'group': group, 'res_g_a': res_g_a})
def group_management_user(request):
# 加入的矩阵
user = request.user
group_user_list = []
for g_u in Group_user.objects.filter(user_id=user.id):
group_user = Group.objects.get(id=g_u.group_id)
group_user_list.append(group_user)
paginator = Paginator(group_user_list, 6)
page = int(request.GET.get('page', 1))
try:
group = paginator.page(page)
except PageNotAnInteger:
group = paginator.page(1)
except EmptyPage:
group = paginator.page(paginator.num_pages)
res_g_u = []
for r_g_u in group:
o3 = dict()
o3['id'] = str(r_g_u.id)
o3['image'] = r_g_u.image.url
o3['name'] = r_g_u.name
o3['type'] = r_g_u.type
o3['admin_count'] = Group_admin.objects.filter(group_id=r_g_u.id).count()
o3['user_count'] = Group_user.objects.filter(group_id=r_g_u.id).count()
o3['status'] = r_g_u.status
res_g_u.append(o3)
return render(request, 'management/group-management-user.html', {'group': group, 'res_g_u': res_g_u})
def group_update(request, pk): def group_update(request, pk):
@ -190,19 +264,20 @@ def group_update(request, pk):
g.image = image g.image = image
g.save() g.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/group/management/') return HttpResponseRedirect('/management/group/management/init/')
else: else:
Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status, Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status,
province=province_r, cities=city_r, district=district_r, town=town_r, province=province_r, cities=city_r, district=district_r, town=town_r,
village=village_r) village=village_r)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/group/management/') return HttpResponseRedirect('/management/group/management/init/')
return render(request, 'management/group-management-update.html', return render(request, 'management/group-management-update.html',
{'group': group, 'group_status_choices_list': group_status_choices_list, 'group_type': group_type, {'group': group, 'group_status_choices_list': group_status_choices_list, 'group_type': group_type,
'g_a_list': g_a_list, 'g_u_list': g_u_list}) 'g_a_list': g_a_list, 'g_u_list': g_u_list})
def group_create(request): def group_create(request):
user = request.user
GROUP_STATUS_CHOICES = Group.GROUP_STATUS_CHOICES GROUP_STATUS_CHOICES = Group.GROUP_STATUS_CHOICES
group_status_choices_list = [] group_status_choices_list = []
for g in GROUP_STATUS_CHOICES: for g in GROUP_STATUS_CHOICES:
@ -243,12 +318,13 @@ def group_create(request):
print(name, presentation, image, type, status, province, city, district, town, village) print(name, presentation, image, type, status, province, city, district, town, village)
if name is not None: if name is not None:
group = Group(name=name, presentation=presentation, image=image, type_id=type, status=status, group = Group(name=name, presentation=presentation, image=image, type_id=type, status=status,
province=province_r, cities=city_r, district=district_r, town=town_r, village=village_r) province=province_r, cities=city_r, district=district_r, town=town_r, village=village_r,user_id=user.id)
group.save() group.save()
messages.success(request, '添加成功') messages.success(request, '添加成功')
return render(request,'management/add-group-admin-and-user.html',{'group':group})
else: else:
messages.error(request, '群组名不能为空') messages.error(request, '矩阵名不能为空')
return HttpResponseRedirect('/management/group/management/') # return HttpResponseRedirect('/management/group/management/')
return render(request, 'management/group-management-create.html', return render(request, 'management/group-management-create.html',
{'group_status_choices_list': group_status_choices_list, 'group_type': group_type}) {'group_status_choices_list': group_status_choices_list, 'group_type': group_type})
@ -308,15 +384,31 @@ def group_delete(request, pk):
def organization_management(request): def organization_management(request):
organization = Organization.objects.all().order_by('-created') user = request.user
paginator = Paginator(organization, 6) o = Organization.objects.get(userprofile__user_id=user.id)
page = int(request.GET.get('page', 1)) print(o)
try: level = o.level.level
organization = paginator.page(page) province = o.province
except PageNotAnInteger: cities = o.cities
organization = paginator.page(1) district = o.district
except EmptyPage: print(level, province, cities, district)
organization = paginator.page(paginator.num_pages) organization = None
if level == 1:
organization = Organization.objects.filter(province=province).order_by('-created')
elif level == 2:
organization = Organization.objects.filter(province=province, cities=cities).order_by('-created')
elif level == 3:
organization = Organization.objects.filter(province=province, cities=cities, district=district).order_by(
'-created')
if organization is not None:
paginator = Paginator(organization, 6)
page = int(request.GET.get('page', 1))
try:
organization = paginator.page(page)
except PageNotAnInteger:
organization = paginator.page(1)
except EmptyPage:
organization = paginator.page(paginator.num_pages)
res = [] res = []
for i in organization: for i in organization:
o = dict() o = dict()
@ -324,8 +416,26 @@ def organization_management(request):
o['name'] = i.name o['name'] = i.name
o['image'] = i.image.url o['image'] = i.image.url
o['organizationtype'] = i.organizationtype.organizationtype o['organizationtype'] = i.organizationtype.organizationtype
o['administrativedivision'] = str(i.province) + '-' + str(i.cities) + '-' + str(i.district) + '-' + str( if len(i.province) > 0 and len(i.cities) > 0 and len(i.district) > 0 and len(i.town) > 0 and len(i.village) > 0:
i.town) + '-' + str(i.village) o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
Area_code_2020.objects.get(code=i.district).name) + '-' + str(
Area_code_2020.objects.get(code=i.town).name) + '-' + str(
Area_code_2020.objects.get(code=i.village).name)
elif len(i.province) > 0 and len(i.cities) > 0 and len(i.district) > 0 and len(i.town) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
Area_code_2020.objects.get(code=i.district).name) + '-' + str(
Area_code_2020.objects.get(code=i.town).name)
elif len(i.province) > 0 and len(i.cities) > 0 and len(i.district) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
Area_code_2020.objects.get(code=i.district).name)
elif len(i.province) > 0 and len(i.cities) > 0 :
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name)
elif len(i.province) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name)
o['usercount'] = Userprofile.objects.filter(organization_id=i.id).count() o['usercount'] = Userprofile.objects.filter(organization_id=i.id).count()
o['mediacount'] = Weixin.objects.filter(organization_id=i.id).count() + Weibo.objects.filter( o['mediacount'] = Weixin.objects.filter(organization_id=i.id).count() + Weibo.objects.filter(
organization_id=i.id).count() + Toutiao.objects.filter(organization_id=i.id).count() + Qita.objects.filter( organization_id=i.id).count() + Toutiao.objects.filter(organization_id=i.id).count() + Qita.objects.filter(
@ -345,40 +455,42 @@ def organization_delete(request, pk):
def organization_update(request, pk): def organization_update(request, pk):
organization = Organization.objects.get(id=pk) organization = Organization.objects.get(id=pk)
organizationtype = Organizationtype.objects.all() organizationtype = Organizationtype.objects.all()
level = Level.objects.all()
if request.method == 'POST': if request.method == 'POST':
name = request.POST.get('name') name = request.POST.get('name')
image = request.FILES.get('image') image = request.FILES.get('image')
organizationtype = request.POST.get('organizationtype') organizationtype = request.POST.get('organizationtype')
province = request.POST.get('province') province = request.POST.get('province')
level_id = request.POST.get('level')
if province != '' and province.isdigit(): if province != '' and province.isdigit():
province_r = Area_code_2020.objects.get(code=province).name
else:
province_r = province province_r = province
else:
province_r = Area_code_2020.objects.get(name=province).code
city = request.POST.get('city') city = request.POST.get('city')
if city != '' and city.isdigit(): if city != '' and city.isdigit():
city_r = Area_code_2020.objects.get(code=city).name
else:
city_r = city city_r = city
else:
city_r = Area_code_2020.objects.get(name=city).code
district = request.POST.get('district') district = request.POST.get('district')
if district != '' and district.isdigit(): if district != '' and district.isdigit():
district_r = Area_code_2020.objects.get(code=district).name
else:
district_r = district district_r = district
else:
district_r = Area_code_2020.objects.get(name=district).code
town = request.POST.get('town') town = request.POST.get('town')
if town != '' and town.isdigit(): if town != '' and town.isdigit():
town_r = Area_code_2020.objects.get(code=town).name
else:
town_r = town town_r = town
else:
town_r = Area_code_2020.objects.get(name=town).code
village = request.POST.get('village') village = request.POST.get('village')
if village != '' and village.isdigit(): if village != '' and village.isdigit():
village_r = Area_code_2020.objects.get(code=village).name
else:
village_r = village village_r = village
else:
village_r = Area_code_2020.objects.get(name=village).code
if name is not None: if name is not None:
if image is not None: if image is not None:
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype, Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
province=province_r, cities=city_r, district=district_r, province=province_r, cities=city_r, district=district_r,
town=town_r, village=village_r) town=town_r, village=village_r,level_id=level_id)
o = Organization.objects.get(id=pk) o = Organization.objects.get(id=pk)
o.image = image o.image = image
o.save() o.save()
@ -387,56 +499,41 @@ def organization_update(request, pk):
else: else:
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype, Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
province=province_r, cities=city_r, district=district_r, province=province_r, cities=city_r, district=district_r,
town=town_r, village=village_r) town=town_r, village=village_r,level_id=level_id)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
return render(request, 'management/organization-management-update.html', return render(request, 'management/organization-management-update.html',
{'organization': organization, 'organizationtype': organizationtype}) {'organization': organization, 'organizationtype': organizationtype,'level':level})
def organization_create(request): def organization_create(request):
organizationtype = Organizationtype.objects.all() organizationtype = Organizationtype.objects.all()
level = Level.objects.all()
if request.method == 'POST': if request.method == 'POST':
name = request.POST.get('name') name = request.POST.get('name')
image = request.FILES.get('image') image = request.FILES.get('image')
organizationtype = request.POST.get('organizationtype') organizationtype = request.POST.get('organizationtype')
level_id = request.POST.get('level_id')
province = request.POST.get('province') province = request.POST.get('province')
if province != '': if province != '':
province_r = Area_code_2020.objects.get(code=province).name province = province
else: else:
messages.error(request, '请选择行政区划') messages.error(request, '请选择行政区划')
return HttpResponseRedirect('/management/organization/create/') return HttpResponseRedirect('/management/organization/create/')
city = request.POST.get('city') city = request.POST.get('city')
if city != '':
city_r = Area_code_2020.objects.get(code=city).name
else:
city_r = city
district = request.POST.get('district') district = request.POST.get('district')
if district != '':
district_r = Area_code_2020.objects.get(code=district).name
else:
district_r = district
town = request.POST.get('town') town = request.POST.get('town')
if town != '':
town_r = Area_code_2020.objects.get(code=town).name
else:
town_r = town
village = request.POST.get('village') village = request.POST.get('village')
if village != '':
village_r = Area_code_2020.objects.get(code=village).name
else:
village_r = village
print(province, city)
if name is not None: if name is not None:
organization = Organization(name=name, image=image, organizationtype_id=organizationtype, organization = Organization(name=name, image=image, organizationtype_id=organizationtype,
province=province_r, cities=city_r, district=district_r, town=town_r, province=province, cities=city, district=district, town=town,
village=village_r) village=village,level_id=level_id)
organization.save() organization.save()
messages.success(request, '添加成功') messages.success(request, '添加成功')
else: else:
messages.error(request, '单位名不能为空') messages.error(request, '单位名不能为空')
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
return render(request, 'management/organization-management-create.html', {'organizationtype': organizationtype}) return render(request, 'management/organization-management-create.html', {'organizationtype': organizationtype,'level':level})
def newmedia_management_create_menu(request): def newmedia_management_create_menu(request):
@ -448,7 +545,7 @@ def newmedia_management_create_weixin(request):
weixin_status_choices_list = [] weixin_status_choices_list = []
for w in WEIXIN_STATUS_CHOICES: for w in WEIXIN_STATUS_CHOICES:
weixin_status_choices_list.append(list(w)[1]) weixin_status_choices_list.append(list(w)[1])
organization = Organization.objects.all() organization = Organization.objects.all().order_by('-name')
if request.method == 'POST': if request.method == 'POST':
code = request.POST.get('code') code = request.POST.get('code')
weixinid = request.POST.get('weixinid') weixinid = request.POST.get('weixinid')
@ -487,7 +584,7 @@ def newmedia_management_create_weibo(request):
weibo_status_choices_list = [] weibo_status_choices_list = []
for w in WEIBO_STATUS_CHOICES: for w in WEIBO_STATUS_CHOICES:
weibo_status_choices_list.append(list(w)[1]) weibo_status_choices_list.append(list(w)[1])
organization = Organization.objects.all() organization = Organization.objects.all().order_by('-name')
if request.method == 'POST': if request.method == 'POST':
code = request.POST.get('code') code = request.POST.get('code')
weiboid = request.POST.get('weiboid') weiboid = request.POST.get('weiboid')
@ -527,7 +624,7 @@ def newmedia_management_create_toutiao(request):
toutiao_status_choices_list = [] toutiao_status_choices_list = []
for w in TOUTIAO_STATUS_CHOICES: for w in TOUTIAO_STATUS_CHOICES:
toutiao_status_choices_list.append(list(w)[1]) toutiao_status_choices_list.append(list(w)[1])
organization = Organization.objects.all() organization = Organization.objects.all().order_by('-name')
if request.method == 'POST': if request.method == 'POST':
code = request.POST.get('code') code = request.POST.get('code')
toutiaoid = request.POST.get('toutiaoid') toutiaoid = request.POST.get('toutiaoid')
@ -561,13 +658,52 @@ def newmedia_management_create_toutiao(request):
return render(request, 'management/newmedia-management-create-toutiao.html', return render(request, 'management/newmedia-management-create-toutiao.html',
{'toutiao_status_choices_list': toutiao_status_choices_list, "organization": organization}) {'toutiao_status_choices_list': toutiao_status_choices_list, "organization": organization})
def newmedia_management_create_douyin(request):
DOUYIN_STATUS_CHOICES = Douyin.NEWMEDIA_STATUS_CHOICES
douyin_status_choices_list = []
for w in DOUYIN_STATUS_CHOICES:
douyin_status_choices_list.append(list(w)[1])
print(douyin_status_choices_list)
organization = Organization.objects.all().order_by('-name')
if request.method == 'POST':
code = request.POST.get('code')
douyinid = request.POST.get('douyinid')
alias = request.POST.get('alias')
image = request.FILES.get('image')
organization = request.POST.get('organization')
status = request.POST.get('status')
if code is not None:
if organization is not None:
if image is not None:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image=image,
organization_id=organization, status=status)
douyin.save()
messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
else:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image='douyin.png',
organization_id=organization, status=status)
douyin.save()
messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
else:
messages.success(request, "请选择单位")
return render(request, 'management/newmedia-management-create-douyin.html',
{'douyin_status_choices_list': douyin_status_choices_list,
"organization": organization})
else:
messages.success(request, "抖音号不能为空")
return render(request, 'management/newmedia-management-create-douyin.html',
{'douyin_status_choices_list': douyin_status_choices_list, "organization": organization})
return render(request, 'management/newmedia-management-create-douyin.html',
{'douyin_status_choices_list': douyin_status_choices_list, "organization": organization})
def newmedia_management_create_qita(request): def newmedia_management_create_qita(request):
QITA_STATUS_CHOICES = Qita.NEWMEDIA_STATUS_CHOICES QITA_STATUS_CHOICES = Qita.NEWMEDIA_STATUS_CHOICES
qita_status_choices_list = [] qita_status_choices_list = []
for w in QITA_STATUS_CHOICES: for w in QITA_STATUS_CHOICES:
qita_status_choices_list.append(list(w)[1]) qita_status_choices_list.append(list(w)[1])
organization = Organization.objects.all() organization = Organization.objects.all().order_by('-name')
if request.method == 'POST': if request.method == 'POST':
type = request.POST.get('type') type = request.POST.get('type')
name = request.POST.get('name') name = request.POST.get('name')
@ -607,7 +743,20 @@ def newmedia_management_edit_menu(request):
def newmedia_management_edit_weixin(request): def newmedia_management_edit_weixin(request):
weixin = Weixin.objects.all().order_by('-created') user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
weixin = None
if level == 1:
weixin = Weixin.objects.filter(organization__province=province).order_by('-created')
elif level == 2:
weixin = Weixin.objects.filter(organization__province=province,organization__cities=cities).order_by('-created')
elif level == 3:
weixin = Weixin.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by(
'-created')
paginator = Paginator(weixin, 6) paginator = Paginator(weixin, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -633,7 +782,19 @@ def newmedia_management_edit_weixin(request):
def newmedia_management_edit_weibo(request): def newmedia_management_edit_weibo(request):
weibo = Weibo.objects.all().order_by('-created') user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
weibo = None
if level == 1:
weibo = Weibo.objects.filter(organization__province=province).order_by('-created')
elif level == 2:
weibo = Weibo.objects.filter(organization__province=province,organization__cities=cities).order_by('-created')
elif level == 3:
weibo = Weibo.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by('-created')
paginator = Paginator(weibo, 6) paginator = Paginator(weibo, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -659,7 +820,20 @@ def newmedia_management_edit_weibo(request):
def newmedia_management_edit_toutiao(request): def newmedia_management_edit_toutiao(request):
toutiao = Toutiao.objects.all().order_by('-created') user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
toutiao = None
if level == 1:
toutiao = Toutiao.objects.filter(organization__province=province).order_by('-created')
elif level == 2:
toutiao = Toutiao.objects.filter(organization__province=province,organization__cities=cities).order_by('-created')
elif level == 3:
toutiao = Toutiao.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by(
'-created')
paginator = Paginator(toutiao, 6) paginator = Paginator(toutiao, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -683,9 +857,57 @@ def newmedia_management_edit_toutiao(request):
res.append(o) res.append(o)
return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res}) return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res})
def newmedia_management_edit_douyin(request):
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
douyin = None
if level == 1:
douyin = Douyin.objects.filter(organization__province=province).order_by('-created')
elif level == 2:
douyin = Douyin.objects.filter(organization__province=province,organization__cities=cities).order_by('-created')
elif level == 3:
douyin = Douyin.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by(
'-created')
paginator = Paginator(douyin, 6)
page = int(request.GET.get('page', 1))
try:
douyin = paginator.page(page)
except PageNotAnInteger:
douyin = paginator.page(1)
except EmptyPage:
douyin = paginator.page(paginator.num_pages)
res = []
for w in douyin:
o = dict()
o['id'] = str(w.id)
o['image'] = w.image
o['code'] = w.code
o['douyinid'] = w.douyinid
o['organization'] = w.organization.name
o['organization_type'] = w.organization.organizationtype.organizationtype
o['administrativedivision'] = str(w.organization.province) + '-' + str(w.organization.cities) + '-' + str(
w.organization.district) + '-' + str(w.organization.town) + '-' + str(w.organization.village)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-douyin.html', {'douyin': douyin, 'res': res})
def newmedia_management_edit_qita(request): def newmedia_management_edit_qita(request):
qita = Qita.objects.all().order_by('-created') user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
province = o.province
cities = o.cities
district = o.district
qita = None
if level == 1:
qita = Qita.objects.filter(organization__province=province).order_by('-created')
elif level == 2:
qita = Qita.objects.filter(organization__province=province,organization__cities=cities).order_by('-created')
elif level == 3:
qita = Qita.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by('-created')
paginator = Paginator(qita, 6) paginator = Paginator(qita, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -712,7 +934,7 @@ def newmedia_management_edit_qita(request):
def newmedia_management_update_weixin(request, pk): def newmedia_management_update_weixin(request, pk):
WEIXIN_STATUS_CHOICES = Weixin.WEIXIN_STATUS_CHOICES WEIXIN_STATUS_CHOICES = Weixin.NEWMEDIA_STATUS_CHOICES
weixin_status_choices_list = [] weixin_status_choices_list = []
for w in WEIXIN_STATUS_CHOICES: for w in WEIXIN_STATUS_CHOICES:
weixin_status_choices_list.append(list(w)[1]) weixin_status_choices_list.append(list(w)[1])
@ -755,7 +977,7 @@ def newmedia_management_update_weixin(request, pk):
def newmedia_management_update_weibo(request, pk): def newmedia_management_update_weibo(request, pk):
WEIBO_STATUS_CHOICES = Weibo.WEIBO_STATUS_CHOICES WEIBO_STATUS_CHOICES = Weibo.NEWMEDIA_STATUS_CHOICES
weibo_status_choices_list = [] weibo_status_choices_list = []
for w in WEIBO_STATUS_CHOICES: for w in WEIBO_STATUS_CHOICES:
weibo_status_choices_list.append(list(w)[1]) weibo_status_choices_list.append(list(w)[1])
@ -798,7 +1020,7 @@ def newmedia_management_update_weibo(request, pk):
def newmedia_management_update_toutiao(request, pk): def newmedia_management_update_toutiao(request, pk):
TOUTIAO_STATUS_CHOICES = Toutiao.TOUTIAO_STATUS_CHOICES TOUTIAO_STATUS_CHOICES = Toutiao.NEWMEDIA_STATUS_CHOICES
toutiao_status_choices_list = [] toutiao_status_choices_list = []
for w in TOUTIAO_STATUS_CHOICES: for w in TOUTIAO_STATUS_CHOICES:
toutiao_status_choices_list.append(list(w)[1]) toutiao_status_choices_list.append(list(w)[1])
@ -839,9 +1061,49 @@ def newmedia_management_update_toutiao(request, pk):
{'toutiao': toutiao, 'organization': organization, {'toutiao': toutiao, 'organization': organization,
'toutiao_status_choices_list': toutiao_status_choices_list}) 'toutiao_status_choices_list': toutiao_status_choices_list})
def newmedia_management_update_douyin(request, pk):
DOUYIN_STATUS_CHOICES = Douyin.NEWMEDIA_STATUS_CHOICES
douyin_status_choices_list = []
for w in DOUYIN_STATUS_CHOICES:
douyin_status_choices_list.append(list(w)[1])
douyin = Douyin.objects.get(id=pk)
organization = Organization.objects.all()
if request.method == 'POST':
code = request.POST.get('code')
douyinid = request.POST.get('douyinid')
alias = request.POST.get('alias')
image = request.FILES.get('image')
organization = request.POST.get('organization')
status = request.POST.get('status')
if code is not None:
if organization is not None:
if image is not None:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status)
douyin.image = image
douyin.save()
messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status)
messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else:
messages.success(request, "请选择单位")
return render(request, 'management/newmedia-management-update-douyin.html',
{'douyin': douyin, 'organization': organization,
'douyin_status_choices_list': douyin_status_choices_list})
else:
messages.success(request, "抖音号不能为空")
return render(request, 'management/newmedia-management-update-douyin.html',
{'douyin': douyin, 'organization': organization,
'douyin_status_choices_list': douyin_status_choices_list})
return render(request, 'management/newmedia-management-update-douyin.html',
{'douyin': douyin, 'organization': organization,
'douyin_status_choices_list': douyin_status_choices_list})
def newmedia_management_update_qita(request, pk): def newmedia_management_update_qita(request, pk):
QITA_STATUS_CHOICES = Qita.QITA_STATUS_CHOICES QITA_STATUS_CHOICES = Qita.NEWMEDIA_STATUS_CHOICES
qita_status_choices_list = [] qita_status_choices_list = []
for w in QITA_STATUS_CHOICES: for w in QITA_STATUS_CHOICES:
qita_status_choices_list.append(list(w)[1]) qita_status_choices_list.append(list(w)[1])
@ -904,9 +1166,63 @@ def newmedia_management_delete_toutiao(request, pk):
messages.success(request, "删除成功") messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/') return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/')
def newmedia_management_delete_douyin(request, pk):
douyin = Douyin.objects.get(id=pk)
douyin.delete()
messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
def newmedia_management_delete_qita(request, pk): def newmedia_management_delete_qita(request, pk):
qita = Qita.objects.get(id=pk) qita = Qita.objects.get(id=pk)
qita.delete() qita.delete()
messages.success(request, "删除成功") messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/qita/') return HttpResponseRedirect('/management/newmedia/management/edit/qita/')
def new_management(request):
news = News.objects.all()
news_list = []
for n in news:
o = dict()
o['id'] = str(n.id)
o['title'] = n.title
o['date'] = n.date
o['author'] = n.author
if n.type == '0':
o['type'] = '政策依据'
elif n.type == '1':
o['type'] = '基层动态'
elif n.type == '2':
o['type'] = '外省动态'
elif n.type == '3':
o['type'] = '监测通报'
elif n.type == '4':
o['type'] = '舆情热点'
news_list.append(o)
return render(request,'management/news-management.html',{'news':news_list})
def news_management_create(request):
if request.method == 'POST':
type = request.POST.get('type')
title = request.POST.get('title')
author = request.POST.get('author')
date = request.POST.get('date')
content = request.POST.get('content')
print(str(title), str(content))
news = News(type=type, title=title, author=author, date=date, content=content)
news.save()
messages.success(request, '添加成功!!!')
return HttpResponseRedirect('/add/news/')
type = News.NEWMEDIA_NEWS_CHOICES
results = []
for i in type:
o = dict()
o['choices'] = list(i)[1]
results.append(o)
return render(request, 'management/news-management-create.html', {'type': results})
def news_management_detail(request,pk):
news = News.objects.get(id=pk)
return render(request,'management/news-management-detail.html',{'news':news})
def news_management_delete(request,pk):
news = News.objects.get(id=pk)
news.delete()
messages.success(request,'删除成功')
return HttpResponseRedirect('/management/news/management/')

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -355,7 +355,7 @@ if (typeof jQuery === 'undefined') {
Carousel.prototype.getItemIndex = function (item) { Carousel.prototype.getItemIndex = function (item) {
this.$items = item.parent().children('.item') this.$items = item.parent().children('.item')
return this.$items.index(item || this.$active) return this.$items.data(item || this.$active)
} }
Carousel.prototype.getItemForDirection = function (direction, active) { Carousel.prototype.getItemForDirection = function (direction, active) {

File diff suppressed because one or more lines are too long

6
static/js/d3.v3.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1984,14 +1984,14 @@ jvm.Region.prototype.updateLabelPosition = function(){
this.isImage = !!this.config.style.initial.image; this.isImage = !!this.config.style.initial.image;
this.createShape(); this.createShape();
text = this.getLabelText(config.index); text = this.getLabelText(config.data);
if (this.config.label && text) { if (this.config.label && text) {
this.offsets = this.getLabelOffsets(config.index); this.offsets = this.getLabelOffsets(config.data);
this.labelX = config.cx / this.map.scale - this.map.transX; this.labelX = config.cx / this.map.scale - this.map.transX;
this.labelY = config.cy / this.map.scale - this.map.transY; this.labelY = config.cy / this.map.scale - this.map.transY;
this.label = config.canvas.addText({ this.label = config.canvas.addText({
text: text, text: text,
'data-index': config.index, 'data-index': config.data,
dy: "0.6ex", dy: "0.6ex",
x: this.labelX, x: this.labelX,
y: this.labelY y: this.labelY
@ -2010,7 +2010,7 @@ jvm.Marker.prototype.createShape = function(){
this.shape.remove(); this.shape.remove();
} }
this.shape = this.config.canvas[this.isImage ? 'addImage' : 'addCircle']({ this.shape = this.config.canvas[this.isImage ? 'addImage' : 'addCircle']({
"data-index": this.config.index, "data-index": this.config.data,
cx: this.config.cx, cx: this.config.cx,
cy: this.config.cy cy: this.config.cy
}, this.config.style, this.config.group); }, this.config.style, this.config.group);

View File

@ -5959,7 +5959,7 @@ var accordion = $.widget( "ui.accordion", {
var keyCode = $.ui.keyCode, var keyCode = $.ui.keyCode,
length = this.headers.length, length = this.headers.length,
currentIndex = this.headers.index( event.target ), currentIndex = this.headers.data( event.target ),
toFocus = false; toFocus = false;
switch ( event.keyCode ) { switch ( event.keyCode ) {
@ -6021,7 +6021,7 @@ var accordion = $.widget( "ui.accordion", {
// was active, active panel still exists // was active, active panel still exists
} else { } else {
// make sure active index is correct // make sure active index is correct
options.active = this.headers.index( this.active ); options.active = this.headers.data( this.active );
} }
this._destroyIcons(); this._destroyIcons();
@ -6202,7 +6202,7 @@ var accordion = $.widget( "ui.accordion", {
return; return;
} }
options.active = collapsing ? false : this.headers.index( clicked ); options.active = collapsing ? false : this.headers.data( clicked );
// when the call to ._toggle() comes after the class changes // when the call to ._toggle() comes after the class changes
// it causes a very odd bug in IE 8 (see #6720) // it causes a very odd bug in IE 8 (see #6720)
@ -6285,7 +6285,7 @@ var accordion = $.widget( "ui.accordion", {
that = this, that = this,
adjust = 0, adjust = 0,
down = toShow.length && down = toShow.length &&
( !toHide.length || ( toShow.index() < toHide.index() ) ), ( !toHide.length || ( toShow.data() < toHide.data() ) ),
animate = this.options.animate || {}, animate = this.options.animate || {},
options = down && animate.down || animate, options = down && animate.down || animate,
complete = function() { complete = function() {
@ -6578,7 +6578,7 @@ var menu = $.widget( "ui.menu", {
} }
match = this._filterMenuItems( character ); match = this._filterMenuItems( character );
match = skip && match.index( this.active.next() ) !== -1 ? match = skip && match.data( this.active.next() ) !== -1 ?
this.active.nextAll( ".ui-menu-item" ) : this.active.nextAll( ".ui-menu-item" ) :
match; match;
@ -10147,7 +10147,7 @@ var dialog = $.widget( "ui.dialog", {
}; };
this.originalPosition = { this.originalPosition = {
parent: this.element.parent(), parent: this.element.parent(),
index: this.element.parent().children().index( this.element ) index: this.element.parent().children().data( this.element )
}; };
this.originalTitle = this.element.attr( "title" ); this.originalTitle = this.element.attr( "title" );
this.options.title = this.options.title || this.originalTitle; this.options.title = this.options.title || this.originalTitle;
@ -11203,16 +11203,16 @@ var selectmenu = $.widget( "ui.selectmenu", {
var item = ui.item.data( "ui-selectmenu-item" ); var item = ui.item.data( "ui-selectmenu-item" );
// Prevent inital focus from firing and check if its a newly focused item // Prevent inital focus from firing and check if its a newly focused item
if ( that.focusIndex != null && item.index !== that.focusIndex ) { if ( that.focusIndex != null && item.data !== that.focusIndex ) {
that._trigger( "focus", event, { item: item } ); that._trigger( "focus", event, { item: item } );
if ( !that.isOpen ) { if ( !that.isOpen ) {
that._select( item, event ); that._select( item, event );
} }
} }
that.focusIndex = item.index; that.focusIndex = item.data;
that.button.attr( "aria-activedescendant", that.button.attr( "aria-activedescendant",
that.menuItems.eq( item.index ).attr( "id" ) ); that.menuItems.eq( item.data ).attr( "id" ) );
} }
}) })
.menu( "instance" ); .menu( "instance" );
@ -11524,12 +11524,12 @@ var selectmenu = $.widget( "ui.selectmenu", {
var oldIndex = this.element[ 0 ].selectedIndex; var oldIndex = this.element[ 0 ].selectedIndex;
// Change native select element // Change native select element
this.element[ 0 ].selectedIndex = item.index; this.element[ 0 ].selectedIndex = item.data;
this._setText( this.buttonText, item.label ); this._setText( this.buttonText, item.label );
this._setAria( item ); this._setAria( item );
this._trigger( "select", event, { item: item } ); this._trigger( "select", event, { item: item } );
if ( item.index !== oldIndex ) { if ( item.data !== oldIndex ) {
this._trigger( "change", event, { item: item } ); this._trigger( "change", event, { item: item } );
} }
@ -11537,7 +11537,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
}, },
_setAria: function( item ) { _setAria: function( item ) {
var id = this.menuItems.eq( item.index ).attr( "id" ); var id = this.menuItems.eq( item.data ).attr( "id" );
this.button.attr({ this.button.attr({
"aria-labelledby": id, "aria-labelledby": id,
@ -12917,7 +12917,7 @@ var tabs = $.widget( "ui.tabs", {
if ( $.isArray( options.disabled ) ) { if ( $.isArray( options.disabled ) ) {
options.disabled = $.unique( options.disabled.concat( options.disabled = $.unique( options.disabled.concat(
$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
return that.tabs.index( li ); return that.tabs.data( li );
}) })
) ).sort(); ) ).sort();
} }
@ -12954,7 +12954,7 @@ var tabs = $.widget( "ui.tabs", {
// check for a tab marked active via a class // check for a tab marked active via a class
if ( active === null ) { if ( active === null ) {
active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); active = this.tabs.data( this.tabs.filter( ".ui-tabs-active" ) );
} }
// no active tab, set to false // no active tab, set to false
@ -12965,7 +12965,7 @@ var tabs = $.widget( "ui.tabs", {
// handle numbers: negative, out of range // handle numbers: negative, out of range
if ( active !== false ) { if ( active !== false ) {
active = this.tabs.index( this.tabs.eq( active ) ); active = this.tabs.data( this.tabs.eq( active ) );
if ( active === -1 ) { if ( active === -1 ) {
active = collapsible ? false : 0; active = collapsible ? false : 0;
} }
@ -12988,7 +12988,7 @@ var tabs = $.widget( "ui.tabs", {
_tabKeydown: function( event ) { _tabKeydown: function( event ) {
var focusedTab = $( this.document[0].activeElement ).closest( "li" ), var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ), selectedIndex = this.tabs.data( focusedTab ),
goingForward = true; goingForward = true;
if ( this._handlePageNav( event ) ) { if ( this._handlePageNav( event ) ) {
@ -13140,7 +13140,7 @@ var tabs = $.widget( "ui.tabs", {
// get disabled tabs from class attribute from HTML // get disabled tabs from class attribute from HTML
// this will get converted to a boolean if needed in _refresh() // this will get converted to a boolean if needed in _refresh()
options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
return lis.index( tab ); return lis.data( tab );
}); });
this._processTabs(); this._processTabs();
@ -13162,7 +13162,7 @@ var tabs = $.widget( "ui.tabs", {
// was active, active tab still exists // was active, active tab still exists
} else { } else {
// make sure active index is correct // make sure active index is correct
options.active = this.tabs.index( this.active ); options.active = this.tabs.data( this.active );
} }
this._refresh(); this._refresh();
@ -13425,7 +13425,7 @@ var tabs = $.widget( "ui.tabs", {
return; return;
} }
options.active = collapsing ? false : this.tabs.index( tab ); options.active = collapsing ? false : this.tabs.data( tab );
this.active = clickedIsActive ? $() : tab; this.active = clickedIsActive ? $() : tab;
if ( this.xhr ) { if ( this.xhr ) {
@ -13437,7 +13437,7 @@ var tabs = $.widget( "ui.tabs", {
} }
if ( toShow.length ) { if ( toShow.length ) {
this.load( this.tabs.index( tab ), event ); this.load( this.tabs.data( tab ), event );
} }
this._toggle( event, eventData ); this._toggle( event, eventData );
}, },
@ -13532,7 +13532,7 @@ var tabs = $.widget( "ui.tabs", {
_getIndex: function( index ) { _getIndex: function( index ) {
// meta-function to give users option to provide a href string instead of a numerical index. // meta-function to give users option to provide a href string instead of a numerical index.
if ( typeof index === "string" ) { if ( typeof index === "string" ) {
index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); index = this.anchors.data( this.anchors.filter( "[href$='" + index + "']" ) );
} }
return index; return index;
@ -16579,4 +16579,4 @@ var effectTransfer = $.effects.effect.transfer = function( o, done ) {
})); }));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
static/media/douyin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB