Skip to content

Commit

Permalink
[#890] Adds num_followers to package_show
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Jun 11, 2013
1 parent 92ca447 commit 75da354
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ckan/logic/action/get.py
Expand Up @@ -744,6 +744,10 @@ def package_show(context, data_dict):
for item in plugins.PluginImplementations(plugins.IPackageController):
item.after_show(context, package_dict)

package_dict['num_followers'] = logic.get_action('dataset_follower_count')(
{'model': model, 'session': model.Session},
{'id': package_dict['id']})

return package_dict

def resource_show(context, data_dict):
Expand Down
3 changes: 1 addition & 2 deletions ckan/templates/package/read_base.html
Expand Up @@ -49,8 +49,7 @@ <h1 class="heading">{{ pkg.title or pkg.name }}</h1>
<div class="nums">
<dl>
<dt>{{ _('Followers') }}</dt>
{# todo get pkg.num_followers to work #}
<dd>{{ h.SI_number_span(0) }}</dd>
<dd>{{ h.SI_number_span(pkg.num_followers) }}</dd>
</dl>
</div>
<div class="follow_button">
Expand Down

0 comments on commit 75da354

Please sign in to comment.