Drop support for old versions in templates
This commit is contained in:
parent
7b391e6be9
commit
8c340f3690
|
@ -2,8 +2,5 @@
|
|||
|
||||
{% block styles %}
|
||||
{{ super() }}
|
||||
|
||||
{% set type = 'asset' if h.ckan_version().split('.')|map('int')|list >= [2, 9, 0] else 'resource' %}
|
||||
{% include 'harvest/snippets/harvest_' ~ type ~ '.html' %}
|
||||
|
||||
{% include 'harvest/snippets/harvest_asset.html' %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{% resource 'harvest-extra-field/main' %}
|
|
@ -1 +0,0 @@
|
|||
{% resource 'ckanext-harvest/styles/harvest.css' %}
|
|
@ -7,65 +7,38 @@
|
|||
<li class="active"><a href="">{{ _('Admin') }}</a></li>
|
||||
{% endblock %}
|
||||
|
||||
{% block action_links %}
|
||||
{% block content_action %}
|
||||
<div class="content_action btn-group">
|
||||
{% if harvest_source.status and harvest_source.status.last_job and (harvest_source.status.last_job.status == 'New' or harvest_source.status.last_job.status == 'Running') %}
|
||||
<a class="btn btn-default disabled" rel="tooltip" title="There already is an unrun job for this source"><i class="fa fa-lg fa-refresh icon-refresh icon-large"></i> Reharvest</a>
|
||||
{% else %}
|
||||
{% set locale = h.dump_json({'content': _('This will re-run the harvesting for this source. Any updates at the source will overwrite the local datasets. Sources with a large number of datasets may take a significant amount of time to finish harvesting. Please confirm you would like us to start reharvesting.')}) %}
|
||||
|
||||
<a href="{{ h.url_for('harvest_refresh', id=harvest_source.id) }}" class="btn btn-default" data-module="confirm-action" data-module-i18n="{{ locale }}"
|
||||
title="{{ _('Start a new harvesting job for this harvest source now') }}">
|
||||
<i class="fa fa-refresh icon-refresh"></i>
|
||||
{{ _('Reharvest') }}
|
||||
</a>
|
||||
|
||||
{% endif %}
|
||||
{% if harvest_source.status and harvest_source.status.last_job and (harvest_source.status.last_job.status == 'Running') %}
|
||||
|
||||
<a href="{{ h.url_for('harvest_job_abort', source=harvest_source.name, id=harvest_source.status.last_job.id) }}" class="btn btn-default" title="Stop this Job">
|
||||
<i class="fa fa-ban icon-ban-circle"></i>
|
||||
{{ _('Stop') }}
|
||||
</a>
|
||||
|
||||
{% endif %}
|
||||
{% set locale = h.dump_json({'content': _('Warning: This will remove all datasets for this source, as well as all previous job reports. Are you sure you want to continue?')}) %}
|
||||
|
||||
<a href="{{ h.url_for('harvest_clear', id=harvest_source.id) }}" class="btn btn-default" data-module="confirm-action" data-module-i18n="{{ locale }}"
|
||||
title="{{ _('Delete all harvest jobs and existing datasets from this source') }}">
|
||||
{{ _('Clear') }}
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="{{ h.url_for('{0}_read'.format(c.dataset_type), id=harvest_source.id) }}" class="btn btn-default">
|
||||
<i class="fa fa-eye eye-open"></i>
|
||||
{{ _('View harvest source') }}
|
||||
</a>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{# CKAN 2.0 #}
|
||||
{% block actions_content %}
|
||||
{{ self.action_links() }}
|
||||
{% endblock %}
|
||||
|
||||
{# CKAN 2.1 #}
|
||||
{% block content_action %}
|
||||
<div class="content_action btn-group">
|
||||
{{ self.action_links() }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header_tabs %}
|
||||
{% set ckan_version = h.ckan_version().split('.')[1] %}
|
||||
{% if ckan_version | int >= 9 %}
|
||||
{{ h.build_nav_icon('harvester.admin', _('Dashboard'), id=harvest_source.name, icon='dashboard') }}
|
||||
{{ h.build_nav_icon('harvester.job_list', _('Jobs'), source=harvest_source.name, icon='reorder') }}
|
||||
{{ h.build_nav_icon(c.dataset_type ~ '.edit', _('Edit'), id=harvest_source.name, icon='edit') }}
|
||||
{% else %}
|
||||
{{ h.build_nav_icon('{0}_admin'.format(c.dataset_type), _('Dashboard'), id=harvest_source.name, icon='dashboard') }}
|
||||
{{ h.build_nav_icon('{0}_job_list'.format(c.dataset_type), _('Jobs'), source=harvest_source.name, icon='reorder') }}
|
||||
{{ h.build_nav_icon('{0}_edit'.format(c.dataset_type), _('Edit'), id=harvest_source.name, icon='edit') }}
|
||||
{% endif %}
|
||||
{{ h.build_nav_icon('harvester.admin', _('Dashboard'), id=harvest_source.name, icon='dashboard') }}
|
||||
{{ h.build_nav_icon('harvester.job_list', _('Jobs'), source=harvest_source.name, icon='reorder') }}
|
||||
{{ h.build_nav_icon(c.dataset_type ~ '.edit', _('Edit'), id=harvest_source.name, icon='edit') }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -6,12 +6,7 @@
|
|||
|
||||
<div class="module-content">
|
||||
{% block form %}
|
||||
{% if c.form %}
|
||||
{# CKAN < 2.3 #}
|
||||
{{ c.form | safe }}
|
||||
{% else %}
|
||||
{{- h.snippet(form_snippet, c=c, **form_vars) -}}
|
||||
{% endif %}
|
||||
{{- h.snippet(form_snippet, c=c, **form_vars) -}}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -13,12 +13,7 @@
|
|||
{% block primary_content %}
|
||||
<section class="module">
|
||||
<div class="module-content">
|
||||
{% if c.form %}
|
||||
{# CKAN < 2.3 #}
|
||||
{{ c.form | safe }}
|
||||
{% else %}
|
||||
{{- h.snippet(form_snippet, c=c, **form_vars) -}}
|
||||
{% endif %}
|
||||
{{- h.snippet(form_snippet, c=c, **form_vars) -}}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
{% import 'macros/form.html' as form %}
|
||||
|
||||
{% include 'harvest/snippets/harvest_extra_field_asset.html' %}
|
||||
|
||||
{% set type = 'asset' if h.ckan_version().split('.')|map('int')|list >= [2, 9, 0] else 'resource' %}
|
||||
{% include 'harvest/snippets/harvest_extra_field_' ~ type ~ '.html' %}
|
||||
|
||||
<form id="source-new" class="form-horizontal dataset-form {{ h.bootstrap_version() }}" method="post" >
|
||||
<form id="source-new" class="form-horizontal {{ h.bootstrap_version() }}" method="post" >
|
||||
|
||||
{% block errors %}{{ form.errors(error_summary) }}{% endblock %}
|
||||
|
||||
|
@ -14,7 +12,7 @@
|
|||
</span>
|
||||
{% endcall %}
|
||||
|
||||
{{ h.csrf_input() if 'csrf_input' in h }}
|
||||
{{ h.csrf_input() if 'csrf_input' in h }}
|
||||
|
||||
{{ form.input('title', id='field-title', label=_('Title'), placeholder=_('eg. A descriptive title'), value=data.title, error=errors.title, classes=['control-full'], attrs={'data-module': 'slug-preview-target'}) }}
|
||||
|
||||
|
|
|
@ -6,16 +6,14 @@
|
|||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{# CKAN 2.0 #}
|
||||
{% block actions_content %}
|
||||
{% if authorized_user %}
|
||||
<li>{{ self.admin_link() }}</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{# TODO: once #354 is merged in CKAN core .profile-info doesn't exist #}
|
||||
{% block secondary_content %}
|
||||
<div class="module context-info profile-info">
|
||||
<div class="module context-info">
|
||||
<section class="module-content">
|
||||
<h1 class="heading">{{ harvest_source.title }}</h1>
|
||||
{% if harvest_source.notes %}
|
||||
|
@ -37,7 +35,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block primary_content %}
|
||||
<article class="module prose">
|
||||
<article class="module">
|
||||
{% block page_header %}
|
||||
<header class="module-content page-header">
|
||||
{% block content_action %}
|
||||
|
@ -47,14 +45,8 @@
|
|||
{% endblock %}
|
||||
<ul class="nav nav-tabs">
|
||||
{% block page_header_tabs %}
|
||||
{% set ckan_version = h.ckan_version().split('.')[1] %}
|
||||
{% if ckan_version | int >= 9 %}
|
||||
{{ h.build_nav_icon(c.dataset_type ~ '.read', _('Datasets'), id=harvest_source.name, icon='sitemap') }}
|
||||
{{ h.build_nav_icon('harvester.about', _('About'), id=harvest_source.name, icon='info-sign') }}
|
||||
{% else %}
|
||||
{{ h.build_nav_icon('{0}_read'.format(c.dataset_type), _('Datasets'), id=harvest_source.name, icon='sitemap') }}
|
||||
{{ h.build_nav_icon('{0}_about'.format(c.dataset_type), _('About'), id=harvest_source.name, icon='info-sign') }}
|
||||
{% endif %}
|
||||
{{ h.build_nav_icon(c.dataset_type ~ '.read', _('Datasets'), id=harvest_source.name, icon='sitemap') }}
|
||||
{{ h.build_nav_icon('harvester.about', _('About'), id=harvest_source.name, icon='info-sign') }}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</header>
|
||||
|
|
|
@ -8,23 +8,7 @@
|
|||
{% endblock %}
|
||||
|
||||
|
||||
{% if g.ckan_base_version.startswith('2.0') %}
|
||||
{# CKAN 2.0 #}
|
||||
|
||||
{% block add_action_content %}
|
||||
{{ h.snippet('snippets/add_source_button.html', dataset_type=c.dataset_type) }}
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block primary_content %}
|
||||
{% if g.ckan_base_version.startswith('2.0') %}
|
||||
{# CKAN 2.0 #}
|
||||
|
||||
{% include 'source/search_2.0.html' %}
|
||||
|
||||
{% else %}
|
||||
{# > CKAN 2.0 #}
|
||||
|
||||
<section class="module">
|
||||
<div class="module-content">
|
||||
{% block page_primary_action %}
|
||||
|
@ -56,9 +40,7 @@
|
|||
{{ c.page.pager(q=c.q) }}
|
||||
</section>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue