1.1 --- a/themes/minimalmoin/css/screen.css Sun Jan 31 02:45:07 2010 +0100
1.2 +++ b/themes/minimalmoin/css/screen.css Sun Jan 31 22:43:09 2010 +0100
1.3 @@ -91,6 +91,7 @@
1.4 /* Menus and lists. */
1.5
1.6 .editbar,
1.7 +#mainpages,
1.8 #navibar,
1.9 #username,
1.10 #pageabout,
1.11 @@ -99,6 +100,7 @@
1.12 }
1.13
1.14 .editbar,
1.15 +#mainpages,
1.16 #pageabout,
1.17 #pagelocation,
1.18 #pagetrail,
1.19 @@ -114,6 +116,7 @@
1.20 }
1.21
1.22 .editbar li,
1.23 +#mainpages li,
1.24 #pageabout li,
1.25 #pagelocation li,
1.26 #pagetrail li,
1.27 @@ -207,10 +210,6 @@
1.28 vertical-align: middle;
1.29 }
1.30
1.31 -#interwiki {
1.32 - font-size: 1em;
1.33 -}
1.34 -
1.35 #pageline {
1.36 }
1.37
2.1 --- a/themes/minimalmoin/minimalmoin.py Sun Jan 31 02:45:07 2010 +0100
2.2 +++ b/themes/minimalmoin/minimalmoin.py Sun Jan 31 22:43:09 2010 +0100
2.3 @@ -109,6 +109,7 @@
2.4
2.5 html.append(self.title(d))
2.6 html.append(self.about(d))
2.7 + html.append(self.mainpages(d))
2.8
2.9 html.append(fmt.div(on=0))
2.10
2.11 @@ -140,6 +141,7 @@
2.12 request = self.request
2.13 fmt = request.formatter
2.14 _ = request.getText
2.15 + page = d["page"]
2.16 html = []
2.17
2.18 # NOTE: Some pages cause section numbers to be enabled, affecting the
2.19 @@ -156,32 +158,10 @@
2.20
2.21 html.append(fmt.div(on=1, attr={"id" : "footer"}))
2.22
2.23 - html.append(fmt.div(on=1, attr={"class" : "editing"}))
2.24 - html.append(fmt.span(on=1, attr={"class" : "menutitleholder"}))
2.25 - html.append(fmt.span(on=1, attr={"class" : "menutitle"}))
2.26 - html.append(fmt.text(_("Editing options")))
2.27 - html.append(fmt.span(on=0))
2.28 - html.append(self.editbar(d))
2.29 - html.append(fmt.span(on=0))
2.30 - html.append(fmt.div(on=0))
2.31 -
2.32 - html.append(fmt.div(on=1, attr={"id" : "navigation"}))
2.33 - html.append(fmt.span(on=1, attr={"class" : "menutitleholder"}))
2.34 - html.append(fmt.span(on=1, attr={"class" : "menutitle"}))
2.35 - html.append(fmt.text(_("Useful pages")))
2.36 - html.append(fmt.span(on=0))
2.37 - html.append(self.navibar(d))
2.38 - html.append(fmt.span(on=0))
2.39 - html.append(fmt.div(on=0))
2.40 -
2.41 - html.append(fmt.div(on=1, attr={"id" : "identity"}))
2.42 - html.append(fmt.span(on=1, attr={"class" : "menutitleholder"}))
2.43 - html.append(fmt.span(on=1, attr={"class" : "menutitle"}))
2.44 - html.append(fmt.text(_("User information")))
2.45 - html.append(fmt.span(on=0))
2.46 - html.append(self.username(d))
2.47 - html.append(fmt.span(on=0))
2.48 - html.append(fmt.div(on=0))
2.49 + if self.shouldShowEditbar(page):
2.50 + html.append(self.menuholder(d, {"class" : "editing"}, _("Editing options"), self.editbar))
2.51 + html.append(self.menuholder(d, {"id" : "navigation"}, _("Useful pages"), self.navibar))
2.52 + html.append(self.menuholder(d, {"id" : "identity"}, _("User information"), self.username))
2.53
2.54 #html.append(self.trail(d))
2.55
2.56 @@ -194,6 +174,29 @@
2.57
2.58 return u''.join(html)
2.59
2.60 + def mainpages(self, d, **kw):
2.61 + """ Link to the front page and potentially other pages.
2.62 +
2.63 + @param d: parameter dictionary
2.64 + @rtype: unicode
2.65 + @return: front page link html
2.66 + """
2.67 +
2.68 + request = self.request
2.69 + fmt = request.formatter
2.70 + _ = request.getText
2.71 + html = []
2.72 +
2.73 + page = wikiutil.getFrontPage(self.request)
2.74 +
2.75 + html.append(fmt.bullet_list(on=1, attr={"id" : "mainpages"}))
2.76 + html.append(fmt.listitem(on=1))
2.77 + html.append(page.link_to(request, text=_("Front page"), rel='nofollow'))
2.78 + html.append(fmt.listitem(on=0))
2.79 + html.append(fmt.bullet_list(on=0))
2.80 +
2.81 + return u''.join(html)
2.82 +
2.83 def about(self, d, **kw):
2.84 """ Link to the controls in the footer.
2.85
2.86 @@ -219,6 +222,32 @@
2.87
2.88 return u''.join(html)
2.89
2.90 + def menuholder(self, d, menu_attr, menu_title, menu_fn):
2.91 + """ Wrap controls in a menu container.
2.92 +
2.93 + @param d: parameter dictionary
2.94 + @param menu_attr: menu container element attributes
2.95 + @param menu_title: the menu label text
2.96 + @param menu_fn: the function or method producing the controls
2.97 + @rtype: unicode
2.98 + @return: menu container html
2.99 + """
2.100 +
2.101 + request = self.request
2.102 + fmt = request.formatter
2.103 + html = []
2.104 +
2.105 + html.append(fmt.div(on=1, attr=menu_attr))
2.106 + html.append(fmt.span(on=1, attr={"class" : "menutitleholder"}))
2.107 + html.append(fmt.span(on=1, attr={"class" : "menutitle"}))
2.108 + html.append(fmt.text(menu_title))
2.109 + html.append(fmt.span(on=0))
2.110 + html.append(menu_fn(d))
2.111 + html.append(fmt.span(on=0))
2.112 + html.append(fmt.div(on=0))
2.113 +
2.114 + return u''.join(html)
2.115 +
2.116 # Theme instantiation.
2.117
2.118 def execute(request):