Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion ckanext/versions/templates/package/resource_version.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{% extends "package/resource_read.html" %}


{% block resource_actions_inner %}
<li>
<div class="btn-group">
<a class="btn btn-primary resource-url-analytics" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
<i class="fa fa-eye"></i> {{ _('View') }}
{% elif res.resource_type == 'api' %}
<i class="fa fa-key"></i> {{ _('API Endpoint') }}
{% elif not res.has_views and not res.url_type == 'upload' %}
<i class="fa fa-external-link"></i> {{ _('Go to resource') }}
{% else %}
<i class="fa fa-arrow-circle-down"></i> {{ _('Download') }}
{% endif %}
</a>
{% block download_resource_button %}{% endblock download_resource_button %}
</div>
</li>
{% endblock %}

{% block action_manage %}
{% endblock action_manage %}

Expand All @@ -19,7 +39,6 @@
{% endblock %}

{% block data_preview %}

{% endblock %}


Expand Down
56 changes: 29 additions & 27 deletions ckanext/versions/templates/package/snippets/version_info.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{% set versions = h.get_package_version_list(pkg.id) %}
{% if versions|length > 0 %}

<h3>Versions</h3>
<section class="version-info">
<h3>Versions</h3>

<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">Version</th>
<th scope="col">Notes</th>
<th scope="col">Published</th>
</tr>
</thead>
<tbody>
{% for version in h.get_package_version_list(pkg.id) %}
<tr>
<td>
{% if (loop.first) %}
{{ version.name }} <span class="badge bg-success pull-right">Latest</span>
{% else %}
<a href="{{ url_for('dataset_version.view_dataset', id=pkg.id, version_id=version.id) }}">
{{ version.name }}
</a>
{% endif %}
</td>
<td>{{ version.notes or "" }}</td>
<td>{{ version.created }}</td>
</tr>
{% endfor %}
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">Version</th>
<th scope="col">Notes</th>
<th scope="col">Published</th>
</tr>
</thead>
<tbody>
{% for version in h.get_package_version_list(pkg.id) %}
<tr>
<td>
{% if (loop.first) %}
{{ version.name }} <span class="badge bg-success pull-right">Latest</span>
{% else %}
<a href="{{ url_for('dataset_version.view_dataset', id=pkg.id, version_id=version.id) }}">
{{ version.name }}
</a>
{% endif %}
</td>
<td>{{ version.notes or "" }}</td>
<td>{{ version.created }}</td>
</tr>
{% endfor %}

</tbody>
</table>
</tbody>
</table>
</section>
{% endif %}
11 changes: 10 additions & 1 deletion ckanext/versions/templates/package/version.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
{% endtrans %}
</div>
{% endblock %}

{{ super() }}
{% endblock package_description %}

Expand All @@ -21,3 +20,13 @@

{% block content_action %}
{% endblock %}

{% block package_additional_info %}
{% if h.scheming_plugin_enabled() %}
{%- set schema = h.scheming_get_dataset_schema(dataset_type) -%}
{% snippet "scheming/package/snippets/additional_info.html",
pkg_dict=pkg, dataset_type=dataset_type, schema=schema %}
{% else %}
{{ block.super }} {# Use block.super to call the parent block in Jinja2 #}
{% endif %}
{% endblock %}