Attachment 'Discussion.py'

Download

   1 """
   2     MoinMoin - Action for Discussion pages
   3 
   4     This Action is used to create a subpage Discussion below a comon page
   5 
   6     Install:
   7         put it into the 'action' directory and do create a DiscussionTemplate
   8         
   9     Note:
  10         derived from the newpage macro by Vito Miliano (vito_moinnewpagewithtemplate@perilith.com) et al
  11 
  12     Modification History:
  13        2006-08-25 ReimarBauer initial version
  14                    
  15     License:
  16         @license: GNU GPL, see COPYING for details.  
  17         
  18 """
  19 from MoinMoin.Page import Page
  20 
  21 
  22 def execute(pagename, request):
  23     
  24     _ = request.getText
  25     
  26     if pagename.find(_('Discussion')) != -1:
  27         redir = pagename.split('/')
  28         redir = '/'.join(redir[0:-1])
  29         query = {'action': 'edit', 'backto': redir}
  30         url = Page(request, pagename).url(request, query, escape=0, relative=False)
  31         request.http_redirect(url)
  32         
  33     newpagename = "%s/%s" % (pagename,_('Discussion'))
  34 
  35     if request.user.may.read(newpagename) and request.user.may.write(newpagename):
  36         query = {'action': 'edit', 'backto': pagename}
  37         
  38         from MoinMoin.wikiutil import quoteWikinameURL
  39         query['template'] = quoteWikinameURL('DiscussionTemplate')
  40         
  41         url = Page(request, newpagename).url(request, query, escape=0, relative=False)
  42         request.http_redirect(url)
  43         
  44     else: 
  45         page = Page(request, pagename)
  46         error = _('you don''t have access to the discussion page')
  47         page.send_page(request, msg=error)
  48         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.