Skip to content

Commit

Permalink
[#2375] Allow facet title set in config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 10, 2012
1 parent b53c8c8 commit 5d983a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ckan/lib/helpers.py
Expand Up @@ -523,11 +523,17 @@ def facet_title(name):
return config.get('search.facets.%s.title' % name, name.capitalize())

def get_facet_title(name):

# if this is set in the config use this
config_title = config.get('search.facets.%s.title' % name)
if config_title:
return config_title

facet_titles = {'groups' : _('Groups'),
'tags' : _('Tags'),
'res_format' : _('Formats'),
'license' : _('Licence'), }
return facet_titles.get(name, name)
return facet_titles.get(name, name.capitalize())

def get_param_int(name, default=10):
return int(request.params.get(name, default))
Expand Down

0 comments on commit 5d983a7

Please sign in to comment.