Skip to content

Commit

Permalink
Fixed follow button on datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Oct 9, 2012
1 parent ef3f161 commit 2cdec66
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ckan/templates/snippets/follow_button.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{% set controller = obj_type %}
{% if controller == 'dataset' %}
{% set controller = 'package' %}
{% endif %}

{% if following %}
<a href="{{ h.url_for(controller=obj_type, action='unfollow', id=obj_id) }}" class="btn btn-danger" data-module="follow" data-module-type="{{ obj_type }}" data-module-id="{{ obj_id }}" data-module-action="unfollow">
<a href="{{ h.url_for(controller=controller, action='unfollow', id=obj_id) }}" class="btn btn-danger" data-module="follow" data-module-type="{{ obj_type }}" data-module-id="{{ obj_id }}" data-module-action="unfollow">
<i class="icon-remove-sign"></i>
{{ _('Unfollow') }}
</a>
{% else %}
<a href="{{ h.url_for(controller=obj_type, action='follow', id=obj_id) }}" class="btn btn-success" data-module="follow" data-module-type="{{ obj_type }}" data-module-id="{{ obj_id }}" data-module-action="follow">
<a href="{{ h.url_for(controller=controller, action='follow', id=obj_id) }}" class="btn btn-success" data-module="follow" data-module-type="{{ obj_type }}" data-module-id="{{ obj_id }}" data-module-action="follow">
<i class="icon-plus-sign"></i>
{{ _('Follow') }}
</a>
Expand Down

0 comments on commit 2cdec66

Please sign in to comment.