Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A505BD693 for ; Fri, 14 Dec 2012 23:56:33 +0000 (UTC) Received: (qmail 3989 invoked by uid 500); 14 Dec 2012 23:56:33 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 3973 invoked by uid 500); 14 Dec 2012 23:56:33 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 3965 invoked by uid 99); 14 Dec 2012 23:56:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2012 23:56:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3A3C381D02A; Fri, 14 Dec 2012 23:56:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: [#1997] Added option for flash notifications without artifacts and control of class Message-Id: <20121214235633.3A3C381D02A@tyr.zones.apache.org> Date: Fri, 14 Dec 2012 23:56:33 +0000 (UTC) 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 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 Authored: Fri Dec 14 23:55:07 2012 +0000 Committer: Cory Johns 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(''))}}
{% for n in h.pop_user_notifications() %} -
+
Notification:
{{ n.text }}