add messagfe

This commit is contained in:
baoliang 2021-02-02 13:22:45 +08:00
parent 523968ffc9
commit 32acb606f9
8 changed files with 46 additions and 46 deletions

View File

@ -254,8 +254,13 @@ UNQUALIFIED_MEDIA_TYPE_CHOICES = (
class UnqualifiedMedia(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
media_id = models.UUIDField('media_id', null=True, blank=True)
name = models.CharField('name',max_length=256, null=True, blank=True)
unit = models.CharField('unit', max_length=256, null=True, blank=True)
type = models.IntegerField(
'Type', choices=UNQUALIFIED_MEDIA_TYPE_CHOICES, default=0)
province = models.CharField('', max_length=256, null=True, blank=True)
cities = models.CharField('', max_length=256, null=True, blank=True)
district = models.CharField('', max_length=256, null=True, blank=True)
result = models.TextField('result', null=True, blank=True)
cou = models.IntegerField('count of update', default=0)
dos = models.IntegerField('days of silent', default=0)

View File

@ -2,23 +2,24 @@
<div class="flex-container">
<div class="row">
<div class="col-xs-12">
<div>
{% if level == '1' or level == '9'%} {% for key, value in
compartments.items %} {% if len(key) != 0 %}
<div style="margin: 5px 15px">
{% if level == '1' or level == '9' %}
{% for key, value in compartments.items %}
{% if key|length != 0 %}
<a
class="btn {{ cities==value|yesno:"btn-primary,btn-default" }}"
href="{% url 'myview' %}?province={{province}}&cities={{value}}&district={{district}}&level={{level}}"
class="btn btn-default {% if cities == key %}btn-primary{% endif %}"
href="{% url 'polls_media_unqualified' %}?province={{province}}&cities={{key}}}&district={{district}}&level={{level}}"
role="button"
>{{value}}</a
>
{% endif%} {% endfor %} {% endif %}
{% if level == '2'%}
{% for key, value in
compartments.items %}
{% endif%}
{% endfor %}
{% endif %}
{% if level == '2'%} {% for key, value in compartments.items %}
{% if key == cities %}
<a
class="btn {{ cities==value|yesno:"btn-primary,btn-default" }}"
href="{% url 'myview' %}?province={{province}}&cities={{value}}&district={{district}}&level={{level}}"
class="btn btn-primary"
href="{% url 'polls_media_unqualified' %}?province={{province}}&cities={{value}}&district={{district}}&level={{level}}"
role="button"
>{{value}}</a
>
@ -30,30 +31,20 @@
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
<th>名称</th>
<th>单位</th>
<th>原因</th>
</tr>
</thead>
<tbody>
{% for m in medias %}
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
<th scope="row">{{m.counter}}</th>
<td>{{m.name}}</td>
<td>{{m.unit}}</td>
<td>{{m.comment}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@ -28,7 +28,8 @@ urlpatterns = [
path('medias/update/', views.update_media, name='polls_update_media'),
path('medias/list/', views.medias, name='polls_medias'),
path('medias/my/', views.my_medias, name='polls_my_medias'),
path('medias/admin/change/', views.media_admin_change, name='polls_media_admin_change'),
path('medias/admin/change/', views.media_admin_change,
name='polls_media_admin_change'),
path('medias/<str:type>/<str:media_id>/',
views.media_detail, name='polls_media_detail'),
path('medias/delete/', views.delete_media, name='polls_delete_media'),
@ -43,6 +44,8 @@ urlpatterns = [
path('monitor/city/ranking/', views.city_ranking, name='polls_city_ranking'),
path('monitor/result/', views.monitor_result,
name='polls_monitor_result'),
path('monitor/media/unqualified',
views.monitor_unqualified_result, name='polls_media_unqualified'),
path('tasks/list/', views.tasks, name='polls_tasks_list'),
path('tasks/create/', views.create_task, name='polls_tasks_create'),
path('tasks/get/', views.get_task, name='polls_tasks_get'),
@ -73,7 +76,8 @@ urlpatterns = [
path('app/intro.html', views.app_intro, name='polls_app_intro'),
path('app/download/', views.download, name='polls_app_download'),
path('app/has/update/', views.has_update, name='polls_app_has_update'),
path('app/profile/image/upload/', views.upload_profile, name='polls_profile_upload'),
path('app/profile/image/upload/', views.upload_profile,
name='polls_profile_upload'),
]
tasks.process_notify_task(repeat=5)

View File

@ -2,7 +2,7 @@ from .user import index, status_500, status_401, polls_login, send_code, registe
from .notice import notices, notice_top, read_notice, pass_notice, reject_notice, detail_notice, unread_notice_count
from .media import medias, my_medias, create_media, update_media, media_detail, delete_media, media_admin_change
from .news import news_list, news_top, news_detail
from .monitor import monitor_statistics, monitor_result, media_statistics, city_ranking
from .monitor import monitor_statistics, monitor_result, media_statistics, city_ranking, monitor_unqualified_result
from .task import tasks, create_task, create_test_task, get_task
from .group import groups, room, is_level1_or_leve2, group_member, group_manager, group_enter, group_leave, pick_groups
from .compartment import compartments

View File

@ -147,17 +147,17 @@ def monitor_result(request):
def monitor_unqualified_result(request):
if request.method == 'POST':
return HttpResponse(status=405)
province = request.GET.get('province')
cities = request.GET.get('cities')
district = request.GET.get('district')
province = request.GET.get('province','')
cities = request.GET.get('cities','')
district = request.GET.get('district','')
version = request.GET.get('version', '0')
level = request.GET.get('level', '0')
q = UnqualifiedMedia.objects.filter(version=version)
if province:
q = q.filter(media__organization__province=province)
q = q.filter(province=province)
if cities:
q = q.filter(media__organization__cities=cities)
q = q.filter(cities=cities)
if district:
q = q.filter(media__organization__district=district)
q = q.filter(district=district)
return render(request, 'polls/monitor_unqualified_result.html', {'medias': q, 'level': level, 'province': province, 'cities': cities, 'district': district, 'compartments': COMPARTMENTS})