3 Consists of functions to typically be used within templates, but also
4 available to Controllers. This module is available to templates as 'h'.
6 # Import helpers as desired, or define your own, ie:
7 #from webhelpers.html.tags import checkbox, password
9 from routes import url_for
10 import wradmin.model.validators
11 from webhelpers.html.tags import file, form, end_form, submit
13 def wiki(page_title=None):
14 "Creates a link to the specified page in the www.winterrodeln.org wiki"
15 if page_title is None: page_title = 'Hauptseite'
16 return u'http://www.winterrodeln.org/wiki/' + page_title
19 def forum(forum=None):
20 "Creates a link to the specified forum. If no id is given, a general link is created."
21 if forum is None: return u'http://winterrodeln-forum.org/'
22 return u'http://winterrodeln-forum.org/viewforum.php?f=%d' % forum
25 def google_maps(latitude, longitude):
26 "Builds an URL like http://maps.google.at/maps?q=47.200607,11.260007"
27 return u"http://maps.google.at/maps?q=%.6f,%.6f" % (latitude, longitude)
31 "Takes a bool value and creates a German representation"
32 return wradmin.model.validators.GermanBool().from_python(value)
35 def tristate(yes, no):
36 "Takes a German representation of a tristate value"
37 return wradmin.model.validators.GermanTristate().from_python((yes, no))