From fa140461042432a2858a055003d80e3b24535a9a Mon Sep 17 00:00:00 2001 From: "tangshuangpku@hotmail.com" Date: Tue, 7 Jun 2016 00:59:47 +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 --- web/templates/addCluster.html | 2 +- web/templates/create_notification.html | 76 +++++++++++++++++++++++ web/templates/notification.html | 13 ++-- web/web.py | 2 +- web/webViews/notification/notification.py | 7 +++ 5 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 web/templates/create_notification.html diff --git a/web/templates/addCluster.html b/web/templates/addCluster.html index 2b82368..aa68c99 100644 --- a/web/templates/addCluster.html +++ b/web/templates/addCluster.html @@ -35,7 +35,7 @@
-
+
diff --git a/web/templates/create_notification.html b/web/templates/create_notification.html new file mode 100644 index 0000000..b0ffd68 --- /dev/null +++ b/web/templates/create_notification.html @@ -0,0 +1,76 @@ +{% extends "base_AdminLTE.html" %} +{% block title %}Docklet | Create Notification{% endblock %} + +{% block panel_title %}Add New Notifications{% endblock %} + +{% block panel_list %} + +{% endblock %} + +{##} +{% block content %} +
+
+
+
+

Add New Notifications

+ +
+ + +
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + all   + {% for group_name in groups %} + {{ group_name }}   + {% endfor %} +
+
+
+
+ +
+
+ +
+
+
+
+{% endblock %} + +{% block script_src %} + +{% endblock %} \ No newline at end of file diff --git a/web/templates/notification.html b/web/templates/notification.html index c6dd320..75f8e29 100644 --- a/web/templates/notification.html +++ b/web/templates/notification.html @@ -33,12 +33,11 @@
-

test rendering...

- - {% for title in notification_titles %} -

{{ title }}

- {% endfor %} - +

+ + + +

@@ -58,7 +57,7 @@ diff --git a/web/web.py b/web/web.py index 5516cf9..ea498b5 100755 --- a/web/web.py +++ b/web/web.py @@ -358,7 +358,7 @@ def notification_list(): return NotificationView.as_view() -@app.route("/notification/create/", methods=['POST']) +@app.route("/notification/create/", methods=['GET', 'POST']) @administration_required def create_notification(): return CreateNotificationView.as_view() diff --git a/web/webViews/notification/notification.py b/web/webViews/notification/notification.py index c978628..fe83f42 100644 --- a/web/webViews/notification/notification.py +++ b/web/webViews/notification/notification.py @@ -15,6 +15,13 @@ class NotificationView(normalView): class CreateNotificationView(normalView): + template_path = 'create_notification.html' + + @classmethod + def get(cls): + groups = dockletRequest.post('/user/groupNameList/')['groups'] + return cls.render(cls.template_path, groups=groups) + @classmethod def post(cls): dockletRequest.post('/notification/create/', request.form)
{{ notify['title'] }} {{ notify['content'] }} - {% for group_name in notify['groups'] %}{{ group_name }} {% endfor %} + {% for group_name in notify['groups'] %}{{ group_name }}  {% endfor %} {{ notify['create_date'] }} {{ notify['status'] }}