59 lines
1.5 KiB
Python
59 lines
1.5 KiB
Python
|
from django.utils.translation import gettext as _
|
||
|
import mycreole
|
||
|
import pages
|
||
|
from themes import color_icon_url
|
||
|
|
||
|
|
||
|
HELP_UID = 'help'
|
||
|
|
||
|
MAIN = mycreole.render_simple(_(
|
||
|
"""
|
||
|
= Piki
|
||
|
|
||
|
**piki** is a minimal wiki implemented with python and django.
|
||
|
|
||
|
== Help
|
||
|
* [[creole|Creole Markup Language]]
|
||
|
* [[access|Access Control for the site content]]
|
||
|
* [[search|Help on Search]]
|
||
|
"""))
|
||
|
|
||
|
CREOLE = mycreole.mycreole_help_pagecontent()
|
||
|
CREOLE += mycreole.render_simple("""
|
||
|
= Piki Markup
|
||
|
{{{[[rel_path_to_page|Name]]}}} will result in a Link to the given wiki page.
|
||
|
""")
|
||
|
|
||
|
ACCESS = mycreole.render_simple(_("""
|
||
|
= TBD
|
||
|
"""))
|
||
|
|
||
|
SEARCH = mycreole.render_simple(_("""
|
||
|
= TBD
|
||
|
"""))
|
||
|
|
||
|
help_pages = {
|
||
|
'main': MAIN,
|
||
|
'creole': CREOLE,
|
||
|
'access': ACCESS,
|
||
|
'search': SEARCH,
|
||
|
}
|
||
|
|
||
|
|
||
|
def actionbar(context, request, current_help_page=None, **kwargs):
|
||
|
actionbar_entries = (
|
||
|
('1', 'Main'),
|
||
|
('2', 'Creole'),
|
||
|
('3', 'Access'),
|
||
|
('4', 'Search'),
|
||
|
)
|
||
|
for num, name in actionbar_entries:
|
||
|
context[context.ACTIONBAR].append_entry(
|
||
|
HELP_UID + '-%s' % name.lower(), # uid
|
||
|
_(name), # name
|
||
|
color_icon_url(request, num + '.png'), # icon
|
||
|
pages.url_helpview(request, name.lower()), # url
|
||
|
True, # left
|
||
|
name.lower() == current_help_page, # active
|
||
|
)
|