Skip to content

Commit

Permalink
Merge pull request ckan#3674 from ViderumGlobal/radio_helper
Browse files Browse the repository at this point in the history
Radio helper
  • Loading branch information
amercader authored Jul 7, 2017
2 parents de4e562 + 8e194fa commit d2538b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ckan/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,15 @@ def mail_to(email_address, name):
return html


@core_helper
def radio(selected, id, checked):
if checked:
return literal((u'<input checked="checked" id="%s_%s" name="%s" \
value="%s" type="radio">') % (selected, id, selected, id))
return literal(('<input id="%s_%s" name="%s" \
value="%s" type="radio">') % (selected, id, selected, id))


core_helper(flash, name='flash')
core_helper(localised_number)
core_helper(localised_SI_number)
Expand All @@ -2362,6 +2371,7 @@ def mail_to(email_address, name):
core_helper(urlencode)
core_helper(clean_html, name='clean_html')


def load_plugin_helpers():
"""
(Re)loads the list of helpers provided by plugins.
Expand Down

0 comments on commit d2538b7

Please sign in to comment.