diff --git a/ckan/templates/package/read.html b/ckan/templates/package/read.html index aa9ad45fcb3..280582fd241 100644 --- a/ckan/templates/package/read.html +++ b/ckan/templates/package/read.html @@ -1,185 +1,81 @@ - - - - - ${c.pkg_dict.title or c.pkg_dict.name} - Datasets - - - - -
-
-

This is an old revision of this dataset, as edited at ${h.render_datetime(c.pkg_revision_timestamp, with_hours=True)}. It may differ significantly from the current revision.

-

This is the current revision of this dataset, as edited at ${h.render_datetime(c.pkg_revision_timestamp, with_hours=True)}.

+{% extends "page.jinja.html" %} + +{% block title %}{{ c.pkg_dict.title or c.pkg_dict.name }} - {{ super() }}{% endblock %} + +{% block breadcrumb %} + {% set dataset = c.pkg_dict.title or c.pkg_dict.name %} + +{% endblock %} + +{% block actions %} +
    +
  • {{ h.nav_link(_('History'), controller='package', action='history', id=c.pkg.id, class_='btn', icon='rewind') }}
  • +
  • {{ h.nav_link(_('Edit'), controller='package', action='edit', id=c.pkg.id, class_='btn', icon='tools', condition=h.check_access('package_update',{'id':c.pkg.id })) }}
  • +
  • Report Issue
  • +
+{% endblock %} + +{% block primary_content %} + {% 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=c.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 %} +

+
+ {% endif %} + +
+
+

{{ c.pkg_dict.title or c.pkg_dict.name }}

+ {% if c.pkg_notes_formatted %} +
+ {{ c.pkg_notes_formatted }}
+ {% endif %} + +
+ +
+

Data and Resources

+ {% if c.pkg_dict.resources %} +
    + {% for res in c.pkg_dict.resources %} + {{ h.snippets('package/snippets/resource_item.html', resource=res) }} + {% endfor %} +
+ {% else %} +

{% trans %}This dataset has no data, why not add some?{% endtrans %}

+ {% endif %} +
-
-
-

${c.pkg_dict.title or c.pkg_dict.name}

-
- ${c.pkg_notes_formatted} -
- -
- -
-

Data and Resources

- - -

This dataset has no data, why not add some?

-
-
-
- ${h.snippet('snippets/tag_list.html', tags=c.pkg_dict.tags)} -
-
-

Additional Info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldValue
Source${c.pkg_url_link}
Author${c.pkg_author_link}
Maintainer${c.pkg_maintainer_link}
Version${c.pkg.version}
Country${h.code_to_country(c.eu_country)}
State${c.pkg.state}
Harvest Source - Dataset page on - ${c.harvest_catalogue_name} -
${_(key)}${value}
-
-
-
+ {{ h.snippet('package/snippets/tags.html', tags=c.pkg_dict.tags) }} - - - + {{ h.snippet('snippets/disqus_trackback.html') }} +{% endblock %} diff --git a/ckan/templates/package/snippets/additional_info.html b/ckan/templates/package/snippets/additional_info.html new file mode 100644 index 00000000000..915efe6e66f --- /dev/null +++ b/ckan/templates/package/snippets/additional_info.html @@ -0,0 +1,72 @@ +
+

{{ _('Additional Info') }}

