Skip to content

Commit

Permalink
[2375] Style the dataset resources list
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed May 16, 2012
1 parent faed7ed commit 44ee7e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
29 changes: 29 additions & 0 deletions ckan/public/base/less/dataset.less
Expand Up @@ -76,6 +76,35 @@
text-indent: -900em;
}

// Resource List

.resource-list {
.unstyled;
}

.resource-item {
position: relative;
padding-left: 40px;
padding-right: 110px; // Should really use ems here.
background: url("@{image-path}/sprite-resource-icons.png") no-repeat -1px 2px;
}

.resource-item .heading {
color: #000;
font-size: 14px;
font-weight: bold;
}

.resource-item .description {
font-size: 12px;
}

.resource-item .btn {
position: absolute;
top: 0;
right: 0;
}

// Tag List

.tag-list {
Expand Down
9 changes: 5 additions & 4 deletions ckan/templates/package/read.html
Expand Up @@ -27,7 +27,7 @@
<p py:if="not c.pkg_revision_not_latest" class="content">This is the current revision of this dataset, as edited at ${h.render_datetime(c.pkg_revision_timestamp, with_hours=True)}.</p>
</div>

<article class="module">
<article class="module prose">
<section class="content">
<h1>${c.pkg_dict.get('title', c.pkg_dict.get('name'))}</h1>
<div class="notes" py:if="str(c.pkg_notes_formatted).strip()">
Expand All @@ -43,12 +43,13 @@ <h3>Resources
</py:if>
</h3>
<ul class="resource-list" py:if="len(c.pkg_dict.get('resources', []))">
<li py:for="res in c.pkg_dict.get('resources', [])" py:with="url=h.url_for(controller='package', action='resource_read', id=c.pkg_dict['name'], resource_id=res['id'])">
<a href="${url}">
${h.resource_icon(res)}
<li class="resource-item" py:for="res in c.pkg_dict.get('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}">
<!--! ${h.resource_icon(res)} -->
${h.resource_display_name(res)}
<span py:if="res.get('format')" class="format-box" property="dc:format">${res.get('format')}</span>
</a>
<p class="description">Some truncated description of the resource. Max one line.</p>
<a class="btn btn-primary" href="${url}">Explore Data</a>
</li>
</ul>
Expand Down

0 comments on commit 44ee7e6

Please sign in to comment.