sistemato un po' di style

This commit is contained in:
Elia Bellavista 2024-06-03 16:06:34 +02:00
parent d419d9d063
commit 8a4384f783
17 changed files with 416 additions and 96 deletions

View File

@ -73,7 +73,7 @@
{% set theme = h.get_rtl_theme() if h.is_rtl_language() else g.theme %}
{% asset theme %}
{% asset 'd4science_theme/d4science-js' %}
{#{% asset 'd4science_theme/d4science-css' %}#}
{% asset 'd4science_theme/d4science-css' %}
{% endblock %}
{% block head_extras %}

View File

@ -1,7 +1,17 @@
{% set dataset_type = h.default_package_type() %}
{# FOLLOWING BLOCK IS ADDED BY FRANCESCO MANGIACRAPA #}
{% block header_hide_container_content %}
{% set hide = h.get_cookie_value('ckan_hide_header') %}
{% if hide=='true' %}
{# HIDE HEADER #}
{% else %}
{% block header_wrapper %} {% block header_account %}
<div class="account-masthead">
<script>
displayLogin = function(){
var e = document.getElementById("toLogin").style.display="inline";
};
</script>
<div class="account-masthead" id="toLogin" style="display:none">
<div class="container">
{% block header_account_container_content %} {% if c.userobj %}
<div class="account avatar authed" data-module="me" data-me="{{ c.userobj.id }}">
@ -53,7 +63,7 @@
{% block header_account_notlogged %}
<li>{% link_for _('Log in'), named_route='user.login' %}</li>
{% if h.check_access('user_create') %}
<li>{% link_for _('Register'), named_route='user.register', class_='sub' %}</li>
<li>{# Comment by Francesco Mangiacrapa {% link_for _('Register'), named_route='user.register', class_='sub' %} #}</li>
{% endif %} {% endblock %}
</ul>
</nav>
@ -62,6 +72,8 @@
</div>
{% endblock %}
<header class="masthead">
{# ADDED BY FRANCESCO MANGIACRAPA TO HIDE LOGIN #}
<a href="javascript:displayLogin();" style="font-size:10px; color: #FFF">_</a>
<div class="container">
{% block header_debug %} {% if g.debug and not g.debug_supress_header %}
<div class="debug">Blueprint : {{ g.blueprint }}<br />View : {{ g.view }}</div>
@ -121,3 +133,6 @@
</div>
</header>
{% endblock %}
{% endif %}
{% endblock %}

View File

@ -1,40 +1,108 @@
<!--Added by Francesco Mangiacrapa-->
<script src="d4s_tagcloud.js"></script>
<div role="main">
<div class="main hero">
<div class="container">
<div class="row">
<div class="col-md-6">
{% block promoted %}
{% snippet 'home/snippets/promoted.html' %}
{% endblock %}
</div>
<div class="col-md-6">
{% block search %}
{% snippet 'home/snippets/search.html', search_facets=search_facets %}
{% endblock %}
</div>
</div>
<div class="container">
<div class="row">
{% block promoted %}
{% snippet 'home/snippets/promoted.html' %}
{% endblock %}
</div>
</div>
</div>
<div class="main module-feeds">
<div class="container">
<div class="row">
<div class="col-md-6">
{# Note: this featured_group block is used as an example in the theming
tutorial in the docs! If you change this code, be sure to check
whether you need to update the docs. #}
{# Start template block example. #}
{% block featured_group %}
{% snippet 'home/snippets/featured_group.html' %}
{% endblock %}
{# End template block example. #}
</div>
<div class="col-md-6">
{% block featured_organization %}
{% snippet 'home/snippets/featured_organization.html' %}
{% endblock %}
</div>
<div role="main" class="hero">
<div class="container">
<div class="row">
<div class="col-sm-6">
{% block search %}
{% snippet 'home/snippets/search.html' %}
{% endblock %}
</div>
<div class="col-sm-6">
{% block stats %}
{% snippet 'home/snippets/stats.html' %}
{% endblock %}
</div>
</div>
</div>
</div>
<!--
<div role="main" class="hero">
<div class="container">
<h3>Search for Organisations</h3>
<div class="row row1">
</div>
<div>
</div>
-->
{% block search_for_organizations %}
{# Added by Francesco Mangiacrapa, see: #8964 #}
<script type="text/javascript" >
showBreadcrumbIntoSession = function () {
CKAN_D4S_Breadcrumb_Manager.setSessionStorageItem("showbreadcrumb", "true");
CKAN_D4S_Breadcrumb_Manager.checkBreadcrumbShow();
}
if(window.addEventListener){
window.addEventListener('load', showBreadcrumbIntoSession)
}else{
window.attachEvent('onload', showBreadcrumbIntoSession)
}
</script>
{% snippet 'home/snippets/search_for_organisations.html' %}
{% endblock %}
{% block search_for_groups %}
{% snippet 'home/snippets/search_for_groups.html' %}
{% endblock %}
{% block search_for_types %}
{% snippet 'home/snippets/search_for_types.html' %}
{% endblock %}
<!-- ADD THE SNIPPET 'home/snippets/search_for_location.html' TO ACTIVE BROWSE BY BBOX -->
{#
{% block search_for_location %}
{% snippet 'home/snippets/search_for_location.html' %}
{% endblock %}
#}
<div class="hero home-popular">
<div class="container">
<div class="row row-1">
{% block popular_formats %}
{% snippet 'home/snippets/popular_formats.html' %}
{% endblock %}
</div>
<div class="row row-2">
{% block popular_tags %}
{% snippet 'home/snippets/popular_tags.html' %}
{% endblock %}
</div>
<!-- {#{% block recent_activity %}
<!-- Added by Francesco Mangiacrapa. see: #6572 -->
{% if c.userobj and c.userobj.sysadmin %}
<div class="box">
<header class="module-heading">
<h3>Recent activity</h3>
</header>
<div class="module-content">
{{ h.recently_changed_packages_activity_stream(limit=4) }}
</div>
</div>
{%endif%}
{% endblock %} #} -->
</div>
</div>

View File

@ -1,7 +1,7 @@
{% set formats = h.get_facet_items_dict('res_format', limit=30) %}
<style>
#pop-formats {
line-height: 1.3;
line-height: 1.3;
padding: 5px 15px 10px;
word-break: break-all;
}

View File

@ -1,27 +1,27 @@
{% set intro = g.site_intro_text %}
<div class="module-promotion card box">
<div>
<div class="module-content box">
<header>
{% if intro %}
{{ h.render_markdown(intro) }}
{% else %}
<h1 class="page-heading">{{ _("Welcome to CKAN") }}</h1>
<p>
{% trans %}This is a nice introductory paragraph about CKAN or the site
in general. We don't have any copy to go here yet but soon we will
{% endtrans %}
</p>
{% endif %}
</div>
{% block home_image %}
<section class="featured media-overlay hidden-xs">
<h2 class="media-heading">{% block home_image_caption %}{{ _("This is a featured section") }}{% endblock %}</h2>
{% block home_image %}
<section class='featured media-overlay hidden-phone'>
{% block home_image_content %}
<a class="media-image" href="#">
<img class="img-fluid" src="{{ h.url_for_static('/base/images/placeholder-420x220.png') }}" alt="Placeholder" />
<a class="media-image" href="#" style="text-align:center;">
<img src="gcubedatacataloguelogo.png" alt="Placeholder" width="409" height="54" />
</a>
{% endblock %}
</section>
{% endblock %}
<div class="page-heading">
<h3>Welcome to the {{g.site_title}}!</h3>
<p style='font-size:14px !important; text-align: justify;'>
Here you will find data and other resources hosted by the D4Science.org infrastructure.</p>
<p style='text-align: justify;'>The catalogue contains a wealth of resources resulting from several activities, projects and communities including BlueBRIDGE (<a href="http://www.bluebridge-vres.eu" title="BlueBRIDGE" target="_blank">www.bluebridge-vres.eu</a>), i-Marine (<a href="http://www.i-marine.eu" title="i-Marine" target="_blank">www.i-marine.eu</a>), SoBigData.eu (<a href="http://www.sobigdata.eu" title="SoBigData.eu" target="_blank">www.sobigdata.eu</a>), and (FAO <a href="http://www.fao.org" title="FAO" target="_blank">www.fao.org</a>).
</p>
<p style='text-align: justify;'>All the products are accompanied with rich descriptions capturing general attributes, e.g. title and creator(s), as well as usage policies and licences.</p>
</div>
{% endif %}
</header>
</div>

View File

@ -1,3 +1,32 @@
{#{% set tags = h.get_facet_items_dict('tags', limit=3) %}#}
{% set placeholder = _('Insert keywords here') %}
<div class="module module-search module-narrow module-shallow box">
<!-- ckan 2.10 changed url_for controller=package to dataset-->
<form class="module-content search-form" method="get" action="{% url_for controller='dataset', action='search' %}">
<h3 class="heading">{{ _('Datasets') }} Search</h3>
<div class="search-input control-group search-giant">
<input type="text" class="search" name="q" value="" autocomplete="off" placeholder="{% block search_placeholder %}{{ placeholder }}{% endblock %}" />
<button type="submit" title="Search">
<i class="icon-search"></i>
<span>{{ _('Search') }}</span>
</button>
</div>
<div>
<a href="{{ h.url_for(controller='dataset', action='search') }}">See All {{ _('Datasets') }}</a>
<a href="/tag" style="float: right;">See All {{ _('Tags') }}</a>
</div>
</form>
</div>
<!-- <div class="tags">
<h3>{{ _('Popular tags') }}</h3>
{% for tag in tags %}
<a class="tag" href="{% url_for controller='package', action='search', tags=tag.name %}">{{ h.truncate(tag.display_name, 22) }}</a>
{% endfor %}
</div>
</div>
<!-- {#
{% set tags = h.get_facet_items_dict('tags', search_facets, limit=3) %}
{% set placeholder = _('E.g. environment') %}
{% set dataset_type = h.default_package_type() %}
@ -20,3 +49,4 @@
{% endfor %}
</div>
</div>
#}-->

View File

@ -3,31 +3,31 @@
{% if organizations|length > 1 %}
<div role="main" class="hero">
<div class="container">
<h3>Browse by {{_('Organizations')}}</h3>
<div id="search-for-organizations">
<table class="media-grid-homepage" data-module="media-grid">
{% for index in range(0,organizations|length) %}
{% set offset = 5 %}
{% set organization = organizations[index] %}
{% if index % offset == 0 %}
<tr>
{% endif %}
<td class="media-item-homepage">
{% set url = h.url_for(type ~ '_read', action='read', id=organization['name']) %}
<a href="{{ url }}" title="{{ _('View {name}').format(name=organization['display_name']) }}">
<img class="logo-homepage" src="{{ organization['url'] }}" alt="{{ organization['name'] }}" title="{{ _('{name}').format(name=organization['display_name']) }} organization">
<p class="media-heading-homepage">{{ organization['display_name'] }}&nbsp(<span class="statistics-show">{{organization['package_count']}}</span>)</p>
</a>
</td>
{% if (index+offset+1) % offset == 0 %}
</tr>
{% endif %}
{% endfor %}
</table>
</div>
<p style="float: right; margin-top: 15px">
<a href="/organization">See All {{_('Organizations')}}</a>
</p>
<h3>Browse by {{_('Organizations')}}</h3>
<div id="search-for-organizations">
<table class="media-grid-homepage" data-module="media-grid">
{% for index in range(0,organizations|length) %}
{% set offset = 5 %}
{% set organization = organizations[index] %}
{% if index % offset == 0 %}
<tr>
{% endif %}
<td class="media-item-homepage">
{% set url = h.url_for(type ~ '_read', action='read', id=organization['name']) %}
<a href="{{ url }}" title="{{ _('View {name}').format(name=organization['display_name']) }}">
<img class="logo-homepage" src="{{ organization['url'] }}" alt="{{ organization['name'] }}" title="{{ _('{name}').format(name=organization['display_name']) }} organization">
<p class="media-heading-homepage">{{ organization['display_name'] }}&nbsp(<span class="statistics-show">{{organization['package_count']}}</span>)</p>
</a>
</td>
{% if (index+offset+1) % offset == 0 %}
</tr>
{% endif %}
{% endfor %}
</table>
</div>
<p style="float: right; margin-top: 15px">
<a href="/organization">See All {{_('Organizations')}}</a>
</p>
</div>
</div>
{% endif %}

View File

@ -1,28 +1,42 @@
{% set stats = h.get_site_statistics() %}
{% set systemtypefacet = h.d4science_theme_get_systemtype_field_dict_from_session() %}
{% set count_systemtypefacet = h.d4science_theme_count_facet_items_dict(systemtypefacet['name']) %}
<div class="module-stats">
<div class="card box">
<div class="box stats">
<div class="inner">
<h3>{{ _('{0} statistics').format(g.site_title) }}</h3>
<ul>
{% block stats_group %}
<li>
<a href="{{ h.url_for('dataset.search') }}">
<strong>{{ h.SI_number_span(stats.dataset_count) }}</strong>
<a href="{{ h.url_for(controller='dataset', action='search') }}">
<b>{{ h.SI_number_span(stats.dataset_count) }}</b>
{{ _('dataset') if stats.dataset_count == 1 else _('datasets') }}
</a>
</li>
{% if stats.organization_count > 0 %}
<li>
<a href="{{ h.url_for('organization.index') }}">
<strong>{{ h.SI_number_span(stats.organization_count) }}</strong>
<a href="{{ h.url_for(controller='organization', action='index') }}">
<b>{{ h.SI_number_span(stats.organization_count) }}</b>
{{ _('organization') if stats.organization_count == 1 else _('organizations') }}
</a>
</li>
{% endif %}
{% if stats.group_count > 0 %}
<li>
<a href="{{ h.url_for('group.index') }}">
<strong>{{ h.SI_number_span(stats.group_count) }}</strong>
<a href="{{ h.url_for(controller='group', action='index') }}">
<b>{{ h.SI_number_span(stats.group_count) }}</b>
{{ _('group') if stats.group_count == 1 else _('groups') }}
</a>
</li>
{% endif %}
{% if count_systemtypefacet > 0 %}
<li>
<a href="{{ h.url_for(controller='d4STypeController', action='index') }}">
<b>{{ h.SI_number_span(count_systemtypefacet) }}</b>
{{ _(systemtypefacet['title']) if count_systemtypefacet <= 1 else _(systemtypefacet['title'])+'s' }}
</a>
</li>
{% endif %}
{% endblock %}
</ul>
</div>

View File

@ -1,5 +1,10 @@
{% extends "package/read_base.html" %}
{% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %}
{% set d4science_cms_obj_placeholders = h.d4science_get_content_moderator_system_placeholder() %}
{% set moderation_item_status = h.get_pkg_dict_extra(c.pkg_dict,d4science_cms_obj_placeholders.item_status,'') %}
{% block primary_content_inner %}
{{ super() }}
{% block package_description %}
@ -31,6 +36,10 @@
<span class="insert-comment-thread"></span>
{% endblock %}
{% if dataset_extent %}
{% snippet "spatial/snippets/dataset_map.html", extent=dataset_extent %}
{% endif %}
{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% endblock %}

View File

@ -12,8 +12,36 @@
{% endblock -%}
{% block content_action %}
<!-- Added by Francesco Mangiacrapa: it notifies the package id selected -->
<meta id="product-selected" content="{{pkg.id}}">
<script>
//console.log(productId)
postProduct = function(){
var productId = document.getElementById('product-selected').content;
CKAN_D4S_HTMLMessage_Util.postHeightToPortlet(true, productId);
}
if(window.addEventListener){
window.addEventListener('load', postProduct)
}else{
window.attachEvent('onload', postProduct)
}
</script>
{% if h.check_access('package_update', {'id':pkg.id }) %}
{% link_for _('Manage'), named_route=pkg.type ~ '.edit', id=pkg.name, class_='btn btn-light', icon='wrench' %}
{# CODE ADDED BY Francesco Mangiacrapa #}
{# see ticket #26641 - ONLY THE SYSADMINS see the Manage button #}
{% set is_sys_admin = true if (c.userobj and c.userobj.sysadmin) else false %}
{% set hide = h.get_cookie_value('ckan_hide_header') %}
{# INTO PORTAL - FROM D4SCIENCE PORTAL #}
{% if hide and hide == 'true' %}
{% if is_sys_admin %}
{% link_for _('Manage'), named_route=pkg.type ~ '.edit', id=pkg.name, class_='btn btn-light', icon='wrench' %}
{% endif %}
{% else %}
{% if is_sys_admin %}
{% link_for _('Manage'), named_route=pkg.type ~ '.edit', id=pkg.name, class_='btn btn-light', icon='wrench' %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
@ -23,7 +51,7 @@
{% endblock %}
{% block secondary_content %}
{{ super() }}
{% block secondary_help_content %}{% endblock %}
{% block package_info %}
@ -38,7 +66,9 @@
{% endblock %}
{% block package_social %}
{# See: #7055
{% snippet "snippets/social.html" %}
#}
{% endblock %}
{% block package_license %}

View File

@ -23,7 +23,11 @@
{% block content_primary_nav %}
{{ h.build_nav_icon(pkg.type ~ '_resource.edit', _('Edit resource'), id=pkg.name, resource_id=res.id, icon='pencil-square') }}
{% block inner_primary_nav %}{% endblock %}
{{ h.build_nav_icon(pkg.type ~ '_resource.views', _('Views'), id=pkg.name, resource_id=res.id, icon='bars') }}
{% set is_sys_admin = true if (c.userobj and c.userobj.sysadmin) else false %}
{% if is_sys_admin %}
{{ h.build_nav_icon(pkg.type ~ '_resource.views', _('Views'), id=pkg.name, resource_id=res.id, icon='bars') }}
{% endif %}
{% endblock %}
{% block primary_content_inner %}

View File

@ -212,7 +212,9 @@
{% snippet "package/snippets/resources.html", pkg=pkg, active=res.id, action='read' %}
{% endblock %}
{% block resource_license %}
{% block package_social %}
{# See: #7055
{% snippet "snippets/social.html" %}
#}
{% endblock %}
{% endblock %}

View File

@ -1,4 +1,17 @@
{% set key_item_url = _('Item') + ' URL' %}
<!-- <script type="text/javascript" src="assets/js/d4science_scripts.js"></script> -->
{% asset 'd4science_theme/d4science-js' %}
<script>
//ADDED by Francesco Mangiacrapa
jsonToHTML = function(containerID, cssClassToTable) {
CKAN_D4S_JSON_Util.jsonToHTML(containerID, cssClassToTable);
}
</script>
<section class="additional-info">
<h3>{{ _('Additional Info') }}</h3>
<table class="table table-striped table-bordered table-condensed">
<thead>
@ -78,8 +91,69 @@
</td>
</tr>
{% endif %}
{#added from previous templates#}
{% block extras scoped %}
{% block extras scoped %}
{#
This performs a sort
{% for extra in h.sorted_extras(pkg_dict.extras) %}
#}
{% if pkg_dict.extras %}
{# Added by Francesco Mangiacrapa, see 17901 #}
{% set extra_item_url = h.get_pkg_dict_extra(pkg_dict,key_item_url) %}
{% if extra_item_url %}
<div><div class="sectiontitle">{{ key_item_url }}</div>
<table class="qr-code-table">
<tr>
<td><a href={{ extra_item_url }} target="_blank">{{ extra_item_url }}</a></td>
<td>{% snippet "package/snippets/qrcode_show.html", package_url=extra_item_url %}</td>
</tr>
</table></div>
{% endif %}
{% set extras_indexed_for_categories = h.d4science_get_extras_indexed_for_namespaces(pkg_dict.extras) %}
{% for k_cat in extras_indexed_for_categories %}
{% set category_idx = extras_indexed_for_categories[k_cat] %}
{% if(k_cat!='nocategory') %}
<div><div class="sectiontitle">{{category_idx.category.title}}</div>
{% if category_idx.category.description %}
<div class="notes embedded-content"><p>Description: {{category_idx.category.description}}</p></div>
{% endif %}
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">{{ _('Field') }}</th>
<th scope="col">{{ _('Value') }}</th>
</tr>
</thead>
<tbody>
{% set my_extras = h.d4science_get_extra_for_category(extras_indexed_for_categories, k_cat) %}
{% snippet "package/snippets/extras_table.html", my_extras=my_extras, key_item_url=key_item_url %}
</tbody>
</table>
</div>
{% endif %}
{% endfor %}
{% set my_extras = h.d4science_get_extra_for_category(extras_indexed_for_categories, 'nocategory') %}
{% if my_extras|length > 0 %}
<div><div class="sectiontitle">{{ _('Additional Info') }}</div>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">{{ _('Field') }}</th>
<th scope="col">{{ _('Value') }}</th>
</tr>
</thead>
<tbody>
{% snippet "package/snippets/extras_table.html", my_extras=my_extras, key_item_url=key_item_url %}
</tbody>
</table>
</div>
{% endif %}
{% endif %}
{% endblock %}
{#end "added from previous templates"#}
<!-- {#{% block extras scoped %}
{% for extra in h.sorted_extras(pkg_dict.extras) %}
{% set key, value = extra %}
<tr rel="dc:relation" resource="_:extra{{ i }}">
@ -87,7 +161,7 @@
<td class="dataset-details" property="rdf:value">{{ value }}</td>
</tr>
{% endfor %}
{% endblock %}
{% endblock %} #}-->
{% endblock %}
</tbody>

View File

@ -0,0 +1,59 @@
<!-- Applying "Show more"/"Show less" to 'spatial field', see #23298 -->
<script type="text/javascript">
function manageLongField(containerID, n) {
try {
var str = document.getElementById(containerID).innerHTML;
if (str && str.length <= n) {
return str;
}
var newContent = "<div><input type='checkbox' class='read-more-state' id='post-"+containerID+"'' /><label for='post-"+containerID+"'' class='read-more-trigger'></label><p class='read-more-wrap'>";
newContent += str.substring(0, n);
newContent += "<span class='read-more-target'>";
newContent += str.substring(n, str.length);
newContent += "</span></p></div>"
document.getElementById(containerID).innerHTML = newContent
} catch (e) {
console.log('invalid containerID ' + containerID, e);
}
}
</script>
<!-- reading placeholder used by D4Science Content Moderator System, see #22854 -->
{% set d4science_cms_obj_placeholders = h.d4science_get_content_moderator_system_placeholder() %}
{% for extra_lnk in my_extras %}
{% set index = loop.index %}
{% for k in extra_lnk.keys() %}
{# Added by Francesco Mangiacrapa, see: #21701 #}
{% set extra_value = extra_lnk[k] %}
<!-- showing only extra fields with no empty values -->
{% if extra_value is defined and extra_value|length %}
{# Added by Francesco Mangiacrapa, see: #7055 #}
{% set isHttp = extra_value.startswith(('http://', 'https://')) %}
<tr rel="dc:relation" resource="_:extra{{ i }}">
<!-- no showing ITEM URL and D4Science CMS fields into table -->
{% if k != key_item_url and (not k.startswith(d4science_cms_obj_placeholders.prefix)) %}
<th scope="row" class="dataset-label" property="rdfs:label">{{ _(k) }}</th>
{% if isHttp %}
{% if k == 'graphic-preview-file'%}
<td class="dataset-details" property="rdf:value"><img src={{ extra_value }} alt={{ extra_value }}></td>
{% else %}
<td class="dataset-details" property="rdf:value"><a href={{ extra_value }} target="_blank">{{ extra_value }}</a></td>
{% endif %}
{% elif k == 'responsible-party' %}
<td class="dataset-details" property="rdf:value"><div id="responsible-party-extra-{{index}}" class="d4s-json-table">{{ extra_value }}</div><script>jsonToHTML('responsible-party-extra-{{index}}')</script></td>
{% elif k == 'dataset-reference-date' %}
<td class="dataset-details" property="rdf:value"><div id="dataset-reference-date-extra-{{index}}" class="d4s-json-table">{{ extra_value }}</div><script>jsonToHTML('dataset-reference-date-extra-{{index}}')</script></td>
{% elif k == 'coupled-resource' %}
<td class="dataset-details" property="rdf:value"><div id="coupled-resource-date-extra-{{index}}" class="d4s-json-table">{{ extra_value }}</div><script>jsonToHTML('coupled-resource-date-extra-{{index}}')</script></td>
{% elif k.startswith('Zenodo') %}
<td class="dataset-details" property="rdf:value"><div id="related-identifier-extra-{{index}}" class="d4s-json-table">{{ extra_value }}</div><script>jsonToHTML('related-identifier-extra-{{index}}')</script></td>
{% elif k == 'spatial' %}
<td class="dataset-details" property="rdf:value"><div id='spatial-{{index}}'>{{ extra_value }}</div><script>manageLongField('spatial-{{index}}', 150)</script></td>
{% else %}
<td class="dataset-details" property="rdf:value">{{ extra_value }}</td>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}

View File

@ -15,7 +15,10 @@
{{ form.prepend('name', id='field-name', label=_('URL'), prepend=prefix, placeholder=_('eg. my-dataset'), value=data.name, error=errors.name, attrs=attrs, is_required=true) }}
{% endblock %}
{% block package_basic_fields_custom %}{% endblock %}
{% block package_basic_fields_custom %}
{{ form.input('spatial', id='field-spatial', label=_('Spatial'),
placeholder=_('Geographical extent in GeoJSON format'), value=data.spatial, error=errors.spatial) }}
{% endblock %}
{% block package_basic_fields_description %}
{{ form.markdown('notes', id='field-notes', label=_('Description'), placeholder=_('eg. Some useful notes about the data'), value=data.notes, error=errors.notes) }}

View File

@ -16,6 +16,8 @@ then itself be extended to add/remove blocks of functionality. #}
{% block basic_fields %}
{% snippet 'package/snippets/package_basic_fields.html', data=data, errors=errors %}
{#<!-- add spatial field -->
{% snippet 'package/snippets/spatial_form_field.html', data=data, errors=errors%}#}
{% endblock %}
{% block metadata_fields %}

View File

@ -0,0 +1,10 @@
<!-- campo spatial per il form di aggiunta -->
{% import 'macros/form.html' as form %}
<div class="control-group">
<div class="controls">
{{ form.input('spatial', id='field-spatial', label=_('Spatial'),
placeholder=_('Geographical extent in GeoJSON format'), value=data.spatial, error=errors.spatial) }}
</div>
</div>