-
Notifications
You must be signed in to change notification settings - Fork 2k
/
resource_read.html
118 lines (103 loc) · 4.41 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
{% extends "page.html" %}
{% set pkg = c.pkg_dict %}
{% set res = c.resource %}
{% block subtitle %}{{ h.dataset_display_name(c.package) }} - {{ h.resource_display_name(res) }}{% endblock %}
{% block breadcrumb_content %}
<li>{% link_for _('Datasets'), controller='package', action='search', highlight_actions = 'new index' %}</li>
<li>{% link_for h.dataset_display_name(c.package)|truncate(15), controller='package', action='read', id=c.package.get('name') %}</li>
<li class="active"><a href="">{{ h.resource_display_name(res)|truncate(30) }}</a></li>
{% endblock %}
{% block actions_content %}
{% snippet 'package/snippets/back_to_package_action.html', pkg=pkg %}
{% if h.check_access('package_update', {'id':pkg.id }) %}
<li>{% link_for _('Edit Resource'), controller='package', action='resource_edit', id=pkg.name, resource_id=res.id, class_='btn', icon='wrench' %}</li>
{% endif %}
{% if res.url %}
<li>
<a class="btn btn-primary resource-url-analytics resource-type-{{ res.resource_type }}" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
<i class="icon-eye-open"></i> {{ _('View') }}
{% elif res.resource_type == 'api' %}
<i class="icon-key"></i> {{ _('API Endpoint') }}
{% else %}
<i class="icon-download"></i> {{ _('Download') }}
{%endif %}
</a>
</li>
{% endif %}
{% if 'datastore' in g.plugins %}
<li>{% snippet 'package/snippets/data_api_button.html', resource=res, datastore_root_url=c.datastore_api %}</li>
{% endif %}
{% endblock %}
{% block main_content %}
{{ self.flash() }}
{{ self.toolbar() }}
{% block resource %}
<section class="module">
<div class="module-content">
{% block resource_content %}
{% block resource_read_title %}<h1 class="page-heading">{{ h.resource_display_name(res) | truncate(50) }}</h1>{% endblock %}
<div class="prose notes" property="rdfs:label">
{% if res.description %}
{{ h.render_markdown(res.description) }}
{% else %}
<p class="empty">{{ _('There is no description for this resource') }}</p>
{% endif %}
{% if not res.description and c.package.notes %}
<h3>{{ _('From the dataset abstract') }}</h3>
<blockquote>{{ h.markdown_extract(c.package.get('notes')) }}</blockquote>
<p>{% trans dataset=c.package.title, url=h.url_for(controller='package', action='read', id=c.package['name']) %}Source: <a href="{{ url }}">{{ dataset }}</a>{% endtrans %}
{% endif %}
{% endblock %}
</div>
</div>
{% block data_preview %}
{{ h.resource_preview(c.resource, c.package.id) }}
{% endblock %}
</section>
{% endblock %}
{{ self.primary() }}
{{ self.secondary() }}
{% endblock %}
{% block primary_content %}
{% block resource_additional_information %}
{% if res %}
<section class="module">
<div class="module-content">
<h2>Additional Information</h2>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{% for key, value in h.format_resource_items(res.items()) %}
<tr><th>{{ key }}</th><td>{{ value }}</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
{% endif %}
{% endblock %}
{% endblock %}
{% block secondary_content %}
{% block resource_information %}
<section class="module module-narrow">
<h2 class="module-heading"><i class="icon-medium icon-info-sign"></i> Resource Information</h2>
<ul class="simple-list">
<li><i class="ckan-icon ckan-icon-calendar"></i> Last Updated: {{ h.render_datetime(res.last_modified) or _("unknown") }}</li>
<li><i class="ckan-icon ckan-icon-file"></i> Format: {{ res.mimetype_inner or res.mimetype or _("unknown") }}</li>
<li><i class="ckan-icon ckan-icon-lock"></i> {% snippet "snippets/license.html", pkg_dict=pkg, text_only=True %}</li>
</ul>
</section>
{% endblock %}
{% block resources_list %}
{% snippet "package/snippets/resources.html", pkg=pkg, active=res.id %}
{% endblock %}
{% block resource_license %}
{% snippet "snippets/social.html" %}
{% endblock %}
{% endblock %}