From e5f22021047b0db7c42766ecd47abcba09471f54 Mon Sep 17 00:00:00 2001 From: "tangshuangpku@hotmail.com" Date: Tue, 7 Jun 2016 00:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/notificationmgr.py | 2 ++ web/templates/notification.html | 31 +++++++++++++++++++++++ web/webViews/notification/notification.py | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/notificationmgr.py b/src/notificationmgr.py index bd5c2e8..332b5f5 100644 --- a/src/notificationmgr.py +++ b/src/notificationmgr.py @@ -45,6 +45,8 @@ class NotificationMgr: 'id': notify.id, 'title': notify.title, 'content': notify.content, + 'create_date': notify.create_date, + 'status': notify.status, 'groups': [group.group_name for group in groups] }) return {'success': 'true', 'data': notify_infos} diff --git a/web/templates/notification.html b/web/templates/notification.html index c0244c4..c6dd320 100644 --- a/web/templates/notification.html +++ b/web/templates/notification.html @@ -34,9 +34,40 @@

test rendering...

+ {% for title in notification_titles %}

{{ title }}

{% endfor %} + +
+ + + + + + + + + + + + + {% for notify in notifications %} + + + + + + + + + {% endfor %} + +
IDTitleContentGroupsCreate DateStatus
{{ notify['id'] }}{{ notify['title'] }}{{ notify['content'] }} + {% for group_name in notify['groups'] %}{{ group_name }} {% endfor %} + {{ notify['create_date'] }}{{ notify['status'] }}
+
+
diff --git a/web/webViews/notification/notification.py b/web/webViews/notification/notification.py index c315b8b..c978628 100644 --- a/web/webViews/notification/notification.py +++ b/web/webViews/notification/notification.py @@ -11,7 +11,7 @@ class NotificationView(normalView): result = dockletRequest.post('/notification/list/') notifications = result['data'] notification_titles = [notify['title'] for notify in notifications] - return cls.render(cls.template_path, notification_titles=notification_titles) + return cls.render(cls.template_path, notifications=notifications, notification_titles=notification_titles) class CreateNotificationView(normalView):