/usr/share/pyshared/MoinMoin/theme/rightsidebar.py is in python-moinmoin 1.9.3-1ubuntu2.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - rightsidebar theme
Created by and for crw.
Later it was rewritten by Nir Soffer for MoinMoin release 1.3.
@copyright: 2005 Nir Soffer
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.theme import ThemeBase
class Theme(ThemeBase):
name = "rightsidebar"
def wikipanel(self, d):
""" Create wiki panel """
_ = self.request.getText
html = [
u'<div class="sidepanel">',
u'<h1>%s</h1>' % _("Wiki"),
self.navibar(d),
u'</div>',
]
return u'\n'.join(html)
def pagepanel(self, d):
""" Create page panel """
_ = self.request.getText
if self.shouldShowEditbar(d['page']):
html = [
u'<div class="sidepanel">',
u'<h1>%s</h1>' % _("Page"),
self.editbar(d),
u'</div>',
]
return u'\n'.join(html)
return ''
def userpanel(self, d):
""" Create user panel """
_ = self.request.getText
html = [
u'<div class="sidepanel">',
u'<h1>%s</h1>' % _("User"),
self.username(d),
u'</div>'
]
return u'\n'.join(html)
def header(self, d):
"""
Assemble page header
@param d: parameter dictionary
@rtype: string
@return: page header html
"""
_ = self.request.getText
html = [
# Custom html above header
self.emit_custom_html(self.cfg.page_header1),
# Header
u'<div id="header">',
self.searchform(d),
self.logo(),
u'<div id="locationline">',
self.interwiki(d),
self.title(d),
u'</div>',
self.trail(d),
u'</div>',
# Custom html below header (not recomended!)
self.emit_custom_html(self.cfg.page_header2),
# Sidebar
u'<div id="sidebar">',
self.wikipanel(d),
self.pagepanel(d),
self.userpanel(d),
u'</div>',
self.msg(d),
# Page
self.startPage(),
]
return u'\n'.join(html)
def editorheader(self, d):
"""
Assemble page header for editor
@param d: parameter dictionary
@rtype: string
@return: page header html
"""
_ = self.request.getText
html = [
# Custom html above header
self.emit_custom_html(self.cfg.page_header1),
# Header
#u'<div id="header">',
#self.searchform(d),
#self.logo(),
#u'</div>',
# Custom html below header (not recomended!)
self.emit_custom_html(self.cfg.page_header2),
# Sidebar
u'<div id="sidebar">',
self.wikipanel(d),
self.pagepanel(d),
self.userpanel(d),
u'</div>',
self.msg(d),
# Page
self.startPage(),
#self.title(d),
]
return u'\n'.join(html)
def footer(self, d, **keywords):
""" Assemble wiki footer
@param d: parameter dictionary
@keyword ...:...
@rtype: unicode
@return: page footer html
"""
page = d['page']
html = [
# End of page
self.pageinfo(page),
self.endPage(),
# Pre footer custom html (not recommended!)
self.emit_custom_html(self.cfg.page_footer1),
# Footer
u'<div id="footer">',
self.credits(d),
self.showversion(d, **keywords),
u'</div>',
# Post footer custom html
self.emit_custom_html(self.cfg.page_footer2),
]
return u'\n'.join(html)
def execute(request):
""" Generate and return a theme object
@param request: the request object
@rtype: MoinTheme
@return: Theme object
"""
return Theme(request)
|