id_to_label

This commit is contained in:
Martijn Voncken 2008-10-14 21:03:20 +00:00
commit 8c676a950e
3 changed files with 11 additions and 4 deletions

View file

@ -180,6 +180,12 @@ def template_get(key):
val = getcookie(key) val = getcookie(key)
return val return val
def id_to_label(text):
"translated capitalize"
text = text.replace("_"," ")
text = text.capitalize()
return _(text)
template.Template.globals.update({ template.Template.globals.update({
'sort_head': template_sort_head, 'sort_head': template_sort_head,
'part_stats':template_part_stats, 'part_stats':template_part_stats,
@ -205,7 +211,8 @@ template.Template.globals.update({
#'env':'0.6', #'env':'0.6',
'forms':web.Storage(), 'forms':web.Storage(),
'enumerate':enumerate, 'enumerate':enumerate,
'base':'' #updated when running within apache. 'base':'', #updated when running within apache.
'id_to_label':id_to_label
}) })
#/template-defs #/template-defs

View file

@ -6,7 +6,7 @@ $:render.admin_toolbar('config')
<!--left block--> <!--left block-->
<div class="panel" id="config_chooser"> <div class="panel" id="config_chooser">
$for group in groups: $for group in groups:
<h3>$group</h3> <h3>$id_to_label(group)</h3>
<ul> <ul>
$for page in pages: $for page in pages:
$if pages[page].group == group: $if pages[page].group == group:
@ -18,7 +18,7 @@ $for group in groups:
</div> </div>
<!--form block--> <!--form block-->
<div class="panel" id="config_panel"> <div class="panel" id="config_panel">
<h2>$form.group / $form.title</h2> <h2>$id_to_label(form.group) / $form.title</h2>
<div class="info">$form.info</div> <div class="info">$form.info</div>
<form method="POST"> <form method="POST">
$:form.pre_html() $:form.pre_html()

View file

@ -24,7 +24,7 @@ $if get('filter_cat') == "keyword":
$filter_items $filter_items
--> -->
$for cat in filter_items.keys(): $for cat in filter_items.keys():
<div class="title">$cat</div> <div class="title">$id_to_label(cat)</div>
<ul> <ul>
$for value, count in filter_items[cat]: $for value, count in filter_items[cat]:
<li <li