You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/12/19 17:25:53 UTC

[7/48] git commit: [#1997] Added option for flash notifications without artifacts and control of class

[#1997] Added option for flash notifications without artifacts and control of class

Signed-off-by: Cory Johns <jo...@geek.net>


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

Branch: refs/heads/db/4790
Commit: ad9554e1f7ac0d59255ba9993d1df0d665c013c9
Parents: 8bc0066
Author: Cory Johns <jo...@geek.net>
Authored: Fri Dec 14 23:55:07 2012 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Dec 18 21:40:29 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/notification.py              |    7 ++++++-
 Allura/allura/templates/jinja_master/master.html |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ad9554e1/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index 99e699e..ea45045 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -118,7 +118,7 @@ class Notification(MappedClass):
         '''
 
         from allura.model import Project
-        idx = artifact.index()
+        idx = artifact.index() if artifact else None
         subject_prefix = '[%s:%s] ' % (
             c.project.shortname, c.app.config.options.mount_point)
         post = ''
@@ -146,6 +146,11 @@ class Notification(MappedClass):
                 in_reply_to=post.parent_id,
                 author_id=author._id,
                 pubdate=datetime.utcnow())
+        elif topic == 'flash':
+            n = cls(topic=topic,
+                    text=kwargs['text'],
+                    subject=kwargs.pop('subject', ''))
+            return n
         else:
             subject = kwargs.pop('subject', '%s modified by %s' % (
                     idx['title_s'],c.user.get_pref('display_name')))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ad9554e1/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index cc5fc01..df6103a 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -108,7 +108,7 @@
     {{theme_macros.footer(g.year(), g.theme_href(''))}}
     <div id="messages">
         {% for n in h.pop_user_notifications() %}
-          <section class="message info">
+          <section class="message {{ n.subject or 'info' }}">
             <header>Notification:</header>
             <div class="content">{{ n.text }}</div>
           </section>