changeset 6040:784455464e93

notification template strings: better naming consistency for configuration values add mail_notify_page_(deleted|renamed)_subject rename to mail_notify_page_text (used for changed and deleted and renamed)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 01 Mar 2014 02:27:26 +0100
parents 7b5d4685af44
children a3900f360ad0
files MoinMoin/config/multiconfig.py MoinMoin/events/emailnotify.py MoinMoin/events/notification.py docs/CHANGES
diffstat 4 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sat Mar 01 02:11:32 2014 +0100
+++ b/MoinMoin/config/multiconfig.py	Sat Mar 01 02:27:26 2014 +0100
@@ -1328,20 +1328,24 @@
       ('import_pagename_regex', r'\[\[([^\]]*)\]\]', "Regular expression used to search for target pagename specification."),
       ('import_wiki_addrs', [], "Target mail addresses to consider when importing mail"),
 
+      ('notify_page_text', '%(intro)s%(difflink)s\n\n%(comment)s%(diff)s',
+       "Template for putting together the pieces for the page changed/deleted/renamed notification mail text body"),
       ('notify_page_changed_subject', _('[%(sitename)s] %(trivial)sUpdate of "%(pagename)s" by %(username)s'),
        "Template for the page changed notification mail subject header"),
-      ('notify_page_changed_text', '%(intro)s%(difflink)s\n\n%(comment)s%(diff)s',
-       "Template for the page change notification mail text body"),
       ('notify_page_changed_intro',
        _("Dear Wiki user,\n\n"
          'You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification.\n\n'
          'The "%(pagename)s" page has been changed by %(editor)s:\n'),
        "Template for the page changed notification mail intro text"),
+      ('notify_page_deleted_subject', _('[%(sitename)s] %(trivial)sUpdate of "%(pagename)s" by %(username)s'),
+       "Template for the page deleted notification mail subject header"),
       ('notify_page_deleted_intro',
        _("Dear wiki user,\n\n"
          'You have subscribed to a wiki page "%(sitename)s" for change notification.\n\n'
          'The page "%(pagename)s" has been deleted by %(editor)s:\n\n'),
        "Template for the page deleted notification mail intro text"),
+      ('notify_page_renamed_subject', _('[%(sitename)s] %(trivial)sUpdate of "%(pagename)s" by %(username)s'),
+       "Template for the page renamed notification mail subject header"),
       ('notify_page_renamed_intro',
        _("Dear wiki user,\n\n"
          'You have subscribed to a wiki page "%(sitename)s" for change notification.\n\n'
--- a/MoinMoin/events/emailnotify.py	Sat Mar 01 02:11:32 2014 +0100
+++ b/MoinMoin/events/emailnotify.py	Sat Mar 01 02:27:26 2014 +0100
@@ -69,7 +69,7 @@
     pagename = page.page_name
     username = page.uid_override or user.getUserIdentification(request)
 
-    text = _(cfg.mail_notify_page_changed_text) % locals()
+    text = _(cfg.mail_notify_page_text) % locals()
     return {'subject': subject, 'text': text}
 
 
--- a/MoinMoin/events/notification.py	Sat Mar 01 02:11:32 2014 +0100
+++ b/MoinMoin/events/notification.py	Sat Mar 01 02:27:26 2014 +0100
@@ -68,9 +68,9 @@
     data['editor'] = editor = username = page.uid_override or user.getUserIdentification(request)
 
     trivial = (kwargs.get('trivial') and _("Trivial ")) or ""
-    data['subject'] = _(cfg.mail_notify_page_changed_subject) % locals()
 
     if msgtype == "page_changed":
+        data['subject'] = _(cfg.mail_notify_page_changed_subject) % locals()
         data['text'] = _(cfg.mail_notify_page_changed_intro) % locals()
 
         revisions = kwargs['revisions']
@@ -86,6 +86,7 @@
                 data['diff'] = _("No differences found!\n")
 
     elif msgtype == "page_deleted":
+        data['subject'] = _(cfg.mail_notify_page_deleted_subject) % locals()
         data['text'] = _(cfg.mail_notify_page_deleted_intro) % locals()
 
         revisions = kwargs['revisions']
@@ -99,6 +100,7 @@
 
     elif msgtype == "page_renamed":
         data['old_name'] = oldname = kwargs['old_name']
+        data['subject'] = _(cfg.mail_notify_page_renamed_subject) % locals()
         data['text'] = _(cfg.mail_notify_page_renamed_intro) % locals()
         data['diff'] = ''
 
--- a/docs/CHANGES	Sat Mar 01 02:11:32 2014 +0100
+++ b/docs/CHANGES	Sat Mar 01 02:27:26 2014 +0100
@@ -80,10 +80,11 @@
       subscribers when a page is saved is much faster now, esp. for wikis with
       many users) - see also MoinMoinBugs/GetSubscribersSlow
   * Notification template strings are now configurable via cfg.mail_notify_...
+    * page_text (this puts together the pieces for the mail body, used for all
+      changed / deleted / renamed page mail notifications)
     * page_changed_subject, page_changed_intro
-    * page_deleted_intro
-    * page_renamed_intro
-    * page_changed_text (this puts together the bigger pieces)
+    * page_deleted_subject, page_deleted_intro
+    * page_renamed_subject, page_renamed_intro
     * att_added_subject, att_added_intro
     * att_removed_subject, att_removed_intro
     * user_created_subject, user_created_intro