#add message
This commit is contained in:
parent
519ef557fa
commit
6f70d6f4d2
|
@ -0,0 +1,18 @@
|
||||||
|
<div id="pages" class="text-center">
|
||||||
|
<nav>
|
||||||
|
<ul class="pagination">
|
||||||
|
<li class="step-links">
|
||||||
|
{% if page.has_previous %}
|
||||||
|
<a class='active' href="?page={{ page.previous_page_number }}">上一页</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<span class="current">
|
||||||
|
第{{ page.number }}页 共{{ page.paginator.num_pages }}页</span>
|
||||||
|
|
||||||
|
{% if page.has_next %}
|
||||||
|
<a class='active' href="?page={{ page.next_page_number }}">下一页</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
|
@ -102,6 +102,9 @@ def user_login(request):
|
||||||
if user is not None:
|
if user is not None:
|
||||||
if user.check_password(password):
|
if user.check_password(password):
|
||||||
login(request, user)
|
login(request, user)
|
||||||
|
if Userprofile.objects.get(user_id=user.id).image is None:
|
||||||
|
userpro = Userprofile.objects.get(user_id=user.id)
|
||||||
|
userpro.image = '/profile/user_default.jpg'
|
||||||
return HttpResponseRedirect('/index/')
|
return HttpResponseRedirect('/index/')
|
||||||
else:
|
else:
|
||||||
messages.error(request, '无效的账号')
|
messages.error(request, '无效的账号')
|
||||||
|
|
|
@ -126,83 +126,103 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
<button type="submit" class="btn btn-success">提交修改</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<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>
|
||||||
|
<div class="col-xs-12 col-lg-12 col-md-12">
|
||||||
|
<form action="{% url 'group-user-search' group.id %}"
|
||||||
|
method="post">{% csrf_token %}
|
||||||
|
<div class="col-md-12 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="submit">搜索</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<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 class="metadata-pagination">
|
||||||
|
{% include 'dashboard/paginator/group-user-management-paginate.html' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -90,16 +90,16 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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 w in douyin_status_choices_list %}
|
{# {% for w in douyin_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -96,16 +96,16 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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 w in qita_status_choices_list %}
|
{# {% for w in qita_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -90,16 +90,16 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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 w in toutiao_status_choices_list %}
|
{# {% for w in toutiao_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -90,16 +90,16 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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 w in weibo_status_choices_list %}
|
{# {% for w in weibo_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -90,16 +90,16 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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 w in weixin_status_choices_list %}
|
{# {% for w in weixin_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -97,17 +97,17 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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="{{ douyin.status }}">{{ douyin.status }}</option>
|
{# <option value="{{ douyin.status }}">{{ douyin.status }}</option>#}
|
||||||
{% for w in douyin_status_choices_list %}
|
{# {% for w in douyin_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -104,17 +104,17 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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="{{ qita.status }}">{{ qita.status }}</option>
|
{# <option value="{{ qita.status }}">{{ qita.status }}</option>#}
|
||||||
{% for w in qita_status_choices_list %}
|
{# {% for w in qita_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -97,17 +97,17 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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="{{ toutiao.status }}">{{ toutiao.status }}</option>
|
{# <option value="{{ toutiao.status }}">{{ toutiao.status }}</option>#}
|
||||||
{% for w in toutiao_status_choices_list %}
|
{# {% for w in toutiao_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -97,17 +97,17 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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="{{ weibo.status }}">{{ weibo.status }}</option>
|
{# <option value="{{ weibo.status }}">{{ weibo.status }}</option>#}
|
||||||
{% for w in weibo_status_choices_list %}
|
{# {% for w in weibo_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -97,17 +97,17 @@
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</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="{{ weixin.status }}">{{ weixin.status }}</option>
|
{# <option value="{{ weixin.status }}">{{ weixin.status }}</option>#}
|
||||||
{% for w in weixin_status_choices_list %}
|
{# {% for w in weixin_status_choices_list %}#}
|
||||||
<option value="{{ w }}">{{ w }}</option>
|
{# <option value="{{ w }}">{{ w }}</option>#}
|
||||||
{% endfor %}
|
{# {% endfor %}#}
|
||||||
</select>
|
{# </select>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
</div>
|
{# </div>#}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
<label class="form-label" for="identificationcode">新媒体标识码</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -78,9 +78,9 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{# <div class="metadata-pagination">#}
|
<div class="metadata-pagination">
|
||||||
{# {% include 'dashboard/paginator/user-management-paginate.html' %}#}
|
{% include 'dashboard/paginator/user-management-paginate.html' %}
|
||||||
{# </div>#}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,6 +16,7 @@ urlpatterns = [
|
||||||
path('group/create/', views.group_create, name='group-management-create'),
|
path('group/create/', views.group_create, name='group-management-create'),
|
||||||
path('group/update/<str:pk>/', views.group_update, name='group-management-update'),
|
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/delete/<str:pk>/', views.group_delete, name='group-management-delete'),
|
||||||
|
path('group/user/search/<str:pk>/', views.group_user_search, name='group-user-search'),
|
||||||
|
|
||||||
# 添加矩阵管理员、成员
|
# 添加矩阵管理员、成员
|
||||||
path('get/user/', views.get_user, name='get-user'),
|
path('get/user/', views.get_user, name='get-user'),
|
||||||
|
|
|
@ -342,6 +342,14 @@ def group_update(request, pk):
|
||||||
o['administrativedivision'] = str(Area_code_2020.objects.get(code=str(admin_p)).name)
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=str(admin_p)).name)
|
||||||
g_a_list.append(o)
|
g_a_list.append(o)
|
||||||
group_user = Group_user.objects.filter(group_id=pk)
|
group_user = Group_user.objects.filter(group_id=pk)
|
||||||
|
paginator = Paginator(group_user, 6)
|
||||||
|
page = int(request.GET.get('page', 1))
|
||||||
|
try:
|
||||||
|
group_user = paginator.page(page)
|
||||||
|
except PageNotAnInteger:
|
||||||
|
group_user = paginator.page(1)
|
||||||
|
except EmptyPage:
|
||||||
|
group_user = paginator.page(paginator.num_pages)
|
||||||
g_u_list = []
|
g_u_list = []
|
||||||
for g_u in group_user:
|
for g_u in group_user:
|
||||||
i = dict()
|
i = dict()
|
||||||
|
@ -426,7 +434,7 @@ def group_update(request, pk):
|
||||||
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_c_c_res': g_c_c_res, 'p': p, 'c': c, 'd': d, 't': t,
|
'g_a_list': g_a_list, 'g_u_list': g_u_list, 'g_c_c_res': g_c_c_res, 'p': p, 'c': c, 'd': d, 't': t,
|
||||||
'v': v})
|
'v': v,'page':group_user})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -648,6 +656,7 @@ def organization_management(request):
|
||||||
Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
|
Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
|
||||||
Area_code_2020.objects.get(code=i.district).name)
|
Area_code_2020.objects.get(code=i.district).name)
|
||||||
elif i.province and i.cities:
|
elif i.province and i.cities:
|
||||||
|
print(i.cities)
|
||||||
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
|
||||||
Area_code_2020.objects.get(code=i.cities).name)
|
Area_code_2020.objects.get(code=i.cities).name)
|
||||||
elif i.province:
|
elif i.province:
|
||||||
|
@ -1834,3 +1843,115 @@ def newmedia_detail_weixin(request, pk):
|
||||||
weixin = Weixin.objects.all().order_by('-created')
|
weixin = Weixin.objects.all().order_by('-created')
|
||||||
|
|
||||||
return render(request, 'management/newmedia-detail-weixin.html', {'weixin': weixin})
|
return render(request, 'management/newmedia-detail-weixin.html', {'weixin': weixin})
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def group_user_search(request,pk):
|
||||||
|
keyword = request.POST.get('keyword')
|
||||||
|
group = Group.objects.get(id=pk)
|
||||||
|
p = ''
|
||||||
|
c = ''
|
||||||
|
d = ''
|
||||||
|
t = ''
|
||||||
|
v = ''
|
||||||
|
if group.province != '' and group.province != 'None':
|
||||||
|
p = Area_code_2020.objects.get(code=group.province).name
|
||||||
|
if group.cities and group.cities != 'None':
|
||||||
|
c = Area_code_2020.objects.get(code=group.cities).name
|
||||||
|
if group.district and group.district != 'None':
|
||||||
|
d = Area_code_2020.objects.get(code=group.district).name
|
||||||
|
if group.town and group.town != 'None':
|
||||||
|
t = Area_code_2020.objects.get(code=group.town).name
|
||||||
|
if group.village and group.village != 'None':
|
||||||
|
v = Area_code_2020.objects.get(code=group.village).name
|
||||||
|
group_status_choices_list = []
|
||||||
|
for g in range(2):
|
||||||
|
group_status_choices_list.append(g)
|
||||||
|
GROUP_CLASSIFY_CHOICES = Group.GROUP_CLASSIFY_CHOICES
|
||||||
|
g_c_c_res = []
|
||||||
|
for g_c_c in GROUP_CLASSIFY_CHOICES:
|
||||||
|
g_c_c_res.append([list(g_c_c)[0], list(g_c_c)[1]])
|
||||||
|
group_type = Group_type.objects.all()
|
||||||
|
group_admin = Group_admin.objects.filter(group_id=pk)
|
||||||
|
g_a_list = []
|
||||||
|
for g_a in group_admin:
|
||||||
|
o = dict()
|
||||||
|
o['id'] = str(g_a.id)
|
||||||
|
if Userprofile.objects.get(user_id=g_a.user.id):
|
||||||
|
o['image'] = Userprofile.objects.get(user_id=g_a.user.id).image.url
|
||||||
|
o['username'] = g_a.user.username
|
||||||
|
o['name'] = Userprofile.objects.get(user_id=g_a.user.id).name
|
||||||
|
o['organization'] = Userprofile.objects.get(user_id=g_a.user.id).organization.name
|
||||||
|
|
||||||
|
admin_p = Userprofile.objects.get(user_id=g_a.user_id).organization.province
|
||||||
|
admin_c = Userprofile.objects.get(user_id=g_a.user_id).organization.cities
|
||||||
|
admin_d = Userprofile.objects.get(user_id=g_a.user_id).organization.district
|
||||||
|
admin_t = Userprofile.objects.get(user_id=g_a.user_id).organization.town
|
||||||
|
admin_v = Userprofile.objects.get(user_id=g_a.user_id).organization.village
|
||||||
|
if admin_p and admin_p != 'None' and admin_c and admin_c != 'None' and admin_d and admin_d != 'None' and admin_t and admin_t != 'None' and admin_v and admin_v != 'None':
|
||||||
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=admin_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_d).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_t).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_v).name)
|
||||||
|
elif admin_p and admin_p != 'None' and admin_c and admin_c != 'None' and admin_d and admin_d != 'None' and admin_t and admin_t != 'None':
|
||||||
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=admin_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_d).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_t).name)
|
||||||
|
elif admin_p and admin_p != 'None' and admin_c and admin_c != 'None' and admin_d and admin_d != 'None':
|
||||||
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=admin_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_d).name)
|
||||||
|
elif admin_p and admin_p != 'None' and admin_c and admin_c != 'None':
|
||||||
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=admin_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=admin_c).name)
|
||||||
|
elif admin_p and admin_p != 'None':
|
||||||
|
o['administrativedivision'] = str(Area_code_2020.objects.get(code=str(admin_p)).name)
|
||||||
|
g_a_list.append(o)
|
||||||
|
group_user = Group_user.objects.filter(group_id=pk,user__userprofile__name__contains=keyword)
|
||||||
|
paginator = Paginator(group_user, 6)
|
||||||
|
page = int(request.GET.get('page', 1))
|
||||||
|
try:
|
||||||
|
group_user = paginator.page(page)
|
||||||
|
except PageNotAnInteger:
|
||||||
|
group_user = paginator.page(1)
|
||||||
|
except EmptyPage:
|
||||||
|
group_user = paginator.page(paginator.num_pages)
|
||||||
|
g_u_list = []
|
||||||
|
for g_u in group_user:
|
||||||
|
i = dict()
|
||||||
|
i['id'] = str(g_u.id)
|
||||||
|
i['image'] = Userprofile.objects.get(user_id=g_u.user.id).image.url
|
||||||
|
i['username'] = g_u.user.username
|
||||||
|
i['name'] = Userprofile.objects.get(user_id=g_u.user.id).name
|
||||||
|
i['organization'] = Userprofile.objects.get(user_id=g_u.user.id).organization.name
|
||||||
|
user_p = Userprofile.objects.get(user_id=g_u.user_id).organization.province
|
||||||
|
user_c = Userprofile.objects.get(user_id=g_u.user_id).organization.cities
|
||||||
|
user_d = Userprofile.objects.get(user_id=g_u.user_id).organization.district
|
||||||
|
user_t = Userprofile.objects.get(user_id=g_u.user_id).organization.town
|
||||||
|
user_v = Userprofile.objects.get(user_id=g_u.user_id).organization.village
|
||||||
|
if user_p and user_p != 'None' and user_c and user_c != 'None' and user_d and user_d != 'None' and user_t and user_t != 'None' and user_v and user_v != 'None':
|
||||||
|
i['administrativedivision'] = str(Area_code_2020.objects.get(code=user_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_d).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_t).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_v).name)
|
||||||
|
elif user_p and user_p != 'None' and user_c and user_c != 'None' and user_d and user_d != 'None' and user_t and user_t != 'None':
|
||||||
|
i['administrativedivision'] = str(Area_code_2020.objects.get(code=user_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_d).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_t).name)
|
||||||
|
elif user_p and user_p != 'None' and user_c and user_c != 'None' and user_d and user_d != 'None':
|
||||||
|
i['administrativedivision'] = str(Area_code_2020.objects.get(code=user_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_c).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_d).name)
|
||||||
|
elif user_p and user_p != 'None' and user_c and user_c != 'None':
|
||||||
|
i['administrativedivision'] = str(Area_code_2020.objects.get(code=user_p).name) + '-' + str(
|
||||||
|
Area_code_2020.objects.get(code=user_c).name)
|
||||||
|
elif user_p and user_p != 'None':
|
||||||
|
i['administrativedivision'] = str(Area_code_2020.objects.get(code=str(user_p)).name)
|
||||||
|
g_u_list.append(i)
|
||||||
|
return render(request, 'management/group-management-update.html',
|
||||||
|
{'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_c_c_res': g_c_c_res, 'p': p, 'c': c, 'd': d, 't': t,
|
||||||
|
'v': v, 'page': group_user})
|
|
@ -24,9 +24,9 @@ import pandas as pd
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def new_media_public_opinion_weixin(request):
|
def new_media_public_opinion_weixin(request):
|
||||||
weixin = Weixin.objects.all()
|
# weixin = Weixin.objects.all()
|
||||||
group = Group.objects.all()
|
group = Group.objects.all()
|
||||||
weixin_data = Weixin_data.objects.all()
|
weixin_data = Weixin_data.objects.all()[:10]
|
||||||
res = []
|
res = []
|
||||||
for w in weixin_data:
|
for w in weixin_data:
|
||||||
o = dict()
|
o = dict()
|
||||||
|
@ -40,14 +40,14 @@ def new_media_public_opinion_weixin(request):
|
||||||
o['link'] = w.link
|
o['link'] = w.link
|
||||||
res.append(o)
|
res.append(o)
|
||||||
return render(request, 'monitor/new-media-public-opinion-weixin.html',
|
return render(request, 'monitor/new-media-public-opinion-weixin.html',
|
||||||
{'res': res, 'weixin': weixin, 'group': group})
|
{'res': res, 'group': group})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def new_media_public_opinion_toutiao(request):
|
def new_media_public_opinion_toutiao(request):
|
||||||
toutiao = Toutiao.objects.all()
|
# toutiao = Toutiao.objects.all()
|
||||||
group = Group.objects.all()
|
group = Group.objects.all()
|
||||||
toutiao_data = Toutiao_data.objects.all().order_by('-likenum')
|
toutiao_data = Toutiao_data.objects.all().order_by('-likenum')[:10]
|
||||||
res = []
|
res = []
|
||||||
for t in toutiao_data:
|
for t in toutiao_data:
|
||||||
o = dict()
|
o = dict()
|
||||||
|
@ -55,22 +55,21 @@ def new_media_public_opinion_toutiao(request):
|
||||||
o['code'] = t.toutiao.code
|
o['code'] = t.toutiao.code
|
||||||
o['image'] = t.toutiao.image
|
o['image'] = t.toutiao.image
|
||||||
o['title'] = t.title
|
o['title'] = t.title
|
||||||
o['count'] = t.count
|
|
||||||
o['commentcount'] = t.commentcount
|
o['commentcount'] = t.commentcount
|
||||||
o['reply'] = t.reply
|
o['readnum'] = t.readnum
|
||||||
o['year'] = t.year
|
o['likenum'] = t.likenum
|
||||||
o['month'] = t.month
|
o['shownum'] = t.shownum
|
||||||
o['day'] = t.day
|
o['celltype'] = t.celltype
|
||||||
res.append(o)
|
res.append(o)
|
||||||
return render(request, 'monitor/new-media-public-opinion-toutiao.html',
|
return render(request, 'monitor/new-media-public-opinion-toutiao.html',
|
||||||
{'res': res, 'toutiao': toutiao, 'group': group})
|
{'res': res, 'group': group})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def new_media_public_opinion_douyin(request):
|
def new_media_public_opinion_douyin(request):
|
||||||
douyin = Douyin.objects.all()
|
# douyin = Douyin.objects.all()
|
||||||
group = Group.objects.all()
|
group = Group.objects.all()
|
||||||
douyin_data = Douyin_data.objects.all().order_by('-comment')
|
douyin_data = Douyin_data.objects.all().order_by('-comment')[:10]
|
||||||
res = []
|
res = []
|
||||||
for d in douyin_data:
|
for d in douyin_data:
|
||||||
o = dict()
|
o = dict()
|
||||||
|
@ -84,14 +83,14 @@ def new_media_public_opinion_douyin(request):
|
||||||
o['date'] = d.date
|
o['date'] = d.date
|
||||||
res.append(o)
|
res.append(o)
|
||||||
return render(request, 'monitor/new-media-public-opinion-douyin.html',
|
return render(request, 'monitor/new-media-public-opinion-douyin.html',
|
||||||
{'res': res, 'douyin': douyin, 'group': group})
|
{'res': res, 'group': group})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def new_media_public_opinion_weibo(request):
|
def new_media_public_opinion_weibo(request):
|
||||||
weibo = Weibo.objects.all()
|
# weibo = Weibo.objects.all()
|
||||||
group = Group.objects.all()
|
group = Group.objects.all()
|
||||||
weibo_data = Weibo_data.objects.all().order_by('-like')
|
weibo_data = Weibo_data.objects.all().order_by('-like')[:10]
|
||||||
res = []
|
res = []
|
||||||
for w in weibo_data:
|
for w in weibo_data:
|
||||||
o = dict()
|
o = dict()
|
||||||
|
@ -106,14 +105,14 @@ def new_media_public_opinion_weibo(request):
|
||||||
o['month'] = w.month
|
o['month'] = w.month
|
||||||
o['day'] = w.day
|
o['day'] = w.day
|
||||||
res.append(o)
|
res.append(o)
|
||||||
return render(request, 'monitor/new-media-public-opinion-weibo.html', {'res': res, 'weibo': weibo, 'group': group})
|
return render(request, 'monitor/new-media-public-opinion-weibo.html', {'res': res,'group': group})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def new_media_public_opinion_qita(request):
|
def new_media_public_opinion_qita(request):
|
||||||
qita = Qita.objects.all()
|
# qita = Qita.objects.all()
|
||||||
group = Group.objects.all()
|
group = Group.objects.all()
|
||||||
qita_jc = Qita_jc.objects.all().order_by('-comment')
|
qita_jc = Qita_jc.objects.all().order_by('-comment')[:10]
|
||||||
res = []
|
res = []
|
||||||
for q in qita_jc:
|
for q in qita_jc:
|
||||||
o = dict()
|
o = dict()
|
||||||
|
@ -129,7 +128,7 @@ def new_media_public_opinion_qita(request):
|
||||||
o['month'] = q.month
|
o['month'] = q.month
|
||||||
o['day'] = q.day
|
o['day'] = q.day
|
||||||
res.append(o)
|
res.append(o)
|
||||||
return render(request, 'monitor/new-media-public-opinion-qita.html', {'res': res, 'qita': qita, 'group': group})
|
return render(request, 'monitor/new-media-public-opinion-qita.html', {'res': res, 'group': group})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -768,7 +767,6 @@ def timeliness_monitoring_json(request):
|
||||||
int(TimelinessMonitoring.objects.filter(city='622900000000', date=d.date, results='合格').count()) / int(
|
int(TimelinessMonitoring.objects.filter(city='622900000000', date=d.date, results='合格').count()) / int(
|
||||||
TimelinessMonitoring.objects.filter(city='622900000000', date=d.date).count()), 2) * 100)
|
TimelinessMonitoring.objects.filter(city='622900000000', date=d.date).count()), 2) * 100)
|
||||||
|
|
||||||
print(lanzhou_YIELD)
|
|
||||||
return HttpResponse(json.dumps({
|
return HttpResponse(json.dumps({
|
||||||
"status": "1",
|
"status": "1",
|
||||||
"lanzhou": lanzhou,
|
"lanzhou": lanzhou,
|
||||||
|
|
Loading…
Reference in New Issue