Skip to content

Commit

Permalink
[#2467] Fix stats extension frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 25, 2012
1 parent a68431a commit 79fc848
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions ckanext/stats/templates/ckanext/stats/index.html
Expand Up @@ -19,15 +19,20 @@
width: 950px;
}

.legend table {
width: auto;
h3 {
margin-top: 20px;
}

.graph {
width: 950px;
height: 300px;
margin-bottom: 20px;
}

.metric {
width: 30%;
}

</style>
</py:def>

Expand All @@ -47,41 +52,41 @@ <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">
<tr><th>Dataset</th><th>Average rating</th><th>Number of ratings</th></tr>
<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>
<tr><th>Dataset</th><th>Number of edits</th></tr>
<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>
<tr><th>Group</th><th>Number of datasets</th></tr>
<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>
<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>${num_packages}</td>
<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>
<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>${num_packages}</td>
<td>${h.linked_user(user)}</td><td class="metric">${num_packages}</td>
</tr>
</table>

Expand Down

0 comments on commit 79fc848

Please sign in to comment.