diff --git a/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/package_item.html b/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/package_item.html index 0e16bed..4226fe8 100644 --- a/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/package_item.html +++ b/ckanext-d4science_theme/ckanext/d4science_theme/templates/snippets/package_item.html @@ -18,47 +18,108 @@ {% set truncate_title = truncate_title or 80 %} {% set title = package.title or package.name %} {% set notes = h.markdown_extract(package.notes, extract_length=truncate) %} - + {% set owner = h.is_owner(package) %} + + {# {% resource 'd4science_theme/privatedatasets.css' %}#} {# - {% resource 'd4science_theme/custom.css' %} CHANGED BY FRANCESCO.MANGIACRAPA #} {% block package_item_content %} + + {# + {{ package.extras }} + #} + {% block toolbar %} + + {% endblock %} + + {% if package.private and not h.can_read(package) %}
  • -
    + +
    + +
    +

    Access required...

    + × +

    +
    +
    + {% 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 %} - - + {% endif %} {% if package.private and not h.can_read(package) %} - {# {{ _(h.truncate(title, truncate_title)) }} #} - Dataset + {# {{ _(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)) }} #} - {{ h.link_to(h.truncate(title, truncate_title), url_for('dataset.read', id=package.name)) }} + {{ 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') %} @@ -70,13 +131,18 @@ {% endif %} {% if notes %} - +
    {{ notes|urlize(70,target='_blank') }}
    {% endif %}

  • {% 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) %} @@ -84,7 +150,6 @@ {{ _('Private') }} {% endif %} - - + {% endif %} + {% if package.private and not h.can_read(package) %} {{ _(h.truncate(title, truncate_title)) }}
    {{ h.acquire_button(package) }} {% else %} - {# {{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='package', action='read', id=package.name)) }} #} - {{ h.link_to(h.truncate(title, truncate_title), url_for('dataset.read', id=package.name)) }} + {# 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') %} @@ -120,20 +185,36 @@ {% endif %} {% if notes %} -
    {{ notes|urlize }}
    +
    {{ notes|urlize(70,target='_blank') }}
    {% endif %}
    {% if package.resources and not hide_resources %} - - {% endif %} - + + {# 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 }} +
      + The resource: '{{ h.resource_display_name(resource) | truncate(30) }}' is not accessible as guest user. You must login to access it! +
      + + {% endif %} + +
    • + {% endfor %} +
    + {% endif %} +

  • {% endif %} {% endblock %} \ No newline at end of file