Skip to content

Commit 4dd836e

Browse files
Resource additional info template hardcode
1 parent 31aebde commit 4dd836e

2 files changed

Lines changed: 14 additions & 23 deletions

File tree

ckanext/iaea/assets/css/custom.css

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,24 +202,13 @@
202202
font-weight: bold;
203203
}
204204

205-
/* Hide the Data Dictionary section on the resource view page. The datastore
206-
plugin outranks this theme in CKAN's template search path, so it cannot be
207-
removed via a template override from here; hide it with CSS instead. The
208-
dictionary renders as a .module-content whose direct children include the
209-
per-field .accordion elements (built by datastore/snippets/dictionary_view.html).
210-
Scope this tightly: the admin trash page (admin/snippets/data_type.html) also
211-
renders .accordion elements as direct children of a .module-content -- the one
212-
core page.html wraps around {% block primary_content_inner %} -- so a bare
213-
".module-content:has(> .accordion)" blanks the whole trash page, Purge all form
214-
included. Two things distinguish the dictionary: its .module-content is a direct
215-
child of a <section class="module"> (the trash one sits in page.html's
216-
<article class="module">), and it opens with an <h2>Data Dictionary</h2> heading
217-
immediately before the accordions (the trash one opens with a <form>). Require
218-
both. The dictionary remains editable on the dedicated /dictionary page, which
219-
nests .accordion-item inside a <form> and never matched this rule. */
220-
section.module > .module-content:has(> h2 + .accordion) {
221-
display: none;
222-
}
205+
/* The Data Dictionary section is no longer hidden with CSS. It is suppressed at
206+
the template level by an empty {% block resource_data_dictionary %} in
207+
templates/scheming/package/resource_read.html, which is the child-most template
208+
in the resource_read inheritance chain. The previous rule here selected on
209+
".module-content:has(> .accordion)", which also matched the admin trash page and
210+
blanked it entirely -- see admin/snippets/data_type.html. Do not reintroduce a
211+
broad .accordion rule; the accordion styling above is shared with the trash page. */
223212

224213
/* ckanext-charts renders its chart-config form with Bootstrap 5 tab markup:
225214
the active pane is <div class="tab-pane fade show active">. This theme ships

ckanext/iaea/templates/scheming/package/resource_read.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
{%- set schema = h.scheming_get_dataset_schema(dataset_type) -%}
1010

1111
{% block resource_additional_information_inner %}
12-
{% if res.datastore_active %}
13-
{% block resource_data_dictionary %}
14-
{{ super() }}
15-
{% endblock %}
16-
{% endif %}
12+
{#- Suppress the Data Dictionary section. The block must be redefined EMPTY here
13+
rather than deleted: this template is the child-most in the resource_read
14+
chain (iaea -> datastore -> xloader -> iaea -> validation -> core), so an
15+
empty definition wins, but removing it entirely would let datastore's
16+
definition -- which renders the dictionary snippet and never calls super()
17+
-- take over again. The dictionary stays editable at /dictionary. -#}
18+
{% block resource_data_dictionary %}{% endblock %}
1719

1820
<div class="module-content">
1921
{%- block additional_info_heading -%}<h2>{{ _('Additional Information') }}</h2>{%- endblock -%}

0 commit comments

Comments
 (0)