-
Notifications
You must be signed in to change notification settings - Fork 2k
/
resource_read.html
180 lines (163 loc) · 6.07 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<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="">
<xi:include href="../_snippet/data-api-help.html" />
<py:def function="optional_head">
<!-- data preview -->
<link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/data-explorer.css')}" />
<link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/graph-flot.css')}" />
<style type="text/css">
.recline-query-editor form, .recline-query-editor .text-query {
height: 28px;
}
.header .recline-query-editor .text-query input {
height: 20px;
}
.recline-query-editor .pagination ul {
margin: 0;
padding: 0;
}
</style>
<!-- /data preview -->
<style type="text/css">
.resource-actions {
margin-right: 0;
}
.resource-actions .btn {
position: relative;
bottom: 3px;
padding: 8px 10px;
}
.resource-actions .download {
display: inline;
}
.resource-actions .download img {
margin: 0px 4px -4px 0;
}
</style>
<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_link(c.package)}
/
${h.resource_display_name(c.resource)}
</py:def>
<div py:match="content">
<div class="resource-actions span-8">
<a py:if="c.resource.get('url')" class="btn btn-primary resource-url-analytics resource-type-${c.resource.get('resource_type')}" 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>
<div class="download">
<img src="${h.icon_url('arrow-down-16')}"/>
Download
</div>
</py:otherwise>
</py:choose>
</a>
<py:if test="config.get('ckan.datastore.enabled', False)">
<py:if test="c.resource.get('webstore_url')">
<a class="btn btn-success" data-toggle="modal" href=".modal-data-api-help">Data API</a>
</py:if>
<py:if test="not c.resource.get('webstore_url')">
<a class="btn disabled" rel="tooltip" title="Data API is unavailable for this resource as DataStore is disabled">Data API</a>
</py:if>
</py:if>
</div>
<py:if test="config.get('ckan.datastore.enabled', False)">
${data_api_help(c.datastore_api)}
</py:if>
<div class="quick-info">
<dl>
<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>
<span py:when="not(c.pkg.license)">License unknown</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 class="notes" property="rdfs:label">
<div id="notes-extract">
${c.resource.get('description') or '(No description)'}
</div>
</div>
<div py:if="not c.resource.get('description') and c.package.get('notes')" id="dataset-description">
<div>
<strong i18n:msg="">
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>
<span class="insert-comment-thread"></span>
</div>
<py:def function="optional_footer">
<!-- data preview -->
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.mustache/jquery.mustache.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/flot/0.7/jquery.flot.js')}"></script>
<script src="${h.url_for_static('/scripts/vendor/recline/recline.js')}"></script>
</py:def>
<xi:include href="layout.html" />
</html>