This commit is contained in:
baoliang 2020-10-22 18:02:51 +08:00
commit 3927814156
25 changed files with 1379 additions and 698 deletions

View File

@ -2,6 +2,7 @@ import uuid
from django.contrib.auth.models import User
from django.db import models
# 权限等级
@ -22,6 +23,8 @@ class Group_type(models.Model):
def __str__(self):
return self.type
# 矩阵
@ -58,6 +61,7 @@ class Group(models.Model):
def __str__(self):
return self.name
# 矩阵管理员
@ -72,6 +76,8 @@ class Group_admin(models.Model):
def __str__(self):
return self.group.name
# 矩阵成员
@ -87,6 +93,7 @@ class Group_user(models.Model):
def __str__(self):
return self.user.username
# 单位类型
@ -118,8 +125,8 @@ class Organization(models.Model):
directly = models.CharField('单位类型', max_length=256, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True)
#20201014新添加字段
id_code = models.CharField('单位唯一标识码',max_length=256,null=True,blank=True)
# 20201014新添加字段
id_code = models.CharField('单位唯一标识码', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
@ -147,8 +154,8 @@ class Userprofile(models.Model):
Organization, on_delete=models.CASCADE, null=True, blank=True)
# 用户状态:注册进来默认为0为未审核状态审核后status=1
status = models.IntegerField('用户状态', null=True, blank=True, default=0)
#20201017新增字段职位
zhiwei = models.CharField('职位',max_length=256,null=True,blank=True)
# 20201017新增字段职位
zhiwei = models.CharField('职位', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
@ -186,6 +193,15 @@ def create_user_profile(sender, instance, created, **kwargs):
class NewMedia(models.Model):
"""
status:
'0': '已删除',
'1': '添加申请市级审核中',
'2': '添加申请省级审核中',
'3': '正常',
'4': '注销申请市级审核中',
'5': '注销申请省级审核中',
"""
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('微信公众号', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
@ -199,10 +215,11 @@ class NewMedia(models.Model):
remark = models.CharField('备注', null=True, blank=True, max_length=2560)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
#20201015新增字段
identificationcode = models.CharField('新媒体标识码',max_length=256,null=True,blank=True)
function = models.CharField('功能',max_length=256,null=True,blank=True)
articleurl = models.TextField('文章URL',null=True,blank=True)
# 20201015新增字段
identificationcode = models.CharField('新媒体标识码', max_length=256, null=True, blank=True)
function = models.CharField('功能', max_length=256, null=True, blank=True)
articleurl = models.TextField('文章URL', null=True, blank=True)
class Meta:
abstract = True
ordering = ["-created"]
@ -564,6 +581,8 @@ class Douyin_data(models.Model):
def __str__(self):
return self.mewnedia.code
# 其他新媒体
@ -574,6 +593,7 @@ class Qita(NewMedia):
def __str__(self):
return self.qitaid
# 其他新媒体监测
@ -591,6 +611,8 @@ class Qita_jc(models.Model):
def __str__(self):
return self.mewnedia.name
# 5级地名库
@ -635,8 +657,9 @@ class News(models.Model):
def __str__(self):
return self.title
#手机验证码验证表
# 手机验证码验证表
class CheckCode(models.Model):
phone_code = models.CharField('手机验证码',max_length=256,null=True,blank=True)
phone = models.CharField('电话号',max_length=256,null=True,blank=True)
c_time =models.DateTimeField('时间', auto_now_add=True)
phone_code = models.CharField('手机验证码', max_length=256, null=True, blank=True)
phone = models.CharField('电话号', max_length=256, null=True, blank=True)
c_time = models.DateTimeField('时间', auto_now_add=True)

View File

@ -12,300 +12,300 @@
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-envelope"></i>
<span class="badge badge-primary">0</span>
{# <i class="fa fa-envelope"></i>#}
{# <span class="badge badge-primary">0</span>#}
</a>
<ul class="dropdown-menu messages animated fadeIn">
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clarine Vassar</strong>
<span class="time small">- 15 mins ago</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Brooks Latshaw</strong>
<span class="time small">- 45 mins ago</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clementina Brodeur</strong>
<span class="time small">- 1 hour ago</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-4.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Carri Busey</strong>
<span class="time small">- 5 hours ago</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-5.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Melissa Dock</strong>
<span class="time small">- Yesterday</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Verdell Rea</strong>
<span class="time small">- 14th Mar</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Linette Lheureux</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Araceli Boatright</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Messages</span>
</a>
</li>
</ul>
{# <ul class="dropdown-menu messages animated fadeIn">#}
{##}
{# <li class="list">#}
{##}
{# <ul class="dropdown-menu-list list-unstyled ps-scrollbar">#}
{# <li class="unread status-available">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Clarine Vassar</strong>#}
{# <span class="time small">- 15 mins ago</span>#}
{# <span class="profile-status available pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-away">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Brooks Latshaw</strong>#}
{# <span class="time small">- 45 mins ago</span>#}
{# <span class="profile-status away pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-busy">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Clementina Brodeur</strong>#}
{# <span class="time small">- 1 hour ago</span>#}
{# <span class="profile-status busy pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-offline">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-4.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Carri Busey</strong>#}
{# <span class="time small">- 5 hours ago</span>#}
{# <span class="profile-status offline pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-offline">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-5.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Melissa Dock</strong>#}
{# <span class="time small">- Yesterday</span>#}
{# <span class="profile-status offline pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-available">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Verdell Rea</strong>#}
{# <span class="time small">- 14th Mar</span>#}
{# <span class="profile-status available pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-busy">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Linette Lheureux</strong>#}
{# <span class="time small">- 16th Mar</span>#}
{# <span class="profile-status busy pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" status-away">#}
{# <a href="javascript:;">#}
{# <div class="user-img">#}
{# <img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"#}
{# class="img-circle img-inline">#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Araceli Boatright</strong>#}
{# <span class="time small">- 16th Mar</span>#}
{# <span class="profile-status away pull-right"></span>#}
{# </span>#}
{# <span class="desc small">#}
{# Sometimes it takes a lifetime to win a battle.#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{##}
{# </ul>#}
{##}
{# </li>#}
{##}
{# <li class="external">#}
{# <a href="javascript:;">#}
{# <span>Read All Messages</span>#}
{# </a>#}
{# </li>#}
{# </ul>#}
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-bell"></i>
<span class="badge badge-orange">0</span>
</a>
<ul class="dropdown-menu notifications animated fadeIn">
<li class="total">
<span class="small">
You have <strong>3</strong> new notifications.
<a href="javascript:;" class="pull-right">Mark all as Read</a>
</span>
</li>
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Server needs to reboot</strong>
<span class="time small">15 mins ago</span>
</span>
</div>
</a>
</li>
<li class="unread away"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-envelope"></i>
</div>
<div>
<span class="name">
<strong>45 new messages</strong>
<span class="time small">45 mins ago</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Server IP Blocked</strong>
<span class="time small">1 hour ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>10 Orders Shipped</strong>
<span class="time small">5 hours ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>New Comment on blog</strong>
<span class="time small">Yesterday</span>
</span>
</div>
</a>
</li>
<li class=" available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Great Speed Notify</strong>
<span class="time small">14th Mar</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Team Meeting at 6PM</strong>
<span class="time small">16th Mar</span>
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Notifications</span>
</a>
</li>
</ul>
</li>
<li class="hidden-sm hidden-xs searchform">
<div class="input-group">
<span class="input-group-addon input-focus">
<i class="fa fa-search"></i>
</span>
<form action="search-page.html" method="post">
<input type="text" class="form-control animated fadeIn" placeholder="Search & Enter">
<input type='submit' value="">
</form>
</div>
</li>
{# <li class="">#}
{# <a href="#" data-toggle="dropdown" class="toggle">#}
{# <i class="fa fa-bell"></i>#}
{# <span class="badge badge-orange">0</span>#}
{# </a>#}
{# <ul class="dropdown-menu notifications animated fadeIn">#}
{# <li class="total">#}
{# <span class="small">#}
{# You have <strong>3</strong> new notifications.#}
{# <a href="javascript:;" class="pull-right">Mark all as Read</a>#}
{# </span>#}
{# </li>#}
{# <li class="list">#}
{##}
{# <ul class="dropdown-menu-list list-unstyled ps-scrollbar">#}
{# <li class="unread available"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-check"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Server needs to reboot</strong>#}
{# <span class="time small">15 mins ago</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class="unread away"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-envelope"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>45 new messages</strong>#}
{# <span class="time small">45 mins ago</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" busy"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-times"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Server IP Blocked</strong>#}
{# <span class="time small">1 hour ago</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" offline"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-user"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>10 Orders Shipped</strong>#}
{# <span class="time small">5 hours ago</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" offline"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-user"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>New Comment on blog</strong>#}
{# <span class="time small">Yesterday</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" available"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-check"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Great Speed Notify</strong>#}
{# <span class="time small">14th Mar</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{# <li class=" busy"> <!-- available: success, warning, info, error -->#}
{# <a href="javascript:;">#}
{# <div class="notice-icon">#}
{# <i class="fa fa-times"></i>#}
{# </div>#}
{# <div>#}
{# <span class="name">#}
{# <strong>Team Meeting at 6PM</strong>#}
{# <span class="time small">16th Mar</span>#}
{# </span>#}
{# </div>#}
{# </a>#}
{# </li>#}
{##}
{# </ul>#}
{##}
{# </li>#}
{##}
{# <li class="external">#}
{# <a href="javascript:;">#}
{# <span>Read All Notifications</span>#}
{# </a>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# <li class="hidden-sm hidden-xs searchform">#}
{# <div class="input-group">#}
{# <span class="input-group-addon input-focus">#}
{# <i class="fa fa-search"></i>#}
{# </span>#}
{# <form action="search-page.html" method="post">#}
{# <input type="text" class="form-control animated fadeIn" placeholder="Search & Enter">#}
{# <input type='submit' value="">#}
{# </form>#}
{# </div>#}
{# </li>#}
</ul>
</div>
<div class='pull-right'>
@ -324,13 +324,13 @@
<li>
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-wrench"></i>
Settings
设置
</a>
</li>
<li class="last">
<a href="{% url 'dashboard-logout' %}">
<i class="fa fa-lock"></i>
Logout
登出
</a>
</li>
</ul>
@ -338,9 +338,9 @@
</li>
<li class="chat-toggle-wrapper">
{# <a href="#" data-toggle="chatbar" class="toggle_chat">#}
{% for i in user.userprofile_set.all %}
<span>{{ i.name }}</span>
{% endfor %}
{# {% for i in user.userprofile_set.all %}#}
{# <span>{{ i.name }}</span>#}
{# {% endfor %}#}
{# <i class="fa fa-comments"></i>#}
{# <span class="badge badge-warning">9</span>#}
{# </a>#}
@ -349,7 +349,7 @@
{% else %}
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-unstyled">
<ul class="info-menu left-links list-unstyled" style="margin-left: -30%">
<li class="sidebar-toggle-wrap">
<a href="{% url 'dashboard-login' %}" style="margin-right: 50px">
<i class="glyphicon glyphicon-education">登录</i>

View File

@ -1,207 +1,218 @@
{% load startswith %}
{% with request.resolver_match.url_name as url_name %}
<div class="page-sidebar-wrapper" id="main-menu-wrapper" style="min-height: 1000px">
<!-- USER INFO - START -->
<div class="profile-info row">
<div class="page-sidebar-wrapper" id="main-menu-wrapper" style="min-height: 1000px">
<!-- USER INFO - START -->
<div class="profile-info row">
<div class="profile-image col-md-4 col-sm-4 col-xs-4">
<a href="{% url 'dashboard-index' %}">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" class="img-responsive img-circle">
{% endfor %}
</a>
</div>
<div class="profile-details col-md-8 col-sm-8 col-xs-8">
<h3>
{% for u in user.userprofile_set.all %}
<a href="#">{{ u.name }}</a>
{% endfor %}
<!-- Available statuses: online, idle, busy, away and offline -->
<span class="profile-status online"></span>
</h3>
<div class="profile-image col-md-4 col-sm-4 col-xs-4">
<a href="{% url 'dashboard-index' %}">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" class="img-responsive img-circle">
<p class="profile-title">{{ u.organization }}</p>
{% endfor %}
</a>
</div>
</div>
<div class="profile-details col-md-8 col-sm-8 col-xs-8">
<h3>
<a href="#">{{ user.username }}</a>
<!-- Available statuses: online, idle, busy, away and offline -->
<span class="profile-status online"></span>
</h3>
{% for u in user.userprofile_set.all %}
<p class="profile-title">{{ u.organization }}</p>
{% endfor %}
</div>
</div>
<!-- USER INFO - END -->
<!-- USER INFO - END -->
<ul class='wraplist'>
<li {% if url_name == 'monitor-new-media-public-opinion-weixin' %} class="open" {% endif %} >
<a href="{% url 'monitor-new-media-public-opinion-weixin' %}">
<i class="fa fa-th"></i>
<span class="title">新媒体舆情</span>
</a>
</li>
{# <li class="open">#}
<li {% if url_name == 'monitor-timeliness-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-timeliness-monitoring' %}">
<i class="fa fa-map-marker"></i>
<span class="title">时效性监测</span>
{# <span class="arrow "></span>#}
</a>
<ul class='wraplist'>
<li {% if url_name == 'monitor-new-media-public-opinion-weixin' %} class="open" {% endif %} >
<a href="{% url 'monitor-new-media-public-opinion-weixin' %}">
<i class="fa fa-th"></i>
<span class="title">新媒体舆情</span>
</a>
</li>
{# <li class="open">#}
<li {% if url_name == 'monitor-timeliness-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-timeliness-monitoring' %}">
<i class="fa fa-map-marker"></i>
<span class="title">时效性监测</span>
{# <span class="arrow "></span>#}
</a>
{# <ul class="sub-menu">#}
{# <li>#}
{# <a class="" href="">新媒体详情监测</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">页面详情</a>#}
{# </li>#}
{# </ul>#}
</li>
<li {% if url_name == 'monitor-error-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-error-monitoring' %}">
<i class="fa fa-bar-chart"></i>
<span class="title">错别字监测</span>
</a>
</li>
<li {% if url_name == 'monitor-sensitive-word-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-sensitive-word-monitoring' %}">
<i class="fa fa-folder-open"></i>
<span class="title">敏感词监测</span>
</a>
</li>
<li {% if url_name == 'monitor-comment-on-interactive-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-comment-on-interactive-monitoring' %}">
<i class="fa fa-th"></i>
<span class="title">评论互动监测</span>
</a>
</li>
<li {% if url_name == 'monitor-monitoring-report' %} class="open" {% endif %}>
<a href="{% url 'monitor-monitoring-report' %}">
<i class="fa fa-suitcase"></i>
<span class="title">监测报告</span>
</a>
</li>
<li {% if url_name|startswith:'group' %}class="open" {% endif %}>
<a href="{% url 'group-management-management-init' %}">
<i class="fa fa-sliders"></i>
<span class="title">矩阵管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'group-management-create' %} class="active" {% endif %}
href="{% url 'group-management-create' %}">新建矩阵</a>
</li>
<li>
<a {% if url_name == 'group-management-management-init' %} class="active" {% endif %}
href="{% url 'group-management-management-init' %}">查看矩阵</a>
</li>
{# <li>#}
{# <a class="" href="">搜索添加单位</a>#}
{# </li>#}
</ul>
</li>
<li {% if url_name|startswith:'newmedia' %}class="open" {% endif %}>
<a href="{% url 'newmedia-management-edit-menu' %}">
<i class="fa fa-gift"></i>
<span class="title">新媒体管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">NEW</span>#}
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'newmedia-management-create-menu' %} class="active" {% endif %}
href="{% url 'newmedia-management-create-menu' %}">新建新媒体</a>
</li>
<li>
<a {% if url_name == 'newmedia-management-edit-menu' %} class="active" {% endif %}
href="{% url 'newmedia-management-edit-menu' %}">查看新媒体</a>
</li>
</ul>
</li>
<li {% if url_name|startswith:'organization' %}class="open" {% endif %}>
<a href="{% url 'organization-management-management' %}">
<i class="fa fa-envelope"></i>
<span class="title">主体单位管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">0</span>#}
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'organization-management-create' %} class="active" {% endif %}
href="{% url 'organization-management-create' %}">新建单位</a>
</li>
<li>
<a {% if url_name == 'organization-management-management' %} class="active" {% endif %}
href="{% url 'organization-management-management' %}">查看单位</a>
</li>
</ul>
</li>
<li {% if url_name|startswith:'news' %}class="open" {% endif %}>
<a href="{% url 'news-management' %}">
<i class="fa fa-sliders"></i>
<span class="title">新闻管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'news-management-create' %} class="active" {% endif %}
href="{% url 'news-management-create' %}">发布新闻</a>
</li>
<li>
<a {% if url_name == 'news-management' %} class="active" {% endif %}
href="{% url 'news-management' %}">查看新闻</a>
</li>
</ul>
</li>
<li {% if url_name == 'user-management-management' %} class="open" {% endif %}>
<a href="{% url 'user-management-management' %}">
<i class="fa fa-columns"></i>
<span class="title">用户管理</span>
</a>
</li>
<li {% if url_name == 'user-management-update' %} class="open" {% endif %}>
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-dashboard"></i>
<span class="title">系统设置</span>
</a>
</li>
{# <li class="">#}
{# <a href="javascript:;">#}
{# <i class="fa fa-columns"></i>#}
{# <span class="title">工作首页</span>#}
{# <span class="arrow "></span>#}
{# </a>#}
{# <ul class="sub-menu">#}
{# <li>#}
{# <a class="" href="">新媒体详情监测</a>#}
{# <a class="" href="">工作列表</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">页面详情</a>#}
{# <a class="" href="">考勤管理</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">新闻管理</a>#}
{# </li>#}
{# </ul>#}
</li>
<li {% if url_name == 'monitor-error-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-error-monitoring' %}">
<i class="fa fa-bar-chart"></i>
<span class="title">错别字监测</span>
</a>
</li>
<li {% if url_name == 'monitor-sensitive-word-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-sensitive-word-monitoring' %}">
<i class="fa fa-folder-open"></i>
<span class="title">敏感词监测</span>
</a>
</li>
<li {% if url_name == 'monitor-comment-on-interactive-monitoring' %} class="open" {% endif %}>
<a href="{% url 'monitor-comment-on-interactive-monitoring' %}">
<i class="fa fa-th"></i>
<span class="title">评论互动监测</span>
</a>
</li>
<li {% if url_name == 'monitor-monitoring-report' %} class="open" {% endif %}>
<a href="{% url 'monitor-monitoring-report' %}">
<i class="fa fa-suitcase"></i>
<span class="title">监测报告</span>
</a>
</li>
<li {% if url_name|startswith:'group' %}class="open" {% endif %}>
<a href="javascript:;">
<i class="fa fa-sliders"></i>
<span class="title">矩阵管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'group-management-create' %} class="active" {% endif %} href="{% url 'group-management-create' %}">新建矩阵</a>
</li>
<li>
<a {% if url_name == 'group-management-management-init' %} class="active" {% endif %} href="{% url 'group-management-management-init' %}">编辑矩阵</a>
</li>
{# <li>#}
{# <a class="" href="">搜索添加单位</a>#}
{# </li>#}
</ul>
</li>
<li {% if url_name|startswith:'newmedia' %}class="open" {% endif %}>
<a href="javascript:;">
<i class="fa fa-gift"></i>
<span class="title">新媒体管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">NEW</span>#}
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'newmedia-management-create-menu' %} class="active" {% endif %} href="{% url 'newmedia-management-create-menu' %}">新建新媒体</a>
</li>
<li>
<a {% if url_name == 'newmedia-management-edit-menu' %} class="active" {% endif %} href="{% url 'newmedia-management-edit-menu' %}">编辑新媒体</a>
</li>
</ul>
</li>
<li {% if url_name|startswith:'organization' %}class="open" {% endif %}>
<a href="javascript:;">
<i class="fa fa-envelope"></i>
<span class="title">主体单位管理</span>
<span class="arrow "></span>
{# <span class="arrow "></span><span class="label label-orange">0</span>#}
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'organization-management-create' %} class="active" {% endif %} href="{% url 'organization-management-create' %}">新建单位</a>
</li>
<li>
<a {% if url_name == 'organization-management-management' %} class="active" {% endif %} href="{% url 'organization-management-management' %}">编辑单位</a>
</li>
</ul>
</li>
<li {% if url_name|startswith:'news' %}class="open" {% endif %}>
<a href="javascript:;">
<i class="fa fa-sliders"></i>
<span class="title">新闻管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a {% if url_name == 'news-management-create' %} class="active" {% endif %} href="{% url 'news-management-create' %}">发布新闻</a>
</li>
<li>
<a {% if url_name == 'news-management' %} class="active" {% endif %} href="{% url 'news-management' %}">新闻管理</a>
</li>
</ul>
</li>
<li {% if url_name == 'user-management-management' %} class="open" {% endif %}>
<a href="{% url 'user-management-management' %}">
<i class="fa fa-columns"></i>
<span class="title">用户管理</span>
</a>
</li>
<li {% if url_name == 'user-management-update' %} class="open" {% endif %}>
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-dashboard"></i>
<span class="title">系统设置</span>
</a>
</li>
{# <li class="">#}
{# <a href="javascript:;">#}
{# <i class="fa fa-columns"></i>#}
{# <span class="title">工作首页</span>#}
{# <span class="arrow "></span>#}
{# </a>#}
{# <ul class="sub-menu">#}
{# <li>#}
{# <a class="" href="">工作列表</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">考勤管理</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">新闻管理</a>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# </li>#}
{# <li class=""><a href="javascript:;"> <i class="fa fa-folder-open"></i> <span class="title">Menu Levels</span>#}
{# <span class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 1.1</span> </a></li>#}
{# <li><a href="javascript:;"> <span class="title">Level 1.2</span> <span#}
{# class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 2.1</span> </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 2.2</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 3.1</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.1</span>#}
{# </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.2</span>#}
{# </a></li>#}
{# </ul>#}
{# </li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 3.2</span> </a></li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# <li class=""><a href="javascript:;"> <i class="fa fa-folder-open"></i> <span class="title">Menu Levels</span>#}
{# <span class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 1.1</span> </a></li>#}
{# <li><a href="javascript:;"> <span class="title">Level 1.2</span> <span#}
{# class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 2.1</span> </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 2.2</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 3.1</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.1</span>#}
{# </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.2</span>#}
{# </a></li>#}
{# </ul>#}
{# </li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 3.2</span> </a></li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
</ul>
</div>
</ul>
</div>
{% endwith %}

View File

@ -0,0 +1,145 @@
{% 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 'user-improve-personal-information' usee.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="{{ usee.username }}" disabled>
</div>
</div>
<div class="form-group">
<label class="form-label" for="organization">单位</label>
<div class="input-group main-search">
<input type="text" class="form-control" placeholder="请输入关键字"
style="height: 40px;width: 985px;opacity: .9 "
name="organization">
<div class="input-group-btn" style="display: none">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<div class="autocomplete-panel" style="z-index: 9999">
</div>
</div>
<div class="form-group">
<label class="form-label" for="name">姓名</label>
<div class="controls">
<input type="text" class="form-control" name="name"
>
</div>
</div>
<div class="form-group">
<label class="form-label" for="email">邮箱</label>
<div class="controls">
<input type="text" class="form-control" name="email"
>
</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 for="password">密码<br/>
<input type="password" name="password" id="user_pass" class="input"
value="" size="20"/></label>
</div>
<div class="form-group">
<label for="confirm_password">确认密码<br/>
<input type="password" name="confirm_password" id="user_pass1"
class="input" value=""
size="20"/></label>
</div>
<button type="submit" class="btn btn-primary" style="margin-top: 50px">提交
</button>
</form>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows "></div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script>
$(function () {
$('.main-search input').focus(function (e) {
e.preventDefault();
$("#history_query").hide()
var width = $(this).width();
var position = $(this).position();
var val = $(this).val();
var params = {keyword: val}
if (val) {
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params));
}
$('.autocomplete-panel').css({
width: width + 12,
top: position.top + 34,
left: position.left + 5
}).show();
}).blur(function (e) {
e.preventDefault();
}).on('input', function (e) {
var val = $(this).val();
var params = {keyword: val}
$('.autocomplete-panel').load('/get/organization/' + '?' + $.param(params))
});
})
</script>
{% endblock %}

View File

@ -7,6 +7,8 @@ urlpatterns = [
path('index/', views.index, name='dashboard-index'),
path('', views.user_login, name='dashboard-login'),
path('user/login/for/phone/', views.user_login_for_phone, name='dashboard-login-for-phone'),
#手机用户第一次登录后完善个人信息
path('user/improve/personal/information/<str:pk>/',views.improve_personal_information,name = 'user-improve-personal-information'),
#发送手机验证码
path('author/code/',views.author_code,name='author-code'),
path('refresh_captcha/', views.refresh_captcha, name='refresh-captcha'),

View File

@ -2,6 +2,10 @@ import csv
import json
import http.client
import random
from django.contrib.auth.decorators import login_required
from django.contrib.auth.hashers import make_password
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.utils import timezone
import time
from urllib import parse
@ -95,25 +99,30 @@ def user_login_for_phone(request):
p_code = request.POST.get('check_code')
phone = request.POST.get('phone')
print(phone, p_code)
results = CheckCode.objects.filter(phone=18119305139).count()
results = CheckCode.objects.filter(phone=phone).count()
print(str(results) + "11111111111111111")
# try:
res = User.objects.filter(username=phone).count()
if res > 0:
messages.error(request, '您的账号已经存在,请您使用密码登录!!!')
return HttpResponseRedirect('/')
if results > 0:
check_code = CheckCode.objects.get(phone_code=p_code, phone=phone)
if User.objects.filter(username=phone).count() > 0:
user = User.objects.get(username=phone)
login(request, user, backend='django.contrib.auth.backends.ModelBackend')
# check_code.delete()
return HttpResponseRedirect('/index/')
return HttpResponseRedirect('/user/improve/personal/information/%s/' % (user.id))
else:
user = User(username=phone)
user = User(username=phone, last_login=timezone.now())
user.save()
userprofile = Userprofile(user_id=user.id, image='default.png')
userprofile.save()
# userprofile = Userprofile(user_id=user.id, image='default.png')
# userprofile.save()
u = authenticate(username=phone)
login(request, u, backend='django.contrib.auth.backends.ModelBackend')
return HttpResponseRedirect('/index/')
return HttpResponseRedirect('/user/improve/personal/information/%s/' % (user.id))
# if float(time.time()) - float(check_code.c_time) > 60:
# check_code.delete()
# return '验证码超时已被删除'
@ -126,6 +135,46 @@ def user_login_for_phone(request):
return render(request, 'dashboard/login-for-phone.html')
def improve_personal_information(request, pk):
name = None
email = None
image = None
password = None
confirm_password = None
o_id = None
user = User.objects.get(id=pk)
if request.method == 'POST':
o = request.POST.get('organization')
if Organization.objects.get(name=o):
o_id = Organization.objects.get(name=o).id
else:
messages.error(request,'您填写的单位不存在!!!')
if request.POST.get('name'):
name = request.POST.get('name')
else:
messages.error(request,'请输入您的姓名!!!')
if request.POST.get('email'):
email = request.POST.get('email')
else:
messages.error(request,'请输入您的邮箱!!!')
if request.FILES.get('image'):
image = request.POST.get('image')
else:
image = '/profile/user_default.jpg'
if request.POST.get('password'):
password = request.POST.get('password')
else:
messages.error(request,'请输入密码')
confirm_password = request.POST.get('confirm_password')
if password is not None and confirm_password is not None:
if password == confirm_password:
User.objects.filter(id=pk).update(email=email,password=make_password(password))
userprofile=Userprofile(name=name,image=image,organization_id=o_id,user_id=user.id)
userprofile.save()
messages.success(request,'修改成功')
return render(request, 'dashboard/user-improve-personal-information.html', {'usee': user})
def author_code(request):
sms_host = "sms.yunpian.com"
voice_host = "voice.yunpian.com"
@ -147,8 +196,7 @@ def author_code(request):
code += ch
print(code)
# tpl_value = {'#dateStart#': '10月1日', '#dateEnd#': '10日', '#type#': '微信公众号', '#name#': code}
tpl_value = {'#code#':code}
tpl_value = {'#code#': code}
params = parse.urlencode({
'apikey': apikey,
@ -192,6 +240,7 @@ def register(request):
flag = False
user_organization = None
sex = None
user_organization = None
hash_key = CaptchaStore.generate_key()
image_url = captcha_image_url(hash_key)
organization = Organization.objects.filter(status='1')
@ -200,7 +249,11 @@ def register(request):
messages.error(request, '请选择单位')
else:
o = request.POST.get('organization')
user_organization = Organization.objects.get(name=o).id
res = Organization.objects.filter(name=o).count()
if res > 0:
user_organization = Organization.objects.get(name=o).id
else:
messages.error(request,'您填写的单位不存在')
if not request.POST.get('name'):
messages.error(request, '请输入姓名')
else:
@ -223,7 +276,7 @@ def register(request):
else:
confirm_password = request.POST.get('confirm_password')
if not request.FILES.get('image'):
messages.error(request, '请选择头像')
image='/profile/user_default.jpg'
else:
image = request.FILES.get('image')
print(str(image) + "1111111111111111111111111111111111111111111")
@ -252,7 +305,7 @@ def register(request):
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:
user = User.objects.create_user(username, email, password,last_login = timezone.now() )
user = User.objects.create_user(username, email, password, last_login=timezone.now())
user.is_active = True
# user.is_staff = True
# user.first_name = phone
@ -347,6 +400,7 @@ def get_organization(request):
def wechat_verify(request):
return HttpResponse("11833201729252855821")
def import_user(request):
with open('F:/总.csv') as csvfile:
reader = csv.reader(csvfile)
@ -366,4 +420,27 @@ def import_user(request):
u.save()
except:
print(phone)
return HttpResponse('ok')
return HttpResponse('ok')
@login_required
def user_search_by_keyword(request):
keytype = request.POST.get('keytype')
keyword = request.POST.get('ketword')
userprofile = None
if keytype == '1':
userprofile = Userprofile.objects.filter(name__contains=keyword)
elif keytype == '2':
userprofile = Userprofile.objects.filter(organization__name__contains=keyword)
paginator = Paginator(userprofile, 6)
page = int(request.GET.get('page', 1))
try:
userprofile = paginator.page(page)
except PageNotAnInteger:
userprofile = paginator.page(1)
except EmptyPage:
userprofile = paginator.page(paginator.num_pages)
for u in userprofile:
o = dict()
o['id'] = str(u.id)
o['name'] = u.name
o['image'] = u.image.url

View File

@ -53,7 +53,11 @@
<div class="controls">
<select class="form-control" name="user">
{% for u in usee %}
<option value="{{ u.id }}">{{ u.username }}</option>
<option value="{{ u.id }}">
{% for i in u.userprofile_set.all %}
{{ i.name }}----{{ u.username }}----{{ i.organization }}
{% endfor %}
</option>
{% endfor %}
</select>
</div>

View File

@ -49,6 +49,28 @@
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
{% if level == 9 %}
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-superuser' %}">所有的矩阵</a></li>
{% endif %}
<form>
<div class="btn-group col-md-2 title"
style="display: inline-block;margin-left: 5%;margin-top: 20px">
<select class="form-control" name="keytype">
<option value="1">矩阵名称</option>
<option value="2">矩阵类型</option>
</select>
</div>
<div class="col-md-3 title" style="margin-top: 20px">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字"
name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h6 class="title pull-right">我共管理{% if admin_count %}{{ admin_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>

View File

@ -41,15 +41,39 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" class="active" style="margin-top: 20px"><a
href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
{% if level == 9 %}
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-superuser' %}">所有的矩阵</a></li>
{% endif %}
<form>
<div class="btn-group col-md-2 title"
style="display: inline-block;margin-left: 5%;margin-top: 20px">
<select class="form-control" name="keytype">
<option value="1">矩阵名称</option>
<option value="2">矩阵类型</option>
</select>
</div>
<div class="col-md-3 title" style="margin-top: 20px">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字"
name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h6 class="title pull-right">我共创建{% if init_count %}{{ init_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">
<div class="row">

View File

@ -0,0 +1,134 @@
{% 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" style="margin-top: 20px"><a
href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
{% if level == 9 %}
<li role="presentation" style="margin-top: 20px" class="active"><a
href="{% url 'group-management-management-superuser' %}">所有的矩阵</a></li>
{% endif %}
<form>
<div class="btn-group col-md-2 title"
style="display: inline-block;margin-left: 5%;margin-top: 20px">
<select class="form-control" name="keytype">
<option value="1">矩阵名称</option>
<option value="2">矩阵类型</option>
</select>
</div>
<div class="col-md-3 title" style="margin-top: 20px">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字"
name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h6 class="title pull-right">共有{% if count %}{{ count }}{% else %}
0{% endif %}个矩阵</h6>
</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>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for r in res_g_i %}
<tr>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><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.user_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

@ -49,6 +49,28 @@
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" class="active" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
{% if level == 9 %}
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-superuser' %}">所有的矩阵</a></li>
{% endif %}
<form>
<div class="btn-group col-md-2 title"
style="display: inline-block;margin-left: 5%;margin-top: 20px">
<select class="form-control" name="keytype">
<option value="1">矩阵名称</option>
<option value="2">矩阵类型</option>
</select>
</div>
<div class="col-md-3 title" style="margin-top: 20px">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字"
name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h6 class="title pull-right">我共加入{% if user_count %}{{ user_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>

View File

@ -41,19 +41,25 @@
<div class="row">
<div class="col-md-8 col-sm-9 col-xs-10">
<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">
<label class="form-label" for="name">矩阵名称</label>
<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 class="form-group">
<label class="form-label" for="user">管理</label>
<label class="form-label" for="user"></label>
<div class="controls">
<select class="form-control" name="user">
{% for u in usee %}
<option value="{{ u.id }}">{{ u.username }}</option>
<option value="{{ u.id }}">
{% for i in u.userprofile_set.all %}
{{ i.name }}----{{ u.username }}----{{ i.organization }}
{% endfor %}
</option>
{% endfor %}
</select>
</div>

View File

@ -23,6 +23,23 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">抖音列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">新媒体名称</option>
<option value="2">责任主体</option>
<option value="3">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">抖音总计:{{ douyin_count }}</h2>
</header>
<div class="content-body">

View File

@ -23,11 +23,29 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">其他新媒体列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">新媒体名称</option>
<option value="2">责任主体</option>
<option value="3">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">其他新媒体总计:{{ qita_count }}</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>

View File

@ -23,6 +23,23 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">头条列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">新媒体名称</option>
<option value="2">责任主体</option>
<option value="3">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">头条总计:{{ toutiao_count }}</h2>
</header>
<div class="content-body">

View File

@ -23,6 +23,24 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">微博列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">新媒体名称</option>
<option value="2">责任主体</option>
<option value="3">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">微博总计:{{ weibo_count }}</h2>
</header>
<div class="content-body">

View File

@ -23,6 +23,23 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">微信公众号列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">新媒体名称</option>
<option value="2">责任主体</option>
<option value="3">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">微信总计:{{ weixin_count }}</h2>
</header>
<div class="content-body">

View File

@ -15,84 +15,94 @@
{% endblock %}
{% block content %}
<body class=" ">
<!-- START TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<div class="container">
<section id="main-content" class=" ">
<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-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;">添加新闻</h3>
</div>
<form action="{% url 'news-management-create' %}" method="post" enctype="multipart/form-data">{% csrf_token %}
<div class="panel-body col-md-12">
<div class="form-group col-md-6">
<label for="title">新闻标题</label>
<input type="text" class="form-control" id="title" placeholder="请填写新闻标题"
name="title">
</div>
<div class="form-group col-md-6">
<label for="title">新闻分类</label>
<select class="form-control" name="type">
{% for t in type %}
<option value="{{ t.choices }}">{{ t.choices }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="panel-body col-md-12">
<div class="form-group col-md-4">
<label for="title">新闻发布者</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="系统管理员">
</div>
<div class="form-group col-md-4">
<label for="date">时间</label>
<input type="date" class="form-control" id="source"
name="date">
</div>
<div class="form-group col-md-4">
<label for="source">来源</label>
<input type="text" class="form-control" id="source"
name="source">
</div>
<div class="form-group col-md-12" >
<label class="form-label" for="image">缩略图
<div class="controls">
<input type="file" name="image">
</div>
</label>
</div>
<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;">添加新闻</h3>
</div>
<div class="row">
<label for="country">正文</label>
<div>
<textarea id="summernote" name="content" class="input-block-level"></textarea>
<form action="{% url 'news-management-create' %}" method="post"
enctype="multipart/form-data">{% csrf_token %}
<div class="panel-body col-md-12">
<div class="form-group col-md-6">
<label for="title">新闻标题</label>
<input type="text" class="form-control" id="title" placeholder="请填写新闻标题"
name="title">
</div>
<div class="form-group col-md-6">
<label for="title">新闻分类</label>
<select class="form-control" name="type">
{% for t in type %}
<option value="{{ t.choices }}">{{ t.choices }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="panel-body col-md-12">
<div class="form-group col-md-4">
<label for="title">新闻发布者</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="系统管理员">
</div>
<div class="form-group col-md-4">
<label for="date">时间</label>
<input type="date" class="form-control" id="source"
name="date">
</div>
<div class="form-group col-md-4">
<label for="source">来源</label>
<input type="text" class="form-control" id="source"
name="source">
</div>
<div class="form-group col-md-12">
<label class="form-label" for="image">缩略图
<div class="controls">
<input type="file" name="image">
</div>
</label>
</div>
</div>
<div style="margin-top: 20px;text-align: center;padding-bottom: 20px">
<button type="submit" class="btn btn-primary ">发布新闻</button>
<div class="row col-md-12">
<label for="country">正文</label>
<div>
<textarea id="summernote" name="content" class="input-block-level"></textarea>
</div>
<div style="margin-top: 20px;text-align: center;padding-bottom: 20px">
<button type="submit" class="btn btn-primary ">发布新闻</button>
</div>
</div>
</div>
</form>
</form>
</section>
</section>
</div>
</body>
{% endblock %}

View File

@ -15,102 +15,114 @@
{% endblock %}
{% block content %}
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<div class="container">
<body class=" ">
<!-- START TOPBAR -->
{% 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;">编辑新闻</h3>
<!-- 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;'>
<form action="{% url 'news-management-update' news.id %}" method="post" enctype="multipart/form-data">{% csrf_token %}
<div class="panel-body col-md-12">
<div class="form-group col-md-6">
<label for="title">新闻标题</label>
<input type="text" class="form-control" id="title" placeholder="请填写新闻标题"
name="title" value="{{ news.title }}">
</div>
<div class="form-group col-md-6">
<label for="title">新闻分类</label>
<select class="form-control" name="type">
{% if news.type == '0' %}
<option value="政策依据">政策依据</option>
{% elif news.type == '1' %}
<option value="基层动态">基层动态</option>
{% elif news.type == '2' %}
<option value="外省动态">外省动态</option>
{% elif news.type == '3' %}
<option value="监测通报">监测通报</option>
{% elif news.type == '4' %}
<option value="舆情热点">舆情热点</option>
{% elif news.type == '5' %}
<option value="通知">通知</option>
{% elif news.type == '6' %}
<option value="重点新闻">重点新闻</option>
{% endif %}
{% for t in type %}
<option value="{{ t.choices }}">{{ t.choices }}</option>
{% 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 %}
</select>
</div>
{% endif %}
<div class="panel-heading" style="margin-top: 100px">
<h3 style="text-align: center;">编辑新闻</h3>
</div>
</div>
<div class="panel-body col-md-12">
<div class="form-group col-md-4">
<label for="title">新闻发布者</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="{{ news.author }}">
</div>
<div class="form-group col-md-4">
<label for="date">时间:</label>{{ news.date }}
<input type="date" class="form-control" id="source"
name="date">
</div>
<div class="form-group col-md-4">
<label for="source">来源</label>
<input type="text" class="form-control" id="source"
name="source" value="{{ news.source }}">
</div>
<div class="form-group col-md-12">
<label class="form-label" for="image">缩略图
{% if news.image %}
<img src="{{ news.image.url }}">
{% endif %}
<div class="controls">
<input type="file" name="image">
<form action="{% url 'news-management-update' news.id %}" method="post"
enctype="multipart/form-data">{% csrf_token %}
<div class="panel-body col-md-12">
<div class="form-group col-md-6">
<label for="title">新闻标题</label>
<input type="text" class="form-control" id="title" placeholder="请填写新闻标题"
name="title" value="{{ news.title }}">
</div>
<div class="form-group col-md-6">
<label for="title">新闻分类</label>
<select class="form-control" name="type">
{% if news.type == '0' %}
<option value="政策依据">政策依据</option>
{% elif news.type == '1' %}
<option value="基层动态">基层动态</option>
{% elif news.type == '2' %}
<option value="外省动态">外省动态</option>
{% elif news.type == '3' %}
<option value="监测通报">监测通报</option>
{% elif news.type == '4' %}
<option value="舆情热点">舆情热点</option>
{% elif news.type == '5' %}
<option value="通知">通知</option>
{% elif news.type == '6' %}
<option value="重点新闻">重点新闻</option>
{% endif %}
{% for t in type %}
<option value="{{ t.choices }}">{{ t.choices }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="panel-body col-md-12">
<div class="form-group col-md-4">
<label for="title">新闻发布者</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="{{ news.author }}">
</div>
<div class="form-group col-md-4">
<label for="date">时间:</label>{{ news.date }}
<input type="date" class="form-control" id="source"
name="date">
</div>
<div class="form-group col-md-4">
<label for="source">来源</label>
<input type="text" class="form-control" id="source"
name="source" value="{{ news.source }}">
</div>
<div class="form-group col-md-12">
<label class="form-label" for="image">缩略图
{% if news.image %}
<img src="{{ news.image.url }}">
{% endif %}
<div class="controls">
<input type="file" name="image">
</div>
</label>
</div>
</label>
</div>
</div>
</div>
<div class="row">
<label for="country">正文</label>
<div class="row col-md-12" >
<label for="country">正文</label>
<div>
<textarea id="summernote" name="content" class="input-block-level">{{ news.content }}</textarea>
</div>
<div>
<textarea id="summernote" name="content"
class="input-block-level">{{ news.content }}</textarea>
</div>
<div style="margin-top: 20px;text-align: center;padding-bottom: 20px">
<button type="submit" class="btn btn-primary ">提交修改</button>
</div>
</div>
</form>
<div style="margin-top: 20px;text-align: center;padding-bottom: 20px">
<button type="submit" class="btn btn-primary ">提交修改</button>
</div>
</div>
</form>
</section>
</section>
</div>
</body>
{% endblock %}

View File

@ -42,6 +42,27 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">新闻列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">政策依据</option>
<option value="2">基层动态</option>
<option value="3">外省动态</option>
<option value="4">监测通报</option>
<option value="5">舆情热点</option>
<option value="6">通知</option>
<option value="7">重点新闻</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">新闻总计:{{ news_count }}</h2>
{# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#}

View File

@ -91,16 +91,16 @@
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="level">权限</label>
<div class="controls">
<select class="form-control" name="level">
{% for l in level %}
<option value="{{ l.id }}">{{ l.name }}</option>
{% endfor %}
</select>
</div>
</div>
{# <div class="form-group">#}
{# <label class="form-label" for="level">权限</label>#}
{# <div class="controls">#}
{# <select class="form-control" name="level">#}
{# {% for l in level %}#}
{# <option value="{{ l.id }}">{{ l.name }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
<button type="submit" class="btn btn-success" style="margin-top: 50px">点击新建
</button>
</form>

View File

@ -42,6 +42,22 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">单位列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">单位名称</option>
<option value="2">行政区划</option>
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">单位总计:{{ organization_count }}</h2>
{# <div class="actions panel_actions pull-right">#}
{# <i class="box_toggle fa fa-chevron-down"></i>#}
@ -60,7 +76,7 @@
<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>
@ -70,12 +86,12 @@
<tbody>
{% for r in res %}
<tr>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center"><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.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.usercount }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.mediacount }}</td>

View File

@ -23,6 +23,23 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">成员列表</h2>
<form>
<div class="btn-group col-md-2 title" style="display: inline-block;margin-left: 5%">
<select class="form-control" name="keytype">
<option value="1">姓名</option>
<option value="2">单位</option>
{# <option value="3">行政区划</option>#}
</select>
</div>
<div class="col-lg-6 title">
<div class="input-group">
<input type="text" class="form-control" placeholder="输入搜索关键字" name="keyword">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
</div>
</form>
<h2 class="title pull-right" style="margin-right: 30px">成员总计:{{ user_count }}</h2>
</header>
<div class="content-body">
@ -45,8 +62,9 @@
{% for u in userallinfo %}
<tr>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ u.image.url }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="text-align: center"><img src="{{ u.image.url }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.organization }}</td>

View File

@ -11,6 +11,7 @@ urlpatterns = [
path('group/management/init/', views.group_management_init, name='group-management-management-init'),
path('group/management/admin/', views.group_management_admin, name='group-management-management-admin'),
path('group/management/user/', views.group_management_user, name='group-management-management-user'),
path('group/management/super/', views.group_management_superuser, name='group-management-management-superuser'),
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'),

View File

@ -31,6 +31,8 @@ def user_management(request):
userpaginator = User.objects.filter(userprofile__organization__province=province,
userprofile__organization__cities=cities,
userprofile__organization__district=district).order_by('-date_joined')
elif level == 9:
userpaginator = User.objects.all().order_by('-date_joined')
userallinfo = []
if userpaginator is not None:
paginator = Paginator(userpaginator, 6)
@ -153,6 +155,8 @@ def user_update(request, pk):
def group_management_init(request):
user = request.user
level = Userprofile.objects.get(user_id=user.id).organization.level.level
print(level)
init_count = Group.objects.filter(user_id=user.id).count()
# 创建的矩阵
group_initer = Group.objects.filter(user_id=user.id).order_by('-created')
@ -176,13 +180,14 @@ def group_management_init(request):
o1['user_count'] = Group_user.objects.filter(group_id=r_g_i.id).count()
o1['status'] = r_g_i.status
res_g_i.append(o1)
return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i,'init_count':init_count})
return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i,'init_count':init_count,'level':level})
@login_required
def group_management_admin(request):
# 管理的矩阵
user = request.user
level = Userprofile.objects.get(user_id=user.id).organization.level.level
admin_count = Group_admin.objects.filter(user_id=user.id).count()
group_admin_list = []
for g_a in Group_admin.objects.filter(user_id=user.id).order_by('-created'):
@ -207,13 +212,14 @@ def group_management_admin(request):
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,'admin_count':admin_count})
return render(request, 'management/group-management-admin.html', {'group': group, 'res_g_a': res_g_a,'admin_count':admin_count,'level':level})
@login_required
def group_management_user(request):
# 加入的矩阵
user = request.user
level = Userprofile.objects.get(user_id=user.id).organization.level.level
user_count = Group_user.objects.filter(user_id=user.id).count()
group_user_list = []
for g_u in Group_user.objects.filter(user_id=user.id).order_by('-created'):
@ -238,7 +244,35 @@ def group_management_user(request):
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,'user_count':user_count})
return render(request, 'management/group-management-user.html', {'group': group, 'res_g_u': res_g_u,'user_count':user_count,'level':level})
@login_required
def group_management_superuser(request):
user = request.user
level = Userprofile.objects.get(user_id=user.id).organization.level.level
count = Group.objects.all().count()
# 创建的矩阵
group = Group.objects.all().order_by('-created')
paginator = Paginator(group, 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_i = []
for r_g_i in group:
o1 = dict()
o1['id'] = str(r_g_i.id)
o1['image'] = r_g_i.image.url
o1['name'] = r_g_i.name
o1['type'] = r_g_i.type
o1['admin_count'] = Group_admin.objects.filter(group_id=r_g_i.id).count()
o1['user_count'] = Group_user.objects.filter(group_id=r_g_i.id).count()
o1['status'] = r_g_i.status
res_g_i.append(o1)
return render(request, 'management/group-management-superuser.html', {'group': group, 'res_g_i': res_g_i,'count':count,'level':level})
@login_required
@ -541,6 +575,8 @@ def organization_management(request):
elif level == 3:
organization = Organization.objects.filter(province=province, cities=cities, district=district).order_by(
'-created')
elif level == 9:
organization = Organization.objects.all().order_by('-created')
if organization is not None:
paginator = Paginator(organization, 6)
page = int(request.GET.get('page', 1))
@ -657,17 +693,17 @@ def organization_update(request, pk):
def organization_create(request):
user = request.user
l = Userprofile.objects.get(user_id=user.id).organization.level.level
if user.is_superuser:
level = Level.objects.filter(level__in=[1, 2, 3, 5, 0])
elif l == '1':
level = Level.objects.filter(level__in=[2, 3, 5, 0])
elif l == '2':
level = Level.objects.filter(level__in=[3, 5, 0])
elif l == '3':
level = Level.objects.filter(level__in=[5, 0])
else:
level = Level.objects.filter(level__in=[0])
# l = Userprofile.objects.get(user_id=user.id).organization.level.level
# if user.is_superuser:
# level = Level.objects.filter(level__in=[1, 2, 3, 5, 0])
# elif l == '1':
# level = Level.objects.filter(level__in=[2, 3, 5, 0])
# elif l == '2':
# level = Level.objects.filter(level__in=[3, 5, 0])
# elif l == '3':
# level = Level.objects.filter(level__in=[5, 0])
# else:
# level = Level.objects.filter(level__in=[0])
if request.method == 'POST':
name = request.POST.get('name')
image = None
@ -677,7 +713,7 @@ def organization_create(request):
image = 'danweimoren.jpg'
# organizationtype = request.POST.get('organizationtype')
level_id = request.POST.get('level_id')
# level_id = request.POST.get('level_id')
province = request.POST.get('province')
if province != '':
province = province
@ -695,15 +731,14 @@ def organization_create(request):
if name is not None:
organization = Organization(name=name, image=image,
province=province, cities=city, district=district, town=town,
village=village, level_id=level_id, status='0')
village=village, level_id='f517fd75-8127-4599-ad6e-72687da63bdd', status='0')
organization.save()
messages.success(request, '添加成功')
return HttpResponseRedirect('/management/organization/create/')
else:
messages.error(request, '单位名不能为空')
return HttpResponseRedirect('/management/organization/create/')
return render(request, 'management/organization-management-create.html',
{'level': level})
return render(request, 'management/organization-management-create.html')
@login_required
@ -966,6 +1001,8 @@ def newmedia_management_edit_weixin(request):
weixin = Weixin.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created')
elif level == 9:
weixin = Weixin.objects.all().order_by('-created')
if weixin is not None:
paginator = Paginator(weixin, 6)
page = int(request.GET.get('page', 1))
@ -979,7 +1016,8 @@ def newmedia_management_edit_weixin(request):
for w in weixin:
o = dict()
o['id'] = str(w.id)
o['image'] = w.image
if w.image:
o['image'] = w.image
o['code'] = w.code
o['weixinid'] = w.weixinid
o['organization'] = w.organization.name
@ -1034,6 +1072,8 @@ def newmedia_management_edit_weibo(request):
elif level == 3:
weibo = Weibo.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by('-created')
elif level == 9:
weibo = Weibo.objects.all().order_by('-created')
if weibo is not None:
paginator = Paginator(weibo, 6)
page = int(request.GET.get('page', 1))
@ -1104,6 +1144,8 @@ def newmedia_management_edit_toutiao(request):
toutiao = Toutiao.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created')
elif level == 9:
toutiao = Toutiao.objects.all().order_by('-created')
if toutiao is not None:
paginator = Paginator(toutiao, 6)
page = int(request.GET.get('page', 1))
@ -1173,6 +1215,8 @@ def newmedia_management_edit_douyin(request):
douyin = Douyin.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created')
elif level == 9:
douyin = Douyin.objects.all().order_by('-created')
if douyin is not None:
paginator = Paginator(douyin, 6)
page = int(request.GET.get('page', 1))
@ -1240,6 +1284,8 @@ def newmedia_management_edit_qita(request):
elif level == 3:
qita = Qita.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by('-created')
elif level == 9:
qita = Qita.objects.all().order_by('-created')
if qita is not None:
paginator = Paginator(qita, 6)
page = int(request.GET.get('page', 1))