Skip to content

Commit

Permalink
2442 popular uses tracking data
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 30, 2012
1 parent bc5da78 commit 0c9bed8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ckan/templates/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ <h3>Data and Resources</h3>
<li class="resource-item" py:for="res in c.pkg_dict.resources" py:with="url=h.url_for(controller='package', action='resource_read', id=c.pkg_dict['name'], resource_id=res['id'])">
<a class="heading" href="${url}" title="${res.name or res.description}">
${h.truncate(h.resource_display_name(res), 50)}<span class="format-label" property="dc:format" data-format="${res.format.lower() or 'data'}">${res.format}</span>
<!--! TODO: Use tracking data -->
<py:if test="True" >${h.snippet('snippets/popular.html', title=_('{num} views').format(num=10))}</py:if>
<!--! popular icon -->
${h.snippet('snippets/popular.html', title=ungettext('{num} view', '{num} views', res.tracking_summary.total), num=res.tracking_summary.total)}
</a>
<p class="description">
<py:choose test="">
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/snippets/package_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3 class="heading" py:with="title = package.get('title') or package.get('name')">
${h.link_to(h.truncate(title, 80), h.url_for(controller='package', action='read', id=package.get('name')))}
<!--! TODO: Hook this up to views -->
<py:if test="True">${h.snippet('snippets/popular.html', title='10 views')}</py:if>
${h.snippet('snippets/popular.html', title=ungettext('{num} recent view', '{num} recent views', package.tracking_summary.recent), num=package.tracking_summary.recent)}
</h3>
<div class="content" py:with="notes = h.markdown_extract(package.notes)">
<py:if test="notes">${notes}</py:if>
Expand Down
5 changes: 4 additions & 1 deletion ckan/templates/snippets/popular.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<span class="popular ckan-icon ckan-icon-flame" title="${title}" xmlns="http://www.w3.org/1999/xhtml">Popular</span>
{# show poular icon basic functionality will need updating #}
{% if num > 10 %}
<span class="popular ckan-icon ckan-icon-flame" title="{{ title.format(num=num) }}" xmlns="http://www.w3.org/1999/xhtml">Popular</span>
{% endif %}

0 comments on commit 0c9bed8

Please sign in to comment.