Skip to content

Commit

Permalink
[2375] Move dataset license into a snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed May 23, 2012
1 parent a76d690 commit 6a3cd7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 1 addition & 8 deletions ckan/templates/package/read.html
Expand Up @@ -155,14 +155,7 @@ <h2 class="heading"><i class="ckan-icon ckan-icon-photo"></i> Related</h2>

<section class="module info license" py:if="c.pkg.license_id">
<h2 class="heading"><i class="ckan-icon ckan-icon-lock"></i> License</h2>
<p class="content">
<a py:if="'license_url' in c.pkg_dict" href="${c.pkg_dict.license_url}" rel="dc:rights">${c.pkg_dict.license_title}</a>
<span py:if="c.pkg.license" property="dc:rights">${c.pkg_dict.license_title}</span>
<a py:if="c.pkg_dict.isopen" href="http://opendefinition.org/okd/" title="This dataset satisfies the Open Definition.">
<img class="open-data" src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" alt="[Open Data]" />
</a>
<span py:if="not c.pkg_dict.isopen" class="closed">${h.icon('lock')}</span>
</p>
<p class="content">${h.snippet('snippets/license.html', dataset=c.pkg_dict)}</p>
</section>

<section class="module disqus-trackback">
Expand Down
11 changes: 11 additions & 0 deletions ckan/templates/snippets/license.html
@@ -0,0 +1,11 @@
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:py="http://genshi.edgewall.org/">
<a py:if="'license_url' in dataset" href="${dataset.license_url}" rel="dc:rights">${dataset.license_title}</a>
<span py:if="c.pkg.license" property="dc:rights">${dataset.license_title}</span>
<a py:if="dataset.isopen" href="http://opendefinition.org/okd/" title="This dataset satisfies the Open Definition.">
<img class="open-data" src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" alt="[Open Data]" />
</a>
<span py:if="not dataset.isopen" class="closed">${h.icon('lock')}</span>
</html>

0 comments on commit 6a3cd7a

Please sign in to comment.