Skip to content

Commit

Permalink
[1821] Deprecated facet_list_items
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Murray committed Apr 18, 2012
1 parent 0b932df commit a9d67eb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ckan/templates/facets.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ <h2>${title(code)}</h2>
</py:def>

<!--
DEPRECATED. Provided only for backward compatibility with existing plugins.
Use `facet_li` instead.
Construct a possibly empty list of <li> elements containing links to further
search results
Expand All @@ -151,11 +154,15 @@ <h2>${title(code)}</h2>
-->
<py:def function="facet_list_items(code, limit=5, label=lambda n: n, if_empty=None)">

<li py:if="if_empty and not h.new_facet_items(code, limit)">${if_empty}</li>
<li py:for="facet_item in h.new_facet_items(code, limit)"
py:if="not (code, facet_item.name) in c.fields">
<a href="${c.drill_down_url(**{code: facet_item.name})}">${label(facet_item.name)}</a> (facet_item['count'])
</li>
<?python
import logging
logging.getLogger('ckan.templates.facets').warning("Deprecated function:ckan/templates/facets.html:facet_list_items()")
?>
<li py:if="if_empty and not h.new_facet_items(code, limit)">${if_empty}</li>
<li py:for="facet_item in h.new_facet_items(code, limit)"
py:if="not (code, facet_item.name) in c.fields">
<a href="${c.drill_down_url(**{code: facet_item.name})}">${label(facet_item.name)}</a> (facet_item['count'])
</li>
</py:def>

<py:def function="field_list()">
Expand Down

0 comments on commit a9d67eb

Please sign in to comment.