From 3e079068d330195c7b2c93e20c4050530b629069 Mon Sep 17 00:00:00 2001 From: Thorge Petersen <petersen@rz.uni-kiel.de> Date: Mon, 4 Mar 2024 10:51:09 +0100 Subject: [PATCH] Add hdv category info popover --- ckanext/odsh/assets/odsh.css | 6 +++--- ckanext/odsh/templates/package/snippets/info.html | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ckanext/odsh/assets/odsh.css b/ckanext/odsh/assets/odsh.css index 24d18f8..966d4ed 100644 --- a/ckanext/odsh/assets/odsh.css +++ b/ckanext/odsh/assets/odsh.css @@ -970,9 +970,9 @@ ul.dataset-resources { } .popover { - width: unset; - display: inline-table !important; - white-space: nowrap; + width: 350px; + max-width: 85vw; + display: inline-block !important; } a.odsh-star { diff --git a/ckanext/odsh/templates/package/snippets/info.html b/ckanext/odsh/templates/package/snippets/info.html index 16e1dd5..426195c 100644 --- a/ckanext/odsh/templates/package/snippets/info.html +++ b/ckanext/odsh/templates/package/snippets/info.html @@ -85,7 +85,7 @@ Example: {% set mdk=h.odsh_load_raw_mdk_sample_dataset() %} {% set musterdatensatzName = mdk[pkg.reference] %} <div class="musterdatensatz-detail info-detail"> - <div>{{ _('Musterdatensatz') }}</div> + <div>{{ _('Sample Dataset') }}:</div> <a href="/dataset?reference={{ pkg.reference }}">{{ musterdatensatzName }}</a> </div> {% endif %} @@ -95,7 +95,7 @@ Example: {% if pkg.applicableLegislation %} {% set applicable_legislation_urls = pkg.applicableLegislation.split(',') %} <div class="applicableLegislation-detail info-detail"> - <div>{{ _('Applicable Legislation') }}</div> + <div>{{ _('Applicable Legislation') }}:</div> <ul class="inline-list"> {% for url in applicable_legislation_urls %} {% set applicable_legislation = h.odsh_load_applicable_legislations(url.strip('{}')) %} @@ -110,11 +110,16 @@ Example: {% if pkg.hvdCategory %} {% set hvd_urls = pkg.hvdCategory.split(',') %} <div class="hvdCategories-detail info-detail"> - <div>{{ _('HVD Categories') }}</div> + <div> + {{ _('HVD Categories') }}: + <a data-module="odsh_popover" data-module-trigger="custom" data-module-text="{{ _('A High-Value Dataset (HVD) category refers to a group of datasets that are considered particularly important and valuable. These datasets cover various topics such as maps, environmental data, weather information, statistics, company details, and data related to transportation. The European Commission has identified six main categories of these high-value datasets to ensure that they are easily accessible and useful for different purposes. These categories help to organize and prioritize datasets that have the potential to significantly benefit European citizens and businesses.') }}" title="Mehr erfahren"> + <i class="fa fa-circle-info"></i> + </a> + </div> <ul class="inline-list"> {% for url in hvd_urls %} {% set hvd = h.odsh_load_hvd_categories(url.strip('{}')) %} - <li><a href="{{ hvd.uri }}">{{ hvd.short_title if hvd.short_title else hvd.title }}</a></li> + <li>{{ hvd.short_title if hvd.short_title else hvd.title }}</li> {% endfor %} </ul> </div> -- GitLab