-
Notifications
You must be signed in to change notification settings - Fork 2k
/
resource_read.html
129 lines (116 loc) · 4.66 KB
/
resource_read.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<html xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcat="http://www.w3.org/ns/dcat#"
typeof="dcat:Dataset"
about=""
py:strip="">
<py:def function="optional_head">
<!-- data preview -->
<link rel="stylesheet" href="${h.url_for('/scripts/vendor/recline/css/data-explorer.css')}" />
<link rel="stylesheet" href="${h.url_for('/scripts/vendor/recline/css/graph-flot.css')}" />
<!-- /data preview -->
<script type="text/javascript">
var preload_resource = ${h.literal(c.resource_json)};
</script>
</py:def>
<py:def function="page_title">
${h.dataset_display_name(c.package)} /
${h.resource_display_name(c.resource)} - Dataset - Resource
</py:def>
<py:def function="page_heading">${h.dataset_display_name(c.package)} / ${h.resource_display_name(c.resource)}</py:def>
<div py:match="content">
<div class="notes" property="rdfs:label">
<div id="notes-extract">
${c.resource.get('description') or '(No description)'}
</div>
</div>
<div class="resource-actions span-8">
<a py:if="c.resource.get('url')" class="pretty-button primary resource-url-analytics" href="${c.resource.get('url')}">
<py:choose test="c.resource.get('resource_type')">
<py:when test="'listing'">View</py:when>
<py:when test="'service'">View</py:when>
<py:when test="'api'">API Endpoint</py:when>
<py:otherwise><img style="margin: 4px 8px 0 0;" src="${h.icon_url('arrow-down-16')}"/><span style="position: relative; bottom: 3px;">Download</span></py:otherwise>
</py:choose>
</a>
</div>
<div class="quick-info">
<dl>
<dt>Part of dataset</dt>
<dd>
${h.dataset_link(c.package)}
</dd>
<dt>Last updated</dt>
<dd>${h.time_ago_in_words_from_str(c.resource['last_modified'], granularity='day')}</dd>
<dt>Format</dt>
<dd>
${c.resource['format'] or 'Unknown'}
</dd>
<dt>Licence</dt>
<dd>
<py:choose test="">
<span py:when="c.pkg.license and c.pkg.license.url"><a
href="${c.pkg.license.url}" rel="dc:rights">${c.pkg.license.title.split('::')[-1]}</a></span>
<span py:when="c.pkg.license" property="dc:rights">${c.pkg.license.title}</span>
<span py:when="c.pkg.license_id" property="dc:rights">${c.pkg.license_id}</span>
</py:choose>
<py:if test="c.pkg.isopen()">
<a 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>
</py:if>
<py:if test="not c.pkg.isopen()">
<span class="closed">
${h.icon('lock')}
</span>
</py:if>
</dd>
</dl>
</div>
<div py:if="not c.resource.get('description') and c.package.get('notes')" id="dataset-description">
<div>
<strong>
From the <a href="${h.url_for(controller='package', action='read', id=c.package['name'])}">Dataset</a>:
</strong>
</div>
<div>${h.markdown_extract(c.package.get('notes'), 300)}</div>
</div>
<div class="resource-preview">
<h3>Preview</h3>
<div id="ckanext-datapreview"></div>
</div>
<br/>
<div class="resource-information">
<h3>Additional Information</h3>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<py:for each="i, key in enumerate(sorted(c.resource.keys()))">
<tr py:if="not key=='description'">
<td class="dataset-label" property="rdfs:label">${_(key)}</td>
<td class="dataset-details" property="rdf:value">${c.resource[key]}</td>
</tr>
</py:for>
</tbody>
</table>
</div>
</div>
<py:def function="optional_footer">
<!-- data preview -->
<script type="text/javascript" src="${h.url_for('/scripts/vendor/jquery.mustache/jquery.mustache.js')}"></script>
<script type="text/javascript" src="${h.url_for('/scripts/vendor/flot/0.7/jquery.flot.js')}"></script>
<script src="${h.url_for('/scripts/vendor/recline/recline.js')}"></script>
</py:def>
<xi:include href="layout.html" />
</html>