Attachment 'subscribe.patch'

Download

   1 diff -u moin-1.6.0.orig/MoinMoin/theme/__init__.py moin-1.6.0/MoinMoin/theme/__init__.py
   2 --- moin-1.6.0.orig/MoinMoin/theme/__init__.py  2007-11-15 17:07:56.000000000 +0200
   3 +++ moin-1.6.0/MoinMoin/theme/__init__.py       2007-11-29 22:24:04.000000000 +0200
   4 @@ -1204,9 +1204,10 @@
   5          _ = self.request.getText
   6          if self.request.user.isSubscribedTo([page.page_name]):
   7              text = _("Unsubscribe", formatted=False)
   8 +            return page.link_to(self.request, text=text, querystr={'action': 'unsubscribe'}, css_class='nbsubscribe', rel='nofollow')
   9          else:
  10              text = _("Subscribe", formatted=False)
  11 -        return page.link_to(self.request, text=text, querystr={'action': 'subscribe'}, css_class='nbsubscribe', rel='nofollow')
  12 +            return page.link_to(self.request, text=text, querystr={'action': 'subscribe'}, css_class='nbsubscribe', rel='nofollow')
  13 
  14      def quicklinkLink(self, page):
  15          """ Return add/remove quicklink link
  16 
  17 diff -u moin-1.6.0.orig/MoinMoin/action/subscribe.py moin-1.6.0/MoinMoin/action/subscribe.py
  18 --- moin-1.6.0.orig/MoinMoin/action/subscribe.py        2007-10-25 23:27:36.000000000 +0200
  19 +++ moin-1.6.0/MoinMoin/action/subscribe.py     2007-11-29 22:36:57.000000000 +0200
  20 @@ -9,7 +9,7 @@
  21  from MoinMoin.Page import Page
  22 
  23  def execute(pagename, request):
  24 -    """ Subscribe or unsubscribe the user to pagename """
  25 +    """ Subscribe the user to pagename """
  26      _ = request.getText
  27      cfg = request.cfg
  28      msg = None
  29 @@ -29,15 +29,8 @@
  30      elif not request.user.email:
  31          msg = _("Add your email address in your UserPreferences to use subscriptions.", formatted=True)
  32 
  33 -    elif request.user.isSubscribedTo([pagename]):
  34 -        # Try to unsubscribe
  35 -        if request.user.unsubscribe(pagename):
  36 -            msg = _('Your subscription to this page has been removed.', formatted=False)
  37 -        else:
  38 -            msg = _("Can't remove regular expression subscription!", formatted=False) + u' ' + \
  39 -                  _("Edit the subscription regular expressions in your "
  40 -                    "UserPreferences.", formatted=True)
  41 -
  42 +    if request.user.isSubscribedTo([pagename]):
  43 +        msg = _('You are already subscribed to this page.', formatted=False)
  44      else:
  45          # Try to subscribe
  46          if request.user.subscribe(pagename):
  47 @@ -45,4 +38,5 @@
  48          else: # should not happen
  49              msg = _('You could not get subscribed to this page.', formatted=False)
  50 
  51 +
  52      Page(request, pagename).send_page(msg=msg)
  53 
  54 diff -Nu moin-1.6.0.orig/MoinMoin/action/unsubscribe.py moin-1.6.0/MoinMoin/action/unsubscribe.py
  55 --- moin-1.6.0.orig/MoinMoin/action/unsubscribe.py      1970-01-01 02:00:00.000000000 +0200
  56 +++ moin-1.6.0/MoinMoin/action/unsubscribe.py   2007-11-29 22:25:27.000000000 +0200
  57 @@ -0,0 +1,29 @@
  58 +# -*- coding: iso-8859-1 -*-
  59 +"""
  60 +    MoinMoin - unsubscribe from notifications to a page.
  61 +
  62 +    @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
  63 +                2006 MoinMoin:ThomasWaldmann
  64 +    @license: GNU GPL, see COPYING for details.
  65 +"""
  66 +from MoinMoin.Page import Page
  67 +
  68 +def execute(pagename, request):
  69 +    """ Unsubscribe the user from pagename """
  70 +    _ = request.getText
  71 +    cfg = request.cfg
  72 +    msg = None
  73 +
  74 +    if request.user.isSubscribedTo([pagename]):
  75 +        # Try to unsubscribe
  76 +        if request.user.unsubscribe(pagename):
  77 +            msg = _('Your subscription to this page has been removed.', formatted=False)
  78 +        else:
  79 +            msg = _("Can't remove regular expression subscription!", formatted=False) + u' ' + \
  80 +                  _("Edit the subscription regular expressions in your "
  81 +                    "UserPreferences.", formatted=True)
  82 +    else:
  83 +        # The user is not subscribed
  84 +        msg = _('You need to be subscribed to unsubscribe.', formatted=False)
  85 +
  86 +    Page(request, pagename).send_page(msg=msg)
  87 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-12-04 21:39:37, 4.2 KB) [[attachment:cache.test1.6.patch]]
  • [get | view] (2007-12-04 21:38:47, 2.7 KB) [[attachment:cache1.6.patch]]
  • [get | view] (2007-12-04 21:38:57, 2.7 KB) [[attachment:cache1.7.patch]]
  • [get | view] (2007-12-30 21:22:29, 23.1 KB) [[attachment:documentation.patch]]
  • [get | view] (2007-12-11 21:27:01, 10.5 KB) [[attachment:package.patch]]
  • [get | view] (2007-12-11 21:26:48, 3.5 KB) [[attachment:packagetest.patch]]
  • [get | view] (2007-12-04 21:39:22, 3.1 KB) [[attachment:quicklink.patch]]
  • [get | view] (2008-01-29 16:42:22, 171.8 KB) [[attachment:screenschot.png]]
  • [get | view] (2007-12-04 21:42:03, 3.8 KB) [[attachment:subscribe.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.