+ + + + + + + + + {% if c.pkg.url %} + + + + + {% endif %} + + {% if c.pkg_author_link %} + + + + + {% endif %} + + {% if c.pkg_maintainer_link %} + + + + + {% endif %} + + {% if c.pkg.version %} + + + + + {% endif %} + + {% if c.eu_country %} + + + + + {% endif %} + + {% if h.check_access('package_update',{'id':c.pkg.id}) %} + + + + + {% endif %} + + {% if c.harvest_catalogue_name %} + + + + + {% endif %} + + {% for extra in c.pkg_extras %} + {% set key, value = extra %} + + + + + {% endfor %} + +
{{ _('Field') }}{{ _('Value') }}
{{ _('Source') }}{{ c.pkg_url_link }}
{{ _("Author") }}{{ c.pkg_author_link }}
{{ _('Maintainer') }}{{ c.pkg_maintainer_link }}
{{ _("Version") }}{{ c.pkg.version }}
{{ _("Country") }}{{ h.code_to_country(c.eu_country) }}
{{ _("State") }}{{ c.pkg.state }}
{{ _('Harvest Source') }} + {{ _('Dataset page') }} on + {{ c.harvest_catalogue_name }} +
{{ _(key) }}{{ value }}
+
diff --git a/ckan/templates/package/snippets/resource_item.html b/ckan/templates/package/snippets/resource_item.html new file mode 100644 index 00000000000..3b037d5d14b --- /dev/null +++ b/ckan/templates/package/snippets/resource_item.html @@ -0,0 +1,15 @@ +{% set url = h.url_for(controller='package', action='resource_read', id=c.pkg_dict['name'], resource_id=res['id']) %} +
  • + + {{ h.resource_display_name(res) | truncate(50) }}{{ res.format }} + {{ h.popular('views', res.tracking_summary.total, min=10) }} + +

    + {% if res.name %} + {{ h.markdown_extract(res.description, extract_length=80) }} + {% else %} + {{ _('No description for this resource') }} + {% endif %} +

    + {{ _('Explore Data') }} +
  • diff --git a/ckan/templates/package/snippets/tags.html b/ckan/templates/package/snippets/tags.html new file mode 100644 index 00000000000..632194c021d --- /dev/null +++ b/ckan/templates/package/snippets/tags.html @@ -0,0 +1,5 @@ +{% if tags %} +
    + {{ h.snippet('snippets/tag_list.html', tags=tags) }} +
    +{% endif %} diff --git a/ckan/templates/snippets/disqus_trackback.html b/ckan/templates/snippets/disqus_trackback.html new file mode 100644 index 00000000000..d8d46c03069 --- /dev/null +++ b/ckan/templates/snippets/disqus_trackback.html @@ -0,0 +1,4 @@ +
    +

    Trackback URL

    +
    +
    diff --git a/ckan/templates/snippets/group.html b/ckan/templates/snippets/group.html new file mode 100644 index 00000000000..2c3fcba4bf0 --- /dev/null +++ b/ckan/templates/snippets/group.html @@ -0,0 +1,9 @@ +
    +
    + + +

    {{ group.name }}

    +
    +

    {{ h.markdown_extract(group.description) }}

    +
    +
    diff --git a/ckan/templates/snippets/license.html b/ckan/templates/snippets/license.html index d6306bfb9ad..82e8df7eba7 100644 --- a/ckan/templates/snippets/license.html +++ b/ckan/templates/snippets/license.html @@ -1,11 +1,6 @@ - - ${dataset.license_title} - ${dataset.license_title} - - [Open Data] - - ${h.icon('lock')} - +{% if pkg.license_id %} +
    +

    License

    +

    {{ h.snippet('snippets/license.html', dataset=pkg_dict) }}

    +
    +{% endif %} diff --git a/ckan/templates/snippets/license_text.html b/ckan/templates/snippets/license_text.html new file mode 100644 index 00000000000..d6306bfb9ad --- /dev/null +++ b/ckan/templates/snippets/license_text.html @@ -0,0 +1,11 @@ + + ${dataset.license_title} + ${dataset.license_title} + + [Open Data] + + ${h.icon('lock')} + diff --git a/ckan/templates/snippets/related.html b/ckan/templates/snippets/related.html new file mode 100644 index 00000000000..55a17eec46f --- /dev/null +++ b/ckan/templates/snippets/related.html @@ -0,0 +1,18 @@ +{% set item = pkg.related | first %} +
    +

    Related Add Related

    +
    + {% if item %} + {{ item.type }} + {{ item.title }} + {{ item.description }} + {{ item.url }} + {{ item.image_url }} + {{ item.id }} + {% else %} +

    No apps, ideas, news stories or images have been + related to this dataset yet, why not add one now?

    +

    Add Item

    + {% endif %} +
    +
    diff --git a/ckan/templates/snippets/subscribe.html b/ckan/templates/snippets/subscribe.html new file mode 100644 index 00000000000..1385e5a36b5 --- /dev/null +++ b/ckan/templates/snippets/subscribe.html @@ -0,0 +1,7 @@ +
    +

    Subscribe

    + +