allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [08/10] allura git commit: [#8024] ticket:884 Change form for SiteNotification
Date Fri, 08 Jan 2016 18:02:38 GMT
[#8024] ticket:884 Change form for SiteNotification


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b14217d5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b14217d5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b14217d5

Branch: refs/heads/master
Commit: b14217d5838e407a31154720be4e06f1b6dc7f6e
Parents: e21f60d
Author: Denis Kotov <deniskkotov@gmail.com>
Authored: Tue Jan 5 23:26:07 2016 +0200
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 8 12:18:12 2016 -0500

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py                     | 2 +-
 Allura/allura/lib/validators.py                             | 2 +-
 .../site_admin_site_notifications_create_update.html        | 9 +++------
 3 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b14217d5/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 0faebdf..d18248a 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -484,7 +484,7 @@ class SiteNotificationController(object):
             )
         form_value = {}
         form_value['active'] = str(self.note.active)
-        form_value['imressions'] = self.note.impressions
+        form_value['impressions'] = self.note.impressions
         form_value['content'] = self.note.content
         form_value['user_role'] = self.note.user_role if self.note.user_role is not None
else ''
         form_value['page_regex'] = self.note.page_regex if self.note.page_regex is not None
else ''

http://git-wip-us.apache.org/repos/asf/allura/blob/b14217d5/Allura/allura/lib/validators.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/validators.py b/Allura/allura/lib/validators.py
index e0e8e06..39985c7 100644
--- a/Allura/allura/lib/validators.py
+++ b/Allura/allura/lib/validators.py
@@ -307,7 +307,7 @@ class CreateTaskSchema(fe.Schema):
 
 
 class CreateSiteNotificationSchema(fe.Schema):
-    active = fev.StringBool()
+    active = fev.StringBool(if_missing=False)
     impressions = fev.Int(not_empty=True)
     content = fev.UnicodeString(not_empty=True)
     user_role = fev.FancyValidator(not_empty=False, if_empty=None)

http://git-wip-us.apache.org/repos/asf/allura/blob/b14217d5/Allura/allura/templates/site_admin_site_notifications_create_update.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_site_notifications_create_update.html b/Allura/allura/templates/site_admin_site_notifications_create_update.html
index f9ba0ed..3acf0bb 100644
--- a/Allura/allura/templates/site_admin_site_notifications_create_update.html
+++ b/Allura/allura/templates/site_admin_site_notifications_create_update.html
@@ -68,17 +68,14 @@
   <div>
     <label>Active</label>
     <div class="input">
-      <select name="active">
-        <option value="False">No</option>
-        <option value="True" {%- if form_values.get('active') == 'True' -%}selected{%-
endif -%}>Yes</option>
-      </select>
+      <input type="checkbox" name="active" value="yes" {%- if not form_values -%} checked
{%- elif form_values|length and form_values.get('active') -%} checked {% endif %}>
     </div>
     {{error('active')}}
   </div>
   <div>
     <label>Impressions</label>
     <div class="input">
-      <input name="impressions" value="{{form_values.get('impressions', '0')}}" />
+      <input name="impressions" value="{{form_values.get('impressions', '10')}}" />
     </div>
     {{error('impressions')}}
   </div>
@@ -92,7 +89,7 @@
   <div>
     <label>User Role</label>
     <div class="input">
-      <input name="user_role" value="{{form_values.get('user_role', '')}}" />
+      <input name="user_role" value="{{form_values.get('user_role', '')}}" placeholder="e.g.
Admin, Developer"/>
     </div>
     {{error('user_role')}}
   </div>


Mime
View raw message