Skip to content

Commit

Permalink
[#730] Only show 'Popular' sort option if tracking enabled
Browse files Browse the repository at this point in the history
Sorting datasets by popularity only works if page view tracking is
enabled, so don't show the 'Popular' option in the 'Order by:' dropdown
if tracking isn't enabled.
  • Loading branch information
Sean Hammond committed Apr 16, 2013
1 parent b2c6ec6 commit 9604dc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/templates/snippets/sort_by.html
Expand Up @@ -15,7 +15,9 @@
<option value="title_string asc"{% if sort=='title_string asc' %} selected="selected"{% endif %}>{{ _('Name Ascending') }}</option>
<option value="title_string desc"{% if sort=='title_string desc' %} selected="selected"{% endif %}>{{ _('Name Descending') }}</option>
<option value="metadata_modified desc"{% if sort=='metadata_modified desc' %} selected="selected"{% endif %}>{{ _('Last Modified') }}</option>
<option value="views_recent desc"{% if sort=='views_recent desc' %} selected="selected"{% endif %}>{{ _('Popular') }}</option>
{% if g.tracking_enabled %}
<option value="views_recent desc"{% if sort=='views_recent desc' %} selected="selected"{% endif %}>{{ _('Popular') }}</option>
{% endif %}
</select>
<button class="btn js-hide" type="submit">{{ _('Go') }}</button>
</span>

0 comments on commit 9604dc1

Please sign in to comment.