[wiki-etch] suppression
darcs-hash:20090304160004-bd074-7e2630d385522d14ea3ad6a52ad0669b2ddc1b2e.gz
This commit is contained in:
parent
4a1c67a459
commit
aa5e8cdc52
67 changed files with 0 additions and 15442 deletions
|
@ -1,168 +0,0 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
"""
|
||||
MoinMoin monobook theme. Uses the css sheet from
|
||||
http://wikipedia.org, adapting the moin output to fit it.
|
||||
|
||||
Adapted by Jim Clark <jim AT clarkster DOT co DOT uk>
|
||||
Adapted for CR@NS by Nicolas Salles <salles AT crans DOT org>
|
||||
@license: GNU GPL, see COPYING for details.
|
||||
"""
|
||||
import datetime
|
||||
from MoinMoin.theme import ThemeBase
|
||||
from MoinMoin import wikiutil, i18n
|
||||
from MoinMoin.Page import Page
|
||||
|
||||
class ThemeCrans(ThemeBase):
|
||||
|
||||
name = "crans"
|
||||
|
||||
# Standard set of style sheets
|
||||
stylesheets = (
|
||||
# media basename
|
||||
('all', 'common'),
|
||||
('screen', 'crans'),
|
||||
('print', 'print'),
|
||||
('projection', 'projection'),
|
||||
)
|
||||
|
||||
# Standard set of scripts
|
||||
scripts = (
|
||||
'crans',
|
||||
)
|
||||
|
||||
|
||||
# Public functions #####################################################
|
||||
|
||||
def header(self, d, **kw):
|
||||
""" Assemble wiki header
|
||||
Here we don't add any menu bars, search bars, etc - instead wait
|
||||
until the footer. This keeps the HTML cleaner and more accessible,
|
||||
making sure the main content arrives first.
|
||||
"""
|
||||
if datetime.date.today().month == 10:
|
||||
extra_style = " class=\"halloween\""
|
||||
elif (datetime.date.today().month == 12) and (datetime.date.today().day <= 24):
|
||||
extra_style = " class=\"noel\""
|
||||
else:
|
||||
extra_style = ""
|
||||
parent = d['page'].getParentPage()
|
||||
html = [
|
||||
u'<div id="globalWrapper"%s>' % extra_style,
|
||||
u'<div id="main-content">',
|
||||
u'<div id="titleBarre">',
|
||||
'<h1 id="title">',
|
||||
self.title(d),
|
||||
u'</h1>',
|
||||
u'</div>',
|
||||
self.msg(d),
|
||||
self.startPage(),
|
||||
]
|
||||
return u'\n'.join(html)
|
||||
|
||||
editorheader = header
|
||||
def footer(self, d, **keywords):
|
||||
""" Assemble wiki footer
|
||||
"""
|
||||
html = [
|
||||
# End of page
|
||||
self.pageinfo(d['page']),
|
||||
self.endPage(),
|
||||
u'</div>', # fin du div main-content
|
||||
self.rightcolumn(d),
|
||||
u'</div>', # fin du div globalWrapper
|
||||
u'<script src="/wiki/common/js/say.no.to.ie.6.js"></script>', # Campagne "Save A Developer. Upgrade Your Browser."
|
||||
]
|
||||
return u'\n'.join(html)
|
||||
|
||||
def rightcolumn(self, d):
|
||||
""" assemble all the navigation aids for the page
|
||||
"""
|
||||
_ = self.request.getText
|
||||
page = d['page']
|
||||
html = [
|
||||
u'<div id="column-one">',
|
||||
u"<h5>Personnel</h5>",
|
||||
self.username(d),
|
||||
u"<h5>Navigation</h5>",
|
||||
self.navibar(d),
|
||||
# hack : c1 and V1 or v2 c'est comme le code C : c1? v1 : V2
|
||||
# (si c1 est vrai alors prends la valeur V1 sinon prend la valeur c2
|
||||
self.shouldShowEditbar(d['page']) and u"<h5>%s</h5>" % _("Page") or u" ",
|
||||
self.editbar(d),
|
||||
u"<h5>%s</h5>" % _('Search'),
|
||||
self.searchform(d),
|
||||
#self.actionmenu(d),
|
||||
#self.pageinfo(page),
|
||||
self.credits(d),
|
||||
]
|
||||
return u'\n'.join(html)
|
||||
|
||||
def html_head(self, d):
|
||||
""" add opensearch description to html head
|
||||
"""
|
||||
# common prefix for static content
|
||||
prefix = self.cfg.url_prefix
|
||||
open_search_desc = '\n<link rel="search" type="application/opensearchdescription+xml" href="%(page)s?action=opensearch&searchtype=Titres" title="%(sitename)s, Rechercher dans les titres" />\n<link rel="search" type="application/opensearchdescription+xml" href="%(page)s?action=opensearch&searchtype=Texte" title="%(sitename)s, Rechercher dans le texte" />' % {'page':d['page'].request.script_name, 'sitename':d['sitename']}
|
||||
if (d['page'].isWritable() and
|
||||
self.request.user.may.write(d['page'].page_name)):
|
||||
edit_link = "/" + wikiutil.quoteWikinameURL(d['page'].page_name) + '?action=edit&editor=text'
|
||||
wiki_rel = '<link rel="alternate" \
|
||||
type="application/x-wiki" title="Modifier" \
|
||||
href="%s" />\n' % edit_link
|
||||
else:
|
||||
wiki_rel = ""
|
||||
|
||||
|
||||
classic_head = ThemeBase.html_head(self, d)
|
||||
|
||||
return classic_head + open_search_desc + wiki_rel
|
||||
|
||||
def headscript(self, d):
|
||||
html = []
|
||||
# Check mode
|
||||
if d.get('print_mode'):
|
||||
link = ""
|
||||
else:
|
||||
# Create stylesheets links
|
||||
link = '<script type="text/javascript" src="%s"></script>'
|
||||
prefix = self.cfg.url_prefix
|
||||
csshref = '%s/%s/js' % (prefix, self.name)
|
||||
html = []
|
||||
for basename in self.scripts:
|
||||
href = '%s/%s.js' % (csshref, basename)
|
||||
html.append(link % href )
|
||||
|
||||
return ThemeBase.headscript(self, d) + u"\n".join(html)
|
||||
|
||||
|
||||
|
||||
|
||||
class Theme(ThemeCrans):
|
||||
|
||||
name = "crans"
|
||||
|
||||
# Standard set of style sheets
|
||||
stylesheets = (
|
||||
# media basename
|
||||
('all', 'common'),
|
||||
('screen', 'layout'),
|
||||
('screen', 'crans'),
|
||||
('print', 'print'),
|
||||
('projection', 'projection'),
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def execute(request):
|
||||
"""
|
||||
Generate and return a theme object
|
||||
|
||||
@param request: the request object
|
||||
@rtype: MoinTheme
|
||||
@return: Theme object
|
||||
"""
|
||||
return Theme(request)
|
Loading…
Add table
Add a link
Reference in a new issue