Skip to content

Commit

Permalink
[2375] Add popular badge to dataset results
Browse files Browse the repository at this point in the history
This needs hooking up to the backend. Also truncating the title
to prevent line wrapping.
  • Loading branch information
aron committed May 29, 2012
1 parent c501374 commit ce636fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ckan/public/base/less/dataset.less
Expand Up @@ -42,6 +42,10 @@
background-color: #aaa;
}

.heading .popular {
top: 0;
}

.results {
margin-bottom: 20px;
padding-right: 360px;
Expand Down Expand Up @@ -131,10 +135,6 @@
font-weight: bold;
}

.resource-item .heading .popular {
top: 0;
}

.resource-item .format-label {
position: absolute;
top: 0;
Expand Down
11 changes: 7 additions & 4 deletions ckan/templates/snippets/package_list.html
@@ -1,10 +1,13 @@
<ul class="dataset-list unstyled" xmlns:py="http://genshi.edgewall.org/">
<li py:for="package in packages" class="dataset-item">
<h3 class="heading">
${h.link_to(package.get('title') or package.get('name'), h.url_for(controller='package', action='read', id=package.get('name')))}
<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>
</h3>
<div class="content">
${h.markdown_extract(package.notes)}
<div class="content" py:with="notes = h.markdown_extract(package.notes)">
<py:if test="notes">${notes}</py:if>
<p class="empty" py:if="not notes">This dataset has no description</p>
</div>
<py:if test="package.resources">
<ul class="dataset-resources unstyled">
Expand Down

0 comments on commit ce636fe

Please sign in to comment.