This commit is contained in:
Bob 2020-09-20 19:21:13 +08:00
parent f47cfb0e50
commit 6d6726d21f
19 changed files with 29 additions and 11 deletions

View File

@ -580,12 +580,12 @@
<script src="{% static 'graph/js/echarts.min.js' %}" type="text/javascript"></script> <script src="{% static 'graph/js/echarts.min.js' %}" type="text/javascript"></script>
<script src="{% static 'graph/js/data-count.js' %}" type="text/javascript"></script> <script src="{% static 'graph/js/data-count.js' %}" type="text/javascript"></script>
<script> <script>
$(function () { {#$(function () {#}
var year = '{{ year }}'; {# var year = '{{ year }}';#}
var month_form = '{{ month_from }}'; {# var month_form = '{{ month_from }}';#}
var month_to = '{{ month_to }}'; {# var month_to = '{{ month_to }}';#}
initChart('date-count',year,month_form, month_to); {# initChart('date-count',year,month_form, month_to);#}
}) {# })#}
</script> </script>
{% endblock %} {% endblock %}

View File

@ -38,7 +38,7 @@
</div> </div>
<form action="{% url 'add-news' %}" method="post">{% csrf_token %} <form action="{% url 'news-management-create' %}" method="post">{% csrf_token %}
<div class="panel-body col-md-12"> <div class="panel-body col-md-12">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="title">新闻标题</label> <label for="title">新闻标题</label>
@ -55,16 +55,21 @@
</div> </div>
</div> </div>
<div class="panel-body col-md-12"> <div class="panel-body col-md-12">
<div class="form-group col-md-6"> <div class="form-group col-md-4">
<label for="title">新闻作者</label> <label for="title">新闻作者</label>
<input type="text" class="form-control" id="author" placeholder="请填写新闻作者" <input type="text" class="form-control" id="author" placeholder="请填写新闻作者"
name="author" value="系统管理员"> name="author" value="系统管理员">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-4">
<label for="date">时间</label> <label for="date">时间</label>
<input type="text" class="form-control" id="source" <input type="text" class="form-control" id="source"
name="date"> name="date">
</div> </div>
<div class="form-group col-md-4">
<label for="source">来源</label>
<input type="text" class="form-control" id="source"
name="source">
</div>
</div> </div>
<div class="row"> <div class="row">
<label for="country">正文</label> <label for="country">正文</label>

View File

@ -1206,11 +1206,24 @@ def news_management_create(request):
author = request.POST.get('author') author = request.POST.get('author')
date = request.POST.get('date') date = request.POST.get('date')
content = request.POST.get('content') content = request.POST.get('content')
source = request.POST.get('source')
t = None
if type == '政策依据':
t = '0'
elif type == "基层动态":
t = '1'
elif type == '外省动态':
t = '2'
elif type == '监测通报':
t = '3'
elif type == '舆情热点':
t = '4'
print(str(title), str(content)) print(str(title), str(content))
news = News(type=type, title=title, author=author, date=date, content=content) news = News(type=t, title=title, author=author, date=date, content=content,source=source)
news.save() news.save()
messages.success(request, '添加成功!!!') messages.success(request, '添加成功!!!')
return HttpResponseRedirect('/add/news/') return HttpResponseRedirect('/management/news/management/create/')
type = News.NEWMEDIA_NEWS_CHOICES type = News.NEWMEDIA_NEWS_CHOICES
results = [] results = []
for i in type: for i in type:

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB