[304] most_popular_datasets can render a preview image
--- a/ckanext/ga_report/helpers.py
+++ b/ckanext/ga_report/helpers.py
@@ -80,7 +80,7 @@
return base.render_snippet('ga_report/ga_popular_single.html', **context)
-def most_popular_datasets(publisher, count=20):
+def most_popular_datasets(publisher, count=20, preview_image=None):
if not publisher:
_log.error("No valid publisher passed to 'most_popular_datasets'")
@@ -92,7 +92,8 @@
'dataset_count': len(results),
'datasets': results,
- 'publisher': publisher
+ 'publisher': publisher,
+ 'preview_image': preview_image
}
return base.render_snippet('ga_report/publisher/popular.html', **ctx)
--- a/ckanext/ga_report/templates/ga_report/ga_util.html
+++ b/ckanext/ga_report/templates/ga_report/ga_util.html
@@ -81,7 +81,7 @@
<div class="widget-container widget_text">
<h4>Graph Legend</h4>
<div id="graph-legend-container">
- <div id="legend_none">(No graph loaded)</div>
+ <div style="display: none;" id="legend_none">(No graph is loaded)</div>
</div>
</div>
<div class="widget-container widget_text">
--- a/ckanext/ga_report/templates/ga_report/publisher/index.html
+++ b/ckanext/ga_report/templates/ga_report/publisher/index.html
@@ -6,8 +6,6 @@
<xi:include href="../ga_util.html" />
<py:def function="page_title">Usage by Publisher</py:def>
-
- <py:def function="content_class"><!----></py:def>
<py:match path="primarysidebar">
--- a/ckanext/ga_report/templates/ga_report/publisher/popular.html
+++ b/ckanext/ga_report/templates/ga_report/publisher/popular.html
@@ -15,7 +15,12 @@
</li>
</py:for>
</ul>
- <p class="">${h.link_to("More usage data for " + publisher.title, h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read_publisher',id=publisher.name))}</p>
+ <p>
+ <a href="${h.url_for(controller='ckanext.ga_report.controller:GaDatasetReport',action='read_publisher',id=publisher.name)}">
+ <img py:if="preview_image" src="${preview_image}" /><br/>
+ More usage data for ${publisher.title}
+ </a>
+ </p>
</div>
</py:if>
</html>
--- a/ckanext/ga_report/templates/ga_report/publisher/read.html
+++ b/ckanext/ga_report/templates/ga_report/publisher/read.html
@@ -6,8 +6,6 @@
<xi:include href="../ga_util.html" />
<py:def function="page_title">Usage by Dataset</py:def>
-
- <py:def function="content_class"><!----></py:def>
<py:def function="optional_head">
<link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/>
--- a/ckanext/ga_report/templates/ga_report/site/downloads.html
+++ b/ckanext/ga_report/templates/ga_report/site/downloads.html
@@ -6,8 +6,6 @@
<xi:include href="../ga_util.html" />
<py:def function="page_title">Downloads</py:def>
-
- <py:def function="content_class"><!----></py:def>
<py:match path="primarysidebar">
${ga_sidebar(download_link=h.url_for(controller='ckanext.ga_report.controller:GaReport',action='csv_downloads',month=c.month or 'all'))}
--- a/ckanext/ga_report/templates/ga_report/site/index.html
+++ b/ckanext/ga_report/templates/ga_report/site/index.html
@@ -6,8 +6,6 @@
<xi:include href="../ga_util.html" />
<py:def function="page_title">Site usage</py:def>
-
- <py:def function="content_class"><!----></py:def>
<py:def function="optional_head">
<link rel="stylesheet" type="text/css" href="/scripts/vendor/rickshaw.min.css"/>