diff --git a/core/templates/core/add_summary.html b/core/templates/core/add_summary.html new file mode 100644 index 0000000..c7e323c --- /dev/null +++ b/core/templates/core/add_summary.html @@ -0,0 +1,27 @@ +{% extends 'core/base.html' %} + +{% block content %} +

添加汇总记录

+ +
+ {% csrf_token %} + + {% for field in form %} +
+ + {{ field }} + {% if field.help_text %} +
{{ field.help_text }}
+ {% endif %} + {% for error in field.errors %} +
{{ error }}
+ {% endfor %} +
+ {% endfor %} + +
+ + 取消 +
+
+{% endblock %} diff --git a/core/templates/core/base.html b/core/templates/core/base.html index 0d6b793..d29981a 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -49,6 +49,9 @@ + diff --git a/core/templates/core/delete_summary.html b/core/templates/core/delete_summary.html new file mode 100644 index 0000000..38a361d --- /dev/null +++ b/core/templates/core/delete_summary.html @@ -0,0 +1,55 @@ +{% extends 'core/base.html' %} + +{% block content %} +

删除汇总记录

+ +
+

确定要删除以下汇总记录吗?此操作不可恢复。

+
+ +
+
+
汇总记录详情
+
+
+ + + + + + + + + + + + + + + + + + + + + + {% if summary.file %} + + + + + {% endif %} +
日期{{ summary.date }}
分类{{ summary.category.name }}
发言人{{ summary.speaker.name }}
内容{{ summary.content }}
来源{{ summary.source|default:"-" }}
附件 + {{ summary.file.name }} +
+
+
+ +
+ {% csrf_token %} +
+ + 取消 +
+
+{% endblock %} diff --git a/core/templates/core/edit_summary.html b/core/templates/core/edit_summary.html new file mode 100644 index 0000000..50520bd --- /dev/null +++ b/core/templates/core/edit_summary.html @@ -0,0 +1,27 @@ +{% extends 'core/base.html' %} + +{% block content %} +

编辑汇总记录

+ +
+ {% csrf_token %} + + {% for field in form %} +
+ + {{ field }} + {% if field.help_text %} +
{{ field.help_text }}
+ {% endif %} + {% for error in field.errors %} +
{{ error }}
+ {% endfor %} +
+ {% endfor %} + +
+ + 取消 +
+
+{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index ff41d9b..cf7db91 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -138,6 +138,33 @@ {% endif %} + + +
+
+
汇总记录
+ {% if yesterday_summary %} + + {% else %} +

昨日没有汇总记录

+ {% endif %} +
+
diff --git a/core/templates/core/summaries.html b/core/templates/core/summaries.html new file mode 100644 index 0000000..0fcc746 --- /dev/null +++ b/core/templates/core/summaries.html @@ -0,0 +1,59 @@ +{% extends 'core/base.html' %} + +{% block content %} +

汇总记录 ({{ yesterday }})

+ +
+ 添加汇总记录 +
+ +{% if summary_records %} +
+
+
汇总记录列表
+
+
+ + + + + + + + + + + + {% for summary in summary_records %} + + + + + + + + {% endfor %} + +
分类发言人内容来源操作
{{ summary.category.name }}{{ summary.speaker.name }}{{ summary.content|truncatechars:100 }}{{ summary.source|default:"-" }} + {% if summary.file %} + + + + {% endif %} + + + + + + +
+
+
+{% else %} +
+
+

昨日没有汇总记录,点击上方按钮添加

+
+
+{% endif %} +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 8068c73..745fe09 100644 --- a/core/urls.py +++ b/core/urls.py @@ -23,6 +23,12 @@ urlpatterns = [ path('today/insight//edit/', views.edit_today_insight, name='edit_today_insight'), path('today/insight//delete/', views.delete_today_insight, name='delete_today_insight'), + # 汇总记录 + path('summaries/', views.summaries, name='summaries'), + path('summaries/add/', views.add_summary, name='add_summary'), + path('summaries//edit/', views.edit_summary, name='edit_summary'), + path('summaries//delete/', views.delete_summary, name='delete_summary'), + # 家庭事项 path('family-tasks/', views.family_tasks, name='family_tasks'), path('family-tasks/add/', views.add_family_task, name='add_family_task'),