|
<html xmlns:py="http://genshi.edgewall.org/" |
|
xmlns:i18n="http://genshi.edgewall.org/i18n" |
|
xmlns:xi="http://www.w3.org/2001/XInclude" |
|
py:strip=""> |
|
|
|
<py:def i18n:msg="" function="page_title">Statistics</py:def> |
|
|
|
<py:def function="page_heading"> |
|
Statistics |
|
</py:def> |
|
|
|
<py:def function="optional_feed"> |
|
<!--! |
|
Hellish hack to get excanvas to work in IE8. We disable html5shiv from |
|
overriding the createElement() method on this page. |
|
See: http://stackoverflow.com/questions/10208062/using-flot-with-bootstrap-ie8-incompatibility |
|
--> |
|
<!--[if lte IE 8 ]><script>var html5 = {shivMethods: false};</script><![endif]--> |
|
</py:def> |
|
|
|
<py:def function="optional_head"> |
|
<style type="text/css"> |
|
body #sidebar { |
|
display: none; |
|
} |
|
|
|
body #content { |
|
width: 950px; |
|
} |
|
|
|
h3 { |
|
margin-top: 20px; |
|
} |
|
|
|
.graph { |
|
width: 950px; |
|
height: 300px; |
|
margin-bottom: 20px; |
|
} |
|
|
|
.metric { |
|
width: 30%; |
|
} |
|
|
|
</style> |
|
</py:def> |
|
|
|
<py:match path="minornavigation"> |
|
<ul class="tabbed"> |
|
<li class="current-tab"> |
|
<a href="">Home</a> |
|
</li> |
|
</ul> |
|
</py:match> |
|
|
|
<div py:match="content"> |
|
<h3>Total number of Datasets</h3> |
|
<div id="new_packages_graph" class="graph"></div> |
|
|
|
<h3>Revisions to Datasets per week</h3> |
|
<div id="package_revisions_graph" class="graph"></div> |
|
|
|
<h3>Top Rated Datasets</h3> |
|
<table py:if="c.top_rated_packages" class="table table-bordered table-striped"> |
|
<tr><th>Dataset</th><th>Average rating</th><th class="metric">Number of ratings</th></tr> |
|
<tr py:for="package, rating, num_ratings in c.top_rated_packages"> |
|
<td>${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}</td><td>${rating}</td><td>${num_ratings}</td> |
|
</tr> |
|
</table> |
|
<p py:if="not c.top_rated_packages">No ratings</p> |
|
|
|
<h3>Most Edited Datasets</h3> |
|
<table class="table table-bordered table-striped"> |
|
<tr><th>Dataset</th><th class="metric">Number of edits</th></tr> |
|
<tr py:for="package, edits in c.most_edited_packages"> |
|
<td>${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}</td><td>${edits}</td> |
|
</tr> |
|
</table> |
|
|
|
<h3>Largest Groups</h3> |
|
<table class="table table-bordered table-striped"> |
|
<tr><th>Group</th><th class="metric">Number of datasets</th></tr> |
|
<tr py:for="group, num_packages in c.largest_groups"> |
|
<td>${h.link_to(group.title or group.name, h.url_for(controller='group', action='read', id=group.name))}</td><td>${num_packages}</td> |
|
</tr> |
|
</table> |
|
|
|
<h3>Top Tags</h3> |
|
<table class="table table-bordered table-striped"> |
|
<tr py:for="tag, num_packages in c.top_tags"> |
|
<td>${h.link_to(tag.name, h.url_for(controller='tag', action='read', id=tag.name))}</td><td class="metric">${num_packages}</td> |
|
</tr> |
|
</table> |
|
|
|
<h3>Users owning most datasets</h3> |
|
<table class="table table-bordered table-striped"> |
|
<tr py:for="user, num_packages in c.top_package_owners"> |
|
<td>${h.linked_user(user)}</td><td class="metric">${num_packages}</td> |
|
</tr> |
|
</table> |
|
|
|
<p> |
|
Page last updated: |
|
<?python |
|
import datetime |
|
?> |
|
${datetime.datetime.now().strftime('%c')} |
|
</p> |
|
</div> |
|
|
|
<py:def function="optional_footer"> |
|
<script type="text/javascript"> |
|
// HACKy |
|
$('body').addClass('no-sidebar'); |
|
</script> |
|
|
|
${jsConditionalForIe(8, '<script language="javascript" type="text/javascript" src="' + h.url_for_static('/scripts/vendor/flot/0.7/excanvas.js') + '"></script>', 'lte')} |
|
<script type="text/javascript" src="${ h.url_for_static('/scripts/vendor/flot/0.7/jquery.flot.js') }">//pointless jscript comment</script> |
|
<script type="text/javascript"> |
|
var options = { |
|
xaxis: { |
|
mode: "time", |
|
timeformat: "%y-%b" |
|
}, |
|
yaxis: { |
|
min: 0 |
|
}, |
|
legend: { |
|
position: "nw" |
|
} |
|
}; |
|
var data = [ |
|
[ |
|
${",".join(c.packages_by_week)} |
|
] |
|
]; |
|
$.plot($("#new_packages_graph"), data, options); |
|
</script> |
|
|
|
<script type="text/javascript"> |
|
var options = { |
|
xaxis: { |
|
mode: "time", |
|
timeformat: "%y-%b" |
|
}, |
|
legend: { |
|
position: "nw" |
|
}, |
|
colors: ["#ffcc33", "#ff8844"] |
|
}; |
|
var data = [ |
|
{label: "All package revisions", |
|
lines: {fill: 1 }, |
|
data: [${",".join(c.all_package_revisions)}]}, |
|
{label: "New datasets", |
|
lines: {fill: 1}, |
|
data: [${",".join(c.new_datasets)}]} |
|
]; |
|
$.plot($("#package_revisions_graph"), data, options); |
|
</script> |
|
</py:def> |
|
<xi:include href="../../layout.html" /> |
|
</html> |
|
|