Skip to content

Commit 801eb0a

Browse files
authored
Merge pull request #51 from datopian/fix/metadata
Fix/metadata
2 parents 16bb3e3 + bded77a commit 801eb0a

File tree

3 files changed

+59
-29
lines changed

3 files changed

+59
-29
lines changed

ckanext/versions/templates/package/resource_version.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{% extends "package/resource_read.html" %}
22

3+
4+
{% block resource_actions_inner %}
5+
<li>
6+
<div class="btn-group">
7+
<a class="btn btn-primary resource-url-analytics" href="{{ res.url }}">
8+
{% if res.resource_type in ('listing', 'service') %}
9+
<i class="fa fa-eye"></i> {{ _('View') }}
10+
{% elif res.resource_type == 'api' %}
11+
<i class="fa fa-key"></i> {{ _('API Endpoint') }}
12+
{% elif not res.has_views and not res.url_type == 'upload' %}
13+
<i class="fa fa-external-link"></i> {{ _('Go to resource') }}
14+
{% else %}
15+
<i class="fa fa-arrow-circle-down"></i> {{ _('Download') }}
16+
{% endif %}
17+
</a>
18+
{% block download_resource_button %}{% endblock download_resource_button %}
19+
</div>
20+
</li>
21+
{% endblock %}
22+
323
{% block action_manage %}
424
{% endblock action_manage %}
525

@@ -19,7 +39,6 @@
1939
{% endblock %}
2040

2141
{% block data_preview %}
22-
2342
{% endblock %}
2443

2544

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
{% set versions = h.get_package_version_list(pkg.id) %}
22
{% if versions|length > 0 %}
33

4-
<h3>Versions</h3>
4+
<section class="version-info">
5+
<h3>Versions</h3>
56

6-
<table class="table table-striped table-bordered table-condensed">
7-
<thead>
8-
<tr>
9-
<th scope="col">Version</th>
10-
<th scope="col">Notes</th>
11-
<th scope="col">Published</th>
12-
</tr>
13-
</thead>
14-
<tbody>
15-
{% for version in h.get_package_version_list(pkg.id) %}
16-
<tr>
17-
<td>
18-
{% if (loop.first) %}
19-
{{ version.name }} <span class="badge bg-success pull-right">Latest</span>
20-
{% else %}
21-
<a href="{{ url_for('dataset_version.view_dataset', id=pkg.id, version_id=version.id) }}">
22-
{{ version.name }}
23-
</a>
24-
{% endif %}
25-
</td>
26-
<td>{{ version.notes or "" }}</td>
27-
<td>{{ version.created }}</td>
28-
</tr>
29-
{% endfor %}
7+
<table class="table table-striped table-bordered table-condensed">
8+
<thead>
9+
<tr>
10+
<th scope="col">Version</th>
11+
<th scope="col">Notes</th>
12+
<th scope="col">Published</th>
13+
</tr>
14+
</thead>
15+
<tbody>
16+
{% for version in h.get_package_version_list(pkg.id) %}
17+
<tr>
18+
<td>
19+
{% if (loop.first) %}
20+
{{ version.name }} <span class="badge bg-success pull-right">Latest</span>
21+
{% else %}
22+
<a href="{{ url_for('dataset_version.view_dataset', id=pkg.id, version_id=version.id) }}">
23+
{{ version.name }}
24+
</a>
25+
{% endif %}
26+
</td>
27+
<td>{{ version.notes or "" }}</td>
28+
<td>{{ version.created }}</td>
29+
</tr>
30+
{% endfor %}
3031

31-
</tbody>
32-
</table>
32+
</tbody>
33+
</table>
34+
</section>
3335
{% endif %}

ckanext/versions/templates/package/version.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
{% endtrans %}
1212
</div>
1313
{% endblock %}
14-
1514
{{ super() }}
1615
{% endblock package_description %}
1716

@@ -21,3 +20,13 @@
2120

2221
{% block content_action %}
2322
{% endblock %}
23+
24+
{% block package_additional_info %}
25+
{% if h.scheming_plugin_enabled() %}
26+
{%- set schema = h.scheming_get_dataset_schema(dataset_type) -%}
27+
{% snippet "scheming/package/snippets/additional_info.html",
28+
pkg_dict=pkg, dataset_type=dataset_type, schema=schema %}
29+
{% else %}
30+
{{ block.super }} {# Use block.super to call the parent block in Jinja2 #}
31+
{% endif %}
32+
{% endblock %}

0 commit comments

Comments
 (0)