ajout d'une action pour ajouter d'un clic la recherche dans le wiki dans la
boite de recherche de firefox darcs-hash:20061213214545-f46e9-fa8ce6a5109f48d8aee162e1dcfd8e713863ab90.gz
This commit is contained in:
parent
d315e506b3
commit
ab6ee89076
1 changed files with 12 additions and 48 deletions
|
@ -234,7 +234,7 @@ class ThemeCrans(ThemeBase):
|
|||
'SpellCheck': _('Check Spelling', formatted=False), # rename action!
|
||||
'RenamePage': _('Rename Page', formatted=False),
|
||||
'DeletePage': _('Delete Page', formatted=False),
|
||||
'LikePages': _('Show Like Pages', formatted=False),
|
||||
'LikePages': _('Show Like Pages', formatted=False),
|
||||
'LocalSiteMap': _('Show Local Site Map', formatted=False),
|
||||
}
|
||||
|
||||
|
@ -426,57 +426,21 @@ class ThemeCrans(ThemeBase):
|
|||
]
|
||||
return ''.join(html)
|
||||
|
||||
def pageinfo(self, page):
|
||||
""" Simple override from base class.
|
||||
Remove <p> so footer isn't too big
|
||||
"""
|
||||
_ = self.request.getText
|
||||
|
||||
if self.shouldShowPageinfo(page):
|
||||
info = page.lastEditInfo()
|
||||
if info:
|
||||
if info['editor']:
|
||||
info = _("last edited %(time)s by %(editor)s") % info
|
||||
else:
|
||||
info = _("last modified %(time)s") % info
|
||||
return info
|
||||
return ''
|
||||
|
||||
def rtl_stylesheet(self, d):
|
||||
""" monobook uses a separate css page for rtl alterations.
|
||||
Add the rtl stylesheet if the user needs it
|
||||
"""
|
||||
link = ('<link rel="stylesheet" type="text/css" charset="%s"'
|
||||
' media="%s" href="%s">')
|
||||
html = []
|
||||
if i18n.getDirection(self.request.lang) == 'rtl':
|
||||
prefix = self.cfg.url_prefix
|
||||
href = '%s/%s/css/%s.css' % (prefix, self.name, 'rtl')
|
||||
html.append(link % (self.stylesheetsCharset, 'all', href))
|
||||
return '\n'.join(html)
|
||||
|
||||
def html_head(self, d):
|
||||
""" Tweak the sending of the head, to include right-to-left
|
||||
alterations if necessary
|
||||
""" add opensearch description to html head
|
||||
"""
|
||||
html = [
|
||||
u'<title>%(title)s - %(sitename)s</title>' % d,
|
||||
self.headscript(d), # Should move to separate .js file
|
||||
self.html_stylesheets(d),
|
||||
self.rtl_stylesheet(d),
|
||||
self.rsslink(),
|
||||
]
|
||||
return u' \n'.join(html)
|
||||
|
||||
def html_stylesheets(self, d):
|
||||
"""
|
||||
On fixe le chemin d'acces vers les feuilles de style
|
||||
"""
|
||||
html = []
|
||||
for media, nom in self.stylesheets:
|
||||
html.append(u'<link rel="stylesheet" type="text/css" media="%s" href="/wiki/crans/css/%s.css">' % (media, nom))
|
||||
return u'\n'.join(html)
|
||||
# common prefix for static content
|
||||
prefix = self.cfg.url_prefix
|
||||
open_search_desc = """
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="%(page)s?action=opensearch&searchtype=Titres" title="%(sitename)s, Rechercher dans les titres" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="%(page)s?action=opensearch&searchtype=Texte" title="%(sitename)s, Rechercher dans le texte" />
|
||||
""" % {'page':self.request.path_info, 'sitename':d['sitename']}
|
||||
|
||||
#d['page'].request.script_name, 'sitename':d['sitename']}
|
||||
|
||||
classic_head = ThemeBase.html_head(self, d)
|
||||
return classic_head + open_search_desc + str(self.request.path_info)
|
||||
|
||||
class Theme(ThemeCrans):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue