You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2012/12/15 00:56:33 UTC
git commit: [#1997] Added option for flash notifications without
artifacts and control of class
Updated Branches:
refs/heads/cj/1997 [created] b854dafa3
[#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/b854dafa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b854dafa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b854dafa
Branch: refs/heads/cj/1997
Commit: b854dafa3aaed20d7305e070046540ed4d90fa84
Parents: 60a070d
Author: Cory Johns <jo...@geek.net>
Authored: Fri Dec 14 23:55:07 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Fri Dec 14 23:55:07 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/b854dafa/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/b854dafa/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>