- {% block heading %}
-
- {% block heading_private %}
- {% if package.private %}
-
-
- {{ _('Private') }}
-
- {% endif %}
- {% endblock %}
- {% block heading_title %}
-
- {{title|truncate(80)}}
-
- {% endblock %}
- {% block heading_meta %}
- {% if package.get('state', '').startswith('draft') %}
- {{ _('Draft') }}
- {% elif package.get('state', '').startswith('deleted') %}
- {{ _('Deleted') }}
- {% endif %}
- {{ h.popular('recent views', package.tracking_summary.recent, min=10) if package.tracking_summary }}
- {% endblock %}
-
- {% endblock %}
- {% block notes %}
- {% if notes %}
-
{{ notes|urlize }}
- {% else %}
-
{{ h.humanize_entity_type('package', package.type, 'no description') or _("There is no description for this dataset") }}
- {% endif %}
- {% endblock %}
+
+
+
+
+
Access required...
+
×
+
+
- {% block resources %}
- {% if package.resources and not hide_resources %}
- {% block resources_outer %}
-
- {% block resources_inner %}
- {% for resource in h.dict_list_reduce(package.resources, 'format') %}
- -
- {{ resource }}
-
- {% endfor %}
- {% endblock %}
-
- {% endblock %}
+ {% set orgTitle = package.organization.title %}
+
+
+ {% set mvalue = h.d4science_theme_get_systemtype_value_from_extras(package, package.extras) %}
+ {% set mcolor = h.d4science_get_color_for_type(mvalue) %}
+ {{ mvalue }}
+
+
+ {% if package.private and not h.can_read(package) %}
+
+
+ {{ _('Private') }}
+
+ {{ _(h.truncate(title, truncate_title)) }}
+ {% endif %}
+ {% if acquired and not owner %}
+
+
+ {{ _('Acquired') }}
+
+ {% endif %}
+
+ {% if package.private and not h.can_read(package) %}
+ {# {{ _(h.truncate(title, truncate_title)) }} Dataset#}
+
+ {{ h.acquire_button(package) }}
+ {% else %}
+ {{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='package', action='read', id=package.name)) }}
+ {% endif %}
+
+
+ {% if package.get('state', '').startswith('draft') %}
+ {{ _('Draft') }}
+ {% elif package.get('state', '').startswith('deleted') %}
+ {{ _('Deleted') }}
+ {% endif %}
+ {{ h.popular('recent views', package.tracking_summary.recent, min=10) if package.tracking_summary }}
+
+ {% if banner %}
+
{{ _('Popular') }}
{% endif %}
- {% endblock %}
- {% endblock %}
+ {% if notes %}
+
{{ notes|urlize(70,target='_blank') }}
+ {% endif %}
+
-{% endblock %}
+ {% else %}
+
+
+
+ {% set mvalue = h.d4science_theme_get_systemtype_value_from_extras(package, package.extras)%}
+ {% set mcolor = h.d4science_get_color_for_type(mvalue) %}
+ {{ mvalue }}
+
+
+ {% if package.private and not h.can_read(package) %}
+
+
+ {{ _('Private') }}
+
+ {% endif %}
+ {% if acquired and not owner %}
+
+
+ {{ _('Acquired') }}
+
+ {% endif %}
+ {% if owner %}
+
+
+ {{ _('Owner') }}
+
+ {% endif %}
+
+
+ {% if package.private and not h.can_read(package) %}
+ {{ _(h.truncate(title, truncate_title)) }}
+
+ {{ h.acquire_button(package) }}
+ {% else %}
+ {# CHANGED BY FRANCESCO MANGIACRAPA #}
+ {{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='dataset', action='read', id=package.name)) }}
+ {% endif %}
+
+
+ {% if package.get('state', '').startswith('draft') %}
+ {{ _('Draft') }}
+ {% elif package.get('state', '').startswith('deleted') %}
+ {{ _('Deleted') }}
+ {% endif %}
+ {{ h.popular('recent views', package.tracking_summary.recent, min=10) if package.tracking_summary }}
+
+ {% if banner %}
+
{{ _('Popular') }}
+ {% endif %}
+ {% if notes %}
+
{{ notes|urlize(70,target='_blank') }}
+ {% endif %}
+
+ {% if package.resources and not hide_resources %}
+
+ {# CHANGED BY FRANCESCO MANGIACRAPA, see: #7055 #}
+
+ {% for resource in package.resources %}
+ {% set resource_format = resource.format %}
+ {# TO INTERNAL RESOURCE PAGE set url = h.url_for(controller='package', action='resource_read', id=package.name, resource_id=resource.id) #}
+ -
+
+ {% if c.userobj %}
+ {# USER IS LOGGED #}
+ {# CHANGED BY FRANCESCO MANGIACRAPA #11178 #}
+ {{ resource_format }}
+ {% else %}
+ {# CHANGED BY FRANCESCO MANGIACRAPA #12377 #}
+ {{ resource.format }}
+
+
+ {% endif %}
+
+
+ {% endfor %}
+
+ {% endif %}
+
+
+ {% endif %}
+ {% endblock %}
\ No newline at end of file
diff --git a/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/tag_list.html b/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/tag_list.html
index 77f753e..52c9c8d 100644
--- a/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/tag_list.html
+++ b/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/tag_list.html
@@ -13,7 +13,7 @@
diff --git a/ckanext-d4science_theme/ckanext/d4science_theme/templates/user/dashboard_acquired.html b/ckanext-d4science_theme/ckanext/d4science_theme/templates/user/dashboard_acquired.html
new file mode 100644
index 0000000..a9fc325
--- /dev/null
+++ b/ckanext-d4science_theme/ckanext/d4science_theme/templates/user/dashboard_acquired.html
@@ -0,0 +1,19 @@
+{% extends "user/dashboard.html" %}
+
+{% block dashboard_activity_stream_context %}{% endblock %}
+
+{% block page_primary_action %}
+ {% link_for _('Acquire Dataset'), controller='package', action='search', class_="btn btn-primary", icon="shopping-cart" %}
+{% endblock %}
+
+{% block primary_content_inner %}
+
{{ _('Acquired Datasets') }}
+ {% if acquired_datasets %}
+ {% snippet 'snippets/package_list.html', packages=acquired_datasets %}
+ {% else %}
+
+ {{ _('You haven\'t acquired any datasets.') }}
+ {% link_for _('Acquire one now?'), controller='package', action='search' %}
+
+ {% endif %}
+{% endblock %}
diff --git a/ckanext-d4science_theme/ckanext/d4science_theme/validators.py b/ckanext-d4science_theme/ckanext/d4science_theme/validators.py
new file mode 100644
index 0000000..0168c54
--- /dev/null
+++ b/ckanext-d4science_theme/ckanext/d4science_theme/validators.py
@@ -0,0 +1,24 @@
+import ckan.plugins.toolkit as toolkit
+from logging import getLogger
+
+log = getLogger(__name__)
+
+def ignore_duplicate_keys(key, data, errors, context):
+ """
+ Validator che consente chiavi duplicate negli extras.
+ """
+ # Estrarre gli extras dalla richiesta
+ log.debug("controllo extra (data) %s", data)
+ extras = data.get(key, [])
+
+ # Log per il debugging
+ log.debug(f"Contenuto di 'data' per la chiave '{key}': {extras} (tipo: {type(extras)})")
+
+ # Se ci sono duplicati, evita di sollevare un'eccezione
+ if isinstance(extras, list): # Verifica che extras sia una lista
+ log.debug(f"Ignorando chiave duplicata: {extra['key']}")
+ else:
+ log.debug(f"Errore: 'extras' non è una lista, ma è di tipo {type(extras)}")
+
+ ## Mantieni la lista aggiornata, che consente chiavi duplicate
+ #data[key] = extras
\ No newline at end of file
diff --git a/ckanext-d4science_theme/requirements.txt b/ckanext-d4science_theme/requirements.txt
index 55f2a9b..0e23e19 100644
--- a/ckanext-d4science_theme/requirements.txt
+++ b/ckanext-d4science_theme/requirements.txt
@@ -1,3 +1,4 @@
webhelpers2
xmltodict
pyqrcode
+sqlalchemy
diff --git a/ckanext-d4science_theme/setup.py b/ckanext-d4science_theme/setup.py
index d3a3ba1..a616430 100644
--- a/ckanext-d4science_theme/setup.py
+++ b/ckanext-d4science_theme/setup.py
@@ -69,8 +69,7 @@ setup(
# installed, specify them here. If using Python 2.6 or less, then these
# have to be included in MANIFEST.in as well.
include_package_data=True,
- package_data={
- },
+ #package_data={},
# Although 'package_data' is the preferred approach, in some case you may
# need to place data files outside of your packages.