This commit is contained in:
xieshen 2020-10-19 11:41:23 +08:00
parent 310a8a7024
commit 156e62fa23
15 changed files with 54 additions and 43 deletions

View File

@ -1,8 +1,7 @@
{% load static %}
<div class='page-topbar '>
<div class='logo-area'>
</div>
<a href="{% url 'dashboard-index' %}"><div class='logo-area'>
</div></a>
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-inline list-unstyled">
@ -323,23 +322,11 @@
</a>
<ul class="dropdown-menu profile animated fadeIn">
<li>
<a href="#settings">
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-wrench"></i>
Settings
</a>
</li>
<li>
<a href="#profile">
<i class="fa fa-user"></i>
Profile
</a>
</li>
<li>
<a href="#help">
<i class="fa fa-info"></i>
Help
</a>
</li>
<li class="last">
<a href="{% url 'dashboard-logout' %}">
<i class="fa fa-lock"></i>

View File

@ -23,6 +23,7 @@ urlpatterns = [
#单位搜索
path('get/organization/',views.get_organization,name='get-organization'),
path('tencent13722515905013783955.txt', views.wechat_verify, name='wechat-verify'),
#导入用户数据用的
path('import/user',views.import_user)
]

View File

@ -43,9 +43,10 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" class="active"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" class="active" 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>
<h6 class="title pull-right">我共管理{% if admin_count %}{{ admin_count }}{% else %}0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">

View File

@ -31,8 +31,6 @@
<div class="pull-left">
<h1 class="title">矩阵管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
@ -43,9 +41,10 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" class="active"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<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>
<h6 class="title pull-right">我共创建{% if init_count %}{{ init_count }}{% else %}0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">

View File

@ -43,9 +43,10 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" class="active"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<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" class="active" style="margin-top: 20px"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共加入{% if user_count %}{{ user_count }}{% else %}0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">抖音列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">抖音总计:{{ douyin_count }}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">其他新媒体列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">其他新媒体总计:{{ qita_count}}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">头条列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">头条总计:{{ toutiao_count }}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">微博列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">微博总计:{{ weibo_count }}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">微信公众号列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">微信总计:{{ weixin_count }}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -42,6 +42,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">新闻列表</h2>
<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>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}

View File

@ -42,6 +42,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">单位列表</h2>
<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>#}
{# <i class="box_setting fa fa-cog" data-toggle="modal" href="#section-settings"></i>#}

View File

@ -23,6 +23,7 @@
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">成员列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">成员总计:{{ user_count }}</h2>
</header>
<div class="content-body">
<div class="row">

View File

@ -14,6 +14,7 @@ from dashboard.models import Userprofile, Group, Organization, Level, Organizati
@login_required
def user_management(request):
user_count = User.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -90,7 +91,7 @@ def user_management(request):
userallinfo.append(o)
print(userallinfo)
return render(request, 'management/user-management.html',
{'userallinfo': userallinfo, 'userpaginator': userpaginator})
{'userallinfo': userallinfo, 'userpaginator': userpaginator,'user_count':user_count})
@login_required
@ -150,7 +151,9 @@ def user_update(request, pk):
@login_required
def group_management_init(request):
user = request.user
init_count = Group.objects.filter(user_id=user.id).count()
# 创建的矩阵
group_initer = Group.objects.filter(user_id=user.id).order_by('-created')
print(group_initer)
@ -173,13 +176,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})
return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i,'init_count':init_count})
@login_required
def group_management_admin(request):
# 管理的矩阵
user = request.user
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'):
group_admin = Group.objects.get(id=g_a.group_id)
@ -203,13 +207,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})
return render(request, 'management/group-management-admin.html', {'group': group, 'res_g_a': res_g_a,'admin_count':admin_count})
@login_required
def group_management_user(request):
# 加入的矩阵
user = request.user
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'):
group_user = Group.objects.get(id=g_u.group_id)
@ -233,7 +238,7 @@ 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})
return render(request, 'management/group-management-user.html', {'group': group, 'res_g_u': res_g_u,'user_count':user_count})
@login_required
@ -518,6 +523,7 @@ def group_delete(request, pk):
@login_required
def organization_management(request):
organization_count = Organization.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
print(o)
@ -577,7 +583,7 @@ def organization_management(request):
organization_id=i.id).count()
res.append(o)
return render(request, 'management/organization-management.html', {"organization": organization, 'res': res})
return render(request, 'management/organization-management.html', {"organization": organization, 'res': res,'organization_count':organization_count})
@login_required
@ -942,6 +948,7 @@ def newmedia_management_edit_menu(request):
@login_required
def newmedia_management_edit_weixin(request):
weixin_count = Weixin.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -1006,11 +1013,12 @@ def newmedia_management_edit_weixin(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-weixin.html', {'weixin': weixin, 'res': res})
return render(request, 'management/newmedia-management-edit-weixin.html', {'weixin': weixin, 'res': res,'weixin_count':weixin_count})
@login_required
def newmedia_management_edit_weibo(request):
weibo_count = Weibo.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -1073,11 +1081,12 @@ def newmedia_management_edit_weibo(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-weibo.html', {'weibo': weibo, 'res': res})
return render(request, 'management/newmedia-management-edit-weibo.html', {'weibo': weibo, 'res': res,'weibo_count':weibo_count})
@login_required
def newmedia_management_edit_toutiao(request):
toutiao_count = Toutiao.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -1141,11 +1150,12 @@ def newmedia_management_edit_toutiao(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res})
return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res,'toutiao_count':toutiao_count})
@login_required
def newmedia_management_edit_douyin(request):
douyin_count = Douyin.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -1209,11 +1219,12 @@ def newmedia_management_edit_douyin(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-douyin.html', {'douyin': douyin, 'res': res})
return render(request, 'management/newmedia-management-edit-douyin.html', {'douyin': douyin, 'res': res,'douyin_count':douyin_count})
@login_required
def newmedia_management_edit_qita(request):
qita_count = Qita.objects.all().count()
user = request.user
o = Organization.objects.get(userprofile__user_id=user.id)
level = o.level.level
@ -1276,7 +1287,7 @@ def newmedia_management_edit_qita(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status
res.append(o)
return render(request, 'management/newmedia-management-edit-qita.html', {'qita': qita, 'res': res})
return render(request, 'management/newmedia-management-edit-qita.html', {'qita': qita, 'res': res,'qita_count':qita_count})
@login_required
@ -1577,6 +1588,7 @@ def newmedia_management_delete_qita(request, pk):
@login_required
def new_management(request):
news_count = News.objects.all().count()
news = News.objects.all()
paginator = Paginator(news, 6)
page = int(request.GET.get('page', 1))
@ -1608,7 +1620,7 @@ def new_management(request):
elif n.type == '6':
o['type'] = '重点新闻'
news_list.append(o)
return render(request, 'management/news-management.html', {'news': news_list, 'new': news})
return render(request, 'management/news-management.html', {'news': news_list, 'new': news,'news_count':news_count})
@login_required

View File

@ -129,7 +129,9 @@ def comment_on_interactive_monitoring_json(request):
c[x] += 1
res = []
for (k, v) in c.most_common(200): # 遍历输出高频词
print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v))
# print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v))
#剔除不是汉字的值
if all(map(lambda c:'\u4e00' <= c <= '\u9fa5',k)):
o = dict()
o['name'] = k
o['value'] = v