
cherokee at cherokee-project
Jan 29, 2010, 11:19 AM
Post #1 of 1
(121 views)
Permalink
|
|
[4202] cherokee/branches/adminctk/admin: Help references
|
|
Revision: 4202 http://svn.cherokee-project.com/changeset/4202 Author: alo Date: 2010-01-29 20:19:30 +0100 (Fri, 29 Jan 2010) Log Message: ----------- Help references Modified Paths: -------------- cherokee/branches/adminctk/admin/Page.py cherokee/branches/adminctk/admin/PageGeneral.py cherokee/branches/adminctk/admin/theme.html Modified: cherokee/branches/adminctk/admin/Page.py =================================================================== --- cherokee/branches/adminctk/admin/Page.py 2010-01-29 18:22:31 UTC (rev 4201) +++ cherokee/branches/adminctk/admin/Page.py 2010-01-29 19:19:30 UTC (rev 4202) @@ -26,10 +26,21 @@ import CTK class Base (CTK.Page): - def __init__ (self, headers=None): + def __init__ (self, helps=None, headers=None): # Look for the theme file srcdir = os.path.dirname (os.path.realpath (__file__)) theme_file = os.path.join (srcdir, 'theme.html') # Parent's constructor - CTK.Page.__init__ (self, theme_file, headers) + template = CTK.Template (filename = theme_file) + CTK.Page.__init__ (self, template, headers) + + # Help + self.helps = helps + template['helps'] = self._render_helps() + + def _render_helps (self): + txt = '' + for ref, name in self.helps: + txt += '<div class="help_entry"><a href="/help/%s.html">%s</a></div>' %(ref, name) + return txt Modified: cherokee/branches/adminctk/admin/PageGeneral.py =================================================================== --- cherokee/branches/adminctk/admin/PageGeneral.py 2010-01-29 18:22:31 UTC (rev 4201) +++ cherokee/branches/adminctk/admin/PageGeneral.py 2010-01-29 19:19:30 UTC (rev 4202) @@ -41,7 +41,10 @@ NOTE_TOKENS = N_('This option allows to choose how the server identifies itself.') NOTE_TIMEOUT = N_('Time interval until the server closes inactive connections.') +HELPS = [('config_general', N_("General Configuration")), + ('config_quickstart', N_("Configuration Quickstart"))] + def apply(): return {'ret': 'ok'} @@ -56,13 +59,13 @@ self += CTK.RawHTML ("<h2>%s</h2>" %(_('Support'))) table = CTK.PropsTableAuto (URL_APPLY) - table.Add (_('IPv6'), CTK.CheckCfg('server!ipv6', True), NOTE_IPV6) + table.Add (_('IPv6'), CTK.CheckCfg('server!ipv6', True), _(NOTE_IPV6)) self += table self += CTK.RawHTML ("<h2>%s</h2>" %(_('Network behavior'))) table = CTK.PropsTableAuto (URL_APPLY) table.Add (_('Timeout (<i>secs</i>)'), CTK.TextCfg('server!timeout'), _(NOTE_TIMEOUT)) - table.Add (_('Server Tokens'), CTK.ComboCfg('server!server_tokens', PRODUCT_TOKENS), NOTE_TOKENS) + table.Add (_('Server Tokens'), CTK.ComboCfg('server!server_tokens', PRODUCT_TOKENS), _(NOTE_TOKENS)) self += table @@ -74,7 +77,7 @@ tabs.Add (_('Network'), NetworkWidget()) tabs.Add (_('Ports to listen'), PortsWidget()) - page = Page.Base() + page = Page.Base (HELPS) page += CTK.RawHTML(txt) page += tabs Modified: cherokee/branches/adminctk/admin/theme.html =================================================================== --- cherokee/branches/adminctk/admin/theme.html 2010-01-29 18:22:31 UTC (rev 4201) +++ cherokee/branches/adminctk/admin/theme.html 2010-01-29 19:19:30 UTC (rev 4202) @@ -7,6 +7,7 @@ </head> <body%(body_props)s> <small>Themed page</small> + <div class="help">%(helps)s</div> %(body)s <div align="right"><a href="http://www.cherokee-project.com/">Cherokee</a></div> </body>
|