Attachment 'complete_discussion_patch.txt'

Download

   1 # HG changeset patch
   2 # User ReimarBauer <R.Bauer@fz-juelich.de>
   3 # Node ID c1916929014c18db2ea3ede433f6fbc48d67a5f5
   4 # Parent  b3665210e63e6dd6a4d8f719edbf5631b150dbc0
   5 added the possibility of a configurable discussion page and the german localisation too. editbar_excluded = ['Discussion']  is default
   6 
   7 diff -r b3665210e63e -r c1916929014c MoinMoin/config/multiconfig.py
   8 --- a/MoinMoin/config/multiconfig.py	Mon Aug 28 00:28:52 2006 +0200
   9 +++ b/MoinMoin/config/multiconfig.py	Mon Aug 28 01:35:34 2006 +0200
  10 @@ -235,6 +235,8 @@ class DefaultConfig:
  11  
  12      default_markup = 'wiki'
  13      docbook_html_dir = r"/usr/share/xml/docbook/stylesheet/nwalsh/html/" # correct for debian sarge
  14 +
  15 +    editbar_excluded = ['Discussion'] # shows editbar without Discussion link
  16  
  17      editor_default = 'text' # which editor is called when nothing is specified
  18      editor_ui = 'freechoice' # which editor links are shown on user interface
  19 diff -r b3665210e63e -r c1916929014c MoinMoin/i18n/de.MoinMoin.po
  20 --- a/MoinMoin/i18n/de.MoinMoin.po	Mon Aug 28 00:28:52 2006 +0200
  21 +++ b/MoinMoin/i18n/de.MoinMoin.po	Mon Aug 28 01:35:34 2006 +0200
  22 @@ -1935,6 +1935,11 @@ msgstr "%(hits)d Treffer in ungefähr %(
  23  #, python-format
  24  msgid "%.2f seconds"
  25  msgstr "%.2f Sekunden"
  26 +
  27 +msgid "Discussion"
  28 +msgstr "Diskussion"
  29 +
  30 +
  31  
  32  #~ msgid "Required attribute \"%(attrname)s\" missing"
  33  #~ msgstr "Erforderliches Attribut \"%(attrname)s\" fehlt"
  34 diff -r b3665210e63e -r c1916929014c MoinMoin/i18n/en.MoinMoin.po
  35 --- a/MoinMoin/i18n/en.MoinMoin.po	Mon Aug 28 00:28:52 2006 +0200
  36 +++ b/MoinMoin/i18n/en.MoinMoin.po	Mon Aug 28 01:35:34 2006 +0200
  37 @@ -1748,5 +1748,8 @@ msgid "Mail sent OK"
  38  msgid "Mail sent OK"
  39  msgstr ""
  40  
  41 +msgid "Discussion"
  42 +msgstr ""
  43 +
  44  #~ msgid "Attach File"
  45  #~ msgstr "Attachments"
  46 diff -r b3665210e63e -r c1916929014c MoinMoin/theme/__init__.py
  47 --- a/MoinMoin/theme/__init__.py	Mon Aug 28 00:28:52 2006 +0200
  48 +++ b/MoinMoin/theme/__init__.py	Mon Aug 28 01:35:34 2006 +0200
  49 @@ -1027,13 +1027,19 @@ actionsMenuInit('%(label)s');
  50          This is separate method to make it easy to customize the
  51          edtibar in sub classes.
  52          """
  53 -        return [self.editorLink(page),
  54 -                self.infoLink(page),
  55 -                self.subscribeLink(page),
  56 -                self.quicklinkLink(page),
  57 -                self.attachmentsLink(page),
  58 -                self.actionsMenu(page),
  59 -               ]
  60 +        editbar_items = {'Edit': self.editorLink(page),
  61 +                        'Info': self.infoLink(page),
  62 +                        'Subscribe': self.subscribeLink(page),
  63 +                        'Quicklink': self.quicklinkLink(page),
  64 +                        'Attachments': self.attachmentsLink(page),
  65 +                        'Discussion': self.discussionLink(page),
  66 +                        'actions Menu': self.actionsMenu(page)}
  67 +        editbar_keys_ordered = ['Edit', 'Info', 'Subscribe', 'Quicklink', 'Attachments', 'Discussion', 'actions Menu']
  68 +        allowed_action = []
  69 +        for action in editbar_keys_ordered:
  70 +            if action not in self.request.cfg.editbar_excluded:
  71 +                allowed_action.append(editbar_items[action])
  72 +        return allowed_action
  73  
  74      def guiworks(self, page):
  75          """ Return whether the gui editor / converter can work for that page.
  76 @@ -1118,6 +1124,13 @@ var gui_editor_link_text = "%(text)s";
  77          return page.link_to(self.request,
  78                              text=_('Info', formatted=False),
  79                              querystr={'action': 'info'}, id='info', rel='nofollow')
  80 +
  81 +    def discussionLink(self, page):
  82 +        """  discussion for page """
  83 +        _ = self.request.getText
  84 +        return page.link_to(self.request,
  85 +                            text=_('Discussion', formatted=False),
  86 +                            querystr={'action': 'discussion'}, id='discussion', rel='nofollow')
  87  
  88      def subscribeLink(self, page):
  89          """ Return subscribe/unsubscribe link to valid users
  90 diff -r b3665210e63e -r c1916929014c MoinMoin/action/discussion.py
  91 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  92 +++ b/MoinMoin/action/discussion.py	Mon Aug 28 01:35:34 2006 +0200
  93 @@ -0,0 +1,48 @@
  94 +"""
  95 +    MoinMoin - Action for Discussion pages
  96 +
  97 +    This Action is used to create a subpage Discussion below a comon page
  98 +
  99 +    Install:
 100 +        put it into the 'action' directory and do create a DiscussionTemplate
 101 +        
 102 +    Note:
 103 +        derived from the newpage macro by Vito Miliano (vito_moinnewpagewithtemplate@perilith.com) et al
 104 +
 105 +    Modification History:
 106 +       2006-08-25 ReimarBauer initial version
 107 +                   
 108 +    License:
 109 +        @license: GNU GPL, see COPYING for details.  
 110 +        
 111 +"""
 112 +from MoinMoin.Page import Page
 113 +
 114 +
 115 +def execute(pagename, request):
 116 +
 117 +    _ = request.getText
 118 +
 119 +    if pagename.find(_('Discussion')) != -1:
 120 +        redir = pagename.split('/')
 121 +        redir = '/'.join(redir[0:-1])
 122 +        query = {'action': 'edit', 'backto': redir}
 123 +        url = Page(request, pagename).url(request, query, escape=0, relative=False)
 124 +        request.http_redirect(url)
 125 +
 126 +    newpagename = "%s/%s" % (pagename, _('Discussion'))
 127 +
 128 +    if request.user.may.read(newpagename) and request.user.may.write(newpagename):
 129 +        query = {'action': 'edit', 'backto': pagename}
 130 +
 131 +        from MoinMoin.wikiutil import quoteWikinameURL
 132 +        query['template'] = quoteWikinameURL('DiscussionTemplate')
 133 +
 134 +        url = Page(request, newpagename).url(request, query, escape=0, relative=False)
 135 +        request.http_redirect(url)
 136 +
 137 +    else:
 138 +        page = Page(request, pagename)
 139 +        error = _('you don''t have access to the discussion page')
 140 +        page.send_page(request, msg=error)
 141 +        return ' '

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] (2006-08-25 14:32:36, 1.5 KB) [[attachment:Discussion.py]]
  • [get | view] (2006-08-27 23:37:26, 5.6 KB) [[attachment:complete_discussion_patch.txt]]
  • [get | view] (2006-12-02 10:28:16, 3.7 KB) [[attachment:edit_bar.png]]
  • [get | view] (2007-01-10 20:46:57, 0.6 KB) [[attachment:editsupplementation.py]]
  • [get | view] (2006-08-26 16:54:52, 23.9 KB) [[attachment:proposal_buttom.png]]
  • [get | view] (2006-08-26 16:55:05, 21.2 KB) [[attachment:proposal_item.png]]
  • [get | view] (2006-08-26 16:55:18, 103.4 KB) [[attachment:proposal_menu.png]]
  • [get | view] (2006-08-26 16:55:29, 20.9 KB) [[attachment:proposal_tab.png]]
  • [get | view] (2007-01-10 20:46:43, 2.1 KB) [[attachment:supplementation.py]]
  • [get | view] (2006-12-02 10:11:48, 5.5 KB) [[attachment:supplementation_20061202_patch.txt]]
  • [get | view] (2006-08-31 11:03:34, 5.8 KB) [[attachment:supplementation_page_patch.txt]]
  • [get | view] (2007-01-10 20:48:51, 0.9 KB) [[attachment:theme_patch.txt]]
 All files | Selected Files: delete move to page copy to page

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