Skip to content

Commit

Permalink
only show description if name s given to prevent duplicate line
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 18, 2012
1 parent 581bb95 commit 7fc9191
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ckan/templates/package/read.html
Expand Up @@ -40,11 +40,18 @@ <h1>${c.pkg_dict.get('title', c.pkg_dict.name)}</h1>
<h3>Resources</h3>
<ul class="resource-list" py:if="c.pkg_dict.resources">
<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}">
<a class="heading" href="${url}" title="${res.name or res.description}">
${h.resource_display_name(res)}
<span py:if="res.format" class="format-box" property="dc:format">${res.format}</span>
</a>
<p class="description">${h.markdown_extract(res.description, extract_length=80)}</p>
<p class="description"><py:choose test="">
<!-- only show description if name is given as we show
the description for the name if none is given -->
<py:if test="res.name">
${h.markdown_extract(res.description, extract_length=80)}
</py:if>
<py:otherwise>&nbsp;</py:otherwise>
</py:choose></p>
<a class="btn btn-primary" href="${url}">Explore Data</a>
</li>
</ul>
Expand Down

0 comments on commit 7fc9191

Please sign in to comment.