from MoinMoin.theme import ThemeBase
from MoinMoin.Page import Page
+from MoinMoin import wikiutil
class SiteTheme(ThemeBase):
# Start of page
self.startPage(),
+ self.editbar(d),
self.msg(d),
]
return u'\n'.join(html)
page = d['page']
html = [
# End of page
- self.pageinfo(page),
self.endPage(),
# Pre footer custom html (not recommended!)
# Footer
u'<div id="footer">',
- self.searchform(d),
self.username(d),
- self.editbar(d),
+ self.pageinfo(page),
+ self.searchform(d),
#self.editbar(d),
#self.credits(d),
#self.showversion(d, **keywords),
src = '%s/%s/js/%s.js' % (self.request.cfg.url_prefix_static, self.name, name)
return '<script type="text/javascript" src="%s"></script>' % src
+ def pageinfo(self, page):
+ """ Output page name and "last modified". This overwrites the pageinfo
+ from ThemeBase to hide the username, which is useless and always
+ produces a link to the non-existing homepage of the last editor. """
+ _ = self.request.getText
+ html = ''
+ if self.shouldShowPageinfo(page):
+ info = page.lastEditInfo()
+ if info:
+ info = _("last modified %(time)s") % info
+ pagename = page.page_name
+ info = "%s (%s)" % (wikiutil.escape(pagename), info)
+ html = '<p id="pageinfo" class="info"%(lang)s>%(info)s</p>\n' % {
+ 'lang': self.ui_lang_attr(),
+ 'info': info
+ }
+ return html
+
def execute(request):
"""
Generate and return a theme object
#header {
/* Fit exactly into the header in the background, and push the menu bar in place */
padding-top: 70px;
- height: 30px;
+ height: 40px;
/* Center the header */
width:1024px;
margin:auto;
text-decoration:none;
}
+#page, #footer{
+ /* Center the page and footer, just like the header */
+ width:1024px;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+h1 { margin: 0; padding: 0; }
+
#footer {
/* Put a dotted line at the top of the footer */
border-top: 1px dotted #9C9C9C;
margin-top: 5px;
}
-/* Format the editbar, copied from modern theme */
-
-.editbar {
- float: left;
- margin: 5px 0;
- padding: 0;
-}
-
-.editbar a, .editbar a:visited { color: #0044B3; }
-
-.editbar form, .editbar form div {
- display: inline;
- margin: 0;
-}
-
-.editbar li {
- display: inline;
- padding: 0;
- margin: 4px 6px;
-}
#footerbar {
}
-.editbar a, .editbar a:visited { color: #0044B3; }
-
#editor {
margin: 0;
padding: 2px 20px 20px 20px;
margin-top: 0.5em;
}
+/* Format the pageinfo bar. */
+#pageinfo {
+ float: right;
+ margin: 0px 12px;
+}
/* Format the username bar, copied from the modern theme */
#username {
- float: right;
+ float: left;
display: inline;
- margin: 5px 12px;
+ margin: 0px 12px;
padding: 0;
text-align: right;
font-size: 0.82em;
white-space: nowrap;
}
-*[dir="rtl"] #username {
- text-align: left;
- margin: 5px 0px;
-}
-
#username li {
display: inline;
padding: 0 0.5em 0 0;
}
-#username form {
- display: inline;
+#searchform {
+ /* Put the searchform below the pageinfo / username bar */
+ clear: both;
+ float: right;
+ /* Put a bit of offset between the pageinfo and searchform. Don't use
+ * margin here, that collapses with the floating pageinfo. */
+ padding-top: 10px;
}
-#username input {
+.editbar {
+ /* Put a bit of offset between the pageinfo and searchform. Don't use
+ * margin here, that collapses with the floating pageinfo. */
+ /*padding-top: 10px;
+ margin: 5px 0;*/
+ /* Unset the default ul margins */
+ margin-top: 0px;
+ margin-bottom: 0px;
+ /* Put the editbar at the right side (but not over the image there */
+ float: right;
+ margin-right: 220px;
+ /* Prevent weird linebreaks */
+ white-space: nowrap;
+}
+
+.editbar form, .editbar form div {
display: inline;
- padding: 0;
margin: 0;
- border: none;
- background: #E7E7E7; /* inherit doesnt work on IE */
- color: blue;
- font-size: 0.82em;
- cursor: pointer;
}
-#username input:hover {
- color: red;
+.editbar li {
+ display: inline;
+ padding: 0;
+ margin: 4px 6px;
}
/****************** Next pages ************************/