Skip to content

Commit

Permalink
ref: migrate templates to CKAN 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Sep 12, 2023
1 parent f19d4af commit 7ad223f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.7.0
- ref: use proper theming in CKAN 2.10
- ref: migrate templates to CKAN 2.10
0.6.1
- maintenance release
0.6.0
Expand Down
13 changes: 0 additions & 13 deletions ckanext/dcor_theme/templates/home/about.html

This file was deleted.

3 changes: 0 additions & 3 deletions ckanext/dcor_theme/templates/home/index.html

This file was deleted.

4 changes: 2 additions & 2 deletions ckanext/dcor_theme/templates/home/snippets/promoted.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set intro = g.site_intro_text %}

<div class="module-content box">
<div class="module-promotion card box">
<div>
{% if intro %}
{{ h.render_markdown(intro) }}
Expand All @@ -20,7 +20,7 @@ <h1 class="page-heading">{{ _("Welcome to DCOR") }}</h1>
<section class="featured media-overlay hidden-xs">
{% block home_image_content %}
<a class="media-image" href="{{ h.url_for_static('/images/dcor_tiles.png') }}">
<img class="img-responsive" src="{{ h.url_for_static('/images/dcor_tiles_420.jpg') }}" alt="Placeholder" width="420" height="152" />
<img class="img-fluid" src="{{ h.url_for_static('/images/dcor_tiles_420.jpg') }}" alt="Placeholder" width="420" height="152" />
</a>
{% endblock %}
</section>
Expand Down
4 changes: 2 additions & 2 deletions ckanext/dcor_theme/templates/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{# Just replace "users" icon by "group" icon for groups #}

{% block content_primary_nav %}
{{ h.build_nav_icon(dataset_type ~ '.read', _('Dataset'), id=pkg.id if is_activity_archive else pkg.name, icon='sitemap') }}
{{ h.build_nav_icon(dataset_type ~ '.groups', _('Groups'), id=pkg.id if is_activity_archive else pkg.name, icon='group') }}
{{ h.build_nav_icon(dataset_type ~ '.read', _('Dataset'), id=pkg.name, icon='sitemap') }}
{{ h.build_nav_icon(dataset_type ~ '.groups', h.humanize_entity_type('group', default_group_type, 'content tab') or _('Groups'), id=pkg.name, icon='group') }}
{% endblock %}
5 changes: 2 additions & 3 deletions ckanext/dcor_theme/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
{% block package_archive_notice %}
{% endblock %}

{% block resource_read_title %}<h1 class="page-heading">{{ h.resource_display_name(res) | truncate(50) }}</h1>
{% endblock %}

{% block resource_read_title %}<h1 class="page-heading">{{ h.resource_display_name(res) | truncate(50) }}</h1>{% endblock %}

{% block resource_read_url %}
{% endblock %}

Expand Down
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from setuptools import setup, find_packages
from codecs import open # To use a consistent encoding
import sys
import warnings

author = "Paul Müller"
authors = [author]
Expand All @@ -12,6 +13,19 @@
sys.path.insert(0, realpath(dirname(__file__))+"/" + "/".join(name.split("-")))
from _version import version # noqa: E402

try:
# Make sure this fails for old CKAN versions
import ckan
ckan_version = [int(v) for v in ckan.__version__.split(".")]
if ckan_version < [2, 10, 1]:
raise ValueError(
f"Your CKAN version {ckan_version} is not supported! If you "
f"are still on CKAN 2.9.5, then the following package versions "
f"are supported:"
f"\n ckanext-dcor_theme<=0.7.0"
)
except ImportError:
warnings.warn("CKAN not installed, supported version check skipped.")

setup(
name=name,
Expand Down

0 comments on commit 7ad223f

Please sign in to comment.