diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index e3ba231..b6bc3f5 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -55,6 +55,9 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm): def search_template(self): return 'source/search.html' + def read_template(self): + return 'source/read.html' + def new_template(self): return 'source/new.html' diff --git a/ckanext/harvest/templates_new/source/read.html b/ckanext/harvest/templates_new/source/read.html index d2a28b7..223d105 100644 --- a/ckanext/harvest/templates_new/source/read.html +++ b/ckanext/harvest/templates_new/source/read.html @@ -1,160 +1,118 @@ {% extends "page.html" %} -{% block title %}{{ _('Harvest Source Details') }} - {{ super() }}{% endblock %} - -{% block styles %} - {{ super() }} - -{% endblock %} +{% set pkg = c.pkg_dict %} +{% block subtitle %}{{ pkg.title or pkg.name }}{% endblock %} {% block breadcrumb_content %} +
  • {{ h.nav_named_link(_('Harvest Sources'), '{0}_search'.format(c.dataset_type)) }}
  • +
  • {{ h.nav_named_link(c.harvest_source.title|truncate(30), '{0}_read'.format(c.dataset_type), id=c.harvest_source.name) }}
  • {% endblock %} -{% block primary %} -
    -
    -
    - {% if c.source %} -

    Harvest Source Details

    - - {% if not c.source.active %} -
    NB: This Harvest Source is Withdrawn. Therefore the Gemini XML will not be harvested again. However, any metadata that was previously harvested, remains in the catalogue.
    +{% block actions_content %} + {% if h.check_access('package_update', {'id':pkg.id }) %} +
  • {{ h.nav_named_link(_('Edit'), '{0}_edit'.format(c.dataset_type), id=c.harvest_source.name, class_='btn btn-primary', icon='wrench')}}
  • + {% endif %} +
  • {{ h.follow_button('dataset', pkg.id) }}
  • +{% endblock %} + +{% block primary_content %} + {% block package_revision_info %} + {% if c.pkg_revision_id %} +
    +

    + {% set timestamp = h.render_datetime(c.pkg_revision_timestamp, with_hours=True) %} + {% set url = h.url(controller='package', action='read', id=pkg.name) %} + + {% if c.pkg_revision_not_latest %} + {% trans timestamp=timestamp, url=url %}This is an old revision of this dataset, as edited at {{ timestamp }}. It may differ significantly from the current revision.{% endtrans %} + {% else %} + {% trans timestamp=timestamp %}This is the current revision of this dataset, as edited at {{ timestamp }}.{% endtrans %} {% endif %} - - - - - - - - - - - - - - - - - - {% if c.source.title %} - - - - - {% endif %} - - - - - - - {% if c.source.config %} - - {% else %} - - {% endif %} - - {% if c.publisher_auth %} - - - - - {% endif %} - {% if c.publisher_auth %} - - - {% if c.source.publisher_title %} - - {% endif %} - {% if not c.source.publisher_title %} - - {% endif %} - - {% endif %} - - - - - - - - - - - - - - - - - - - - - - - - -
    ID{{ c.source.id }}
    URL{{ c.source.url }}
    Type{{ c.source.type }}
    Withdrawn{{ not c.source.active }}
    Title{{ c.source.title }}
    Description{{ c.source.description }}
    Configuration{{ c.source.config }}-
    User{{ c.source.user_id }}
    Publisher${c.source.publisher_title}{{ c.source.publisher_id }}
    Created{{ c.source.created }}
    Total jobs{{ c.source.status.job_count }}
    Status - Last Harvest Errors: {{ c.source.status.last_harvest_statistics.errors }}
    - {% if c.source.status.last_harvest_errors.gather | length > 0 %} - Gathering errors -
      - {% for error in c.source.status.last_harvest_errors.gather %} -
    • - {% set lines = error.split('\n') %} - {% for line in lines %} -
      {{ line }}
      - {% endfor %} -
    • - {% endfor %} -
    - {% endif %} - - {% if c.source.status.last_harvest_errors.object | length > 0 %} - Object errors -
      - {% for error in c.source.status.last_harvest_errors.object %} -
    • - - {% set lines = error['message'].split('\n') %} - {% for line in lines %} -
      {{ line }}
      - {% endfor %} -
    • - {% endfor %} -
    - {% endif %} - - Last Harvest Added: {{ c.source.status.last_harvest_statistics.added }}
    - Last Harvest Updated: {{ c.source.status.last_harvest_statistics.updated }}
    - Last Harvest: {{ c.source.status.last_harvest_request }}
    - Next Harvest: {{ c.source.status.next_harvest }} -
    Total Errors{{ c.source.status.overall_statistics.errors }}
    Total Datasets{{ c.source.status.overall_statistics.added }}
    Datasets - -
    There could be a 10 minutes delay before these datasets (or changes to them) appear on - the site or on search results.
    - -

    There are {{ c.page.item_count }} datasets.

    - - {{ c.page.pager() }} - {% for item in c.page.items %} - - {% endfor %} - {{ c.page.pager() }} -
    - {% endif %} +

    -
    + {% endif %} + {% endblock %} + +
    + + {% block package_header %} + + {% endblock %} + + {% block package_content %} + + {% block package_description %} +
    +
    CUSTOM HARVEST SOURCE TEMPLATE for {{ c.dataset_type}}
    +
    + +
    +

    {{ pkg.title or pkg.name }} + {% if pkg.state.startswith('draft') %} + [{{ _('Draft') }}] + {% endif %} +

    + {% if c.pkg_notes_formatted %} +
    + {{ c.pkg_notes_formatted }} +
    + {% endif %} + +
    + {% endblock %} + + {% block package_resources %} + {% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} + {% endblock %} + + {% block package_tags %} + {% snippet "package/snippets/tags.html", tags=pkg.tags %} + {% endblock %} + + {% block package_additional_info %} + {% snippet "package/snippets/additional_info.html", pkg_dict=pkg %} + {% endblock %} + + {% endblock %}
    {% endblock %} -{% block sidebar %}{% endblock %} +{% block secondary_content %} + + {% block secondary_help_content %}{% endblock %} + + {% block package_groups %} + {% for group in pkg.groups %} + {% snippet "snippets/group.html", group=group, truncate=70 %} + {% endfor %} + {% endblock %} + + {% block package_social %} + {% snippet "snippets/social.html" %} + {% endblock %} + + {% block package_related %} + {% snippet "snippets/related.html", item=c.pkg.related|last, pkg_name=pkg.name %} + {% endblock %} + + {% block package_license %} + {% snippet "snippets/license.html", pkg_dict=pkg %} + {% endblock %} + +{% endblock %}