diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml index 389a2bff..a589147f 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/data_repository_schema.yaml @@ -7,7 +7,7 @@ dataset_fields: # field_name conflicts with documentation (identifier) - field_name: doi - label: Identifier + label: DataCite DOI Identifier form_placeholder: A DOI will be automatically minted when the dataset is published form_attrs: disabled: true @@ -62,7 +62,8 @@ dataset_fields: - field_name: author_affiliation_identifier label: Author Affiliation Identifier required: true - help_text: The persistent identifier of the affiliated entity + display_snippet: None + help_text: The persistent identifier of the affiliated entity. Please specify the absolute URL, e.g. https://ror.org/03qn8fb07 - field_name: author_affiliation_identifier_type label: Author Affiliation Identifier Type @@ -74,7 +75,8 @@ dataset_fields: - value: Other label: Other default: ROR - form_include_blank_choice: false + form_include_blank_choice: false + display_snippet: None help_text: The persistent identifier type of the affiliated entity - field_name: author_identifier_type @@ -104,7 +106,8 @@ dataset_fields: - field_name: author_identifier label: Author Identifier - help_text: Uniquely identifies an individual or legal entity, according to identifier schemes + display_snippet: URL + help_text: Uniquely identifies an individual or legal entity, according to identifier schemes. Please specify the absolute URL, e.g. https://orcid.org/0000-0003-0870-3192 - field_name: author_email label: Author Email @@ -144,7 +147,7 @@ dataset_fields: label: GCMD Science Keywords required: true form_snippet: gcmd_field.html - display_snippet: null + display_snippet: gcmd_field.html help_text: Global Change Master Directory (GCMD) science keywords groupBy: About Dataset @@ -152,6 +155,7 @@ dataset_fields: label: GCMD Science Keywords form_snippet: hidden_field.html help_text: Global Change Master Directory (GCMD) science keywords + display_snippet: null groupBy: About Dataset - field_name: fields_of_research_code @@ -166,6 +170,7 @@ dataset_fields: label: Fields of Research form_snippet: hidden_field.html help_text: The area(s) of study relevant to the dataset based on the ANZSRC Fields of Research (FoR) 2020 + display_snippet: fields_of_research_field.html groupBy: About Dataset - field_name: deposit_date @@ -238,6 +243,7 @@ dataset_fields: label: Elevation (m) help_text: The measurement of height above or below mean sea level in meters form_snippet: null + display_snippet: null groupBy: Spatial & Temporal # - field_name: vertical_datum @@ -269,6 +275,7 @@ dataset_fields: label: Geographic Coordinate System form_snippet: hidden_field.html help_text: The measurement of height above mean sea level in meters + display_snippet: null groupBy: Spatial & Temporal - field_name: funder @@ -286,7 +293,8 @@ dataset_fields: - field_name: funder_identifier label: Funder Identifier - help_text: Unique identifier of the funding entity + display_snippet: URL + help_text: Unique identifier of the funding entity. Please specify the absolute URL, e.g. http://dx.doi.org/10.13039/501100000923 - field_name: funder_identifier_type label: Funder Identifier Scheme @@ -312,7 +320,8 @@ dataset_fields: - field_name: project_grant_identifier label: Project Grant Identifier - help_text: The code assigned by the funder to a sponsored grant or project of the dataset + display_snippet: URL + help_text: The code assigned by the funder to a sponsored grant or project of the dataset. Please specify the absolute URL, e.g. https://dataportal.arc.gov.au/NCGP/Web/Grant/Grant/IM240100006 - field_name: project_grant_name label: Project Grant Name @@ -403,6 +412,7 @@ dataset_fields: - field_name: related_resource_url label: Related Resource URL required: true + display_snippet: URL help_text: Associated resources (e.g. report, article, data) related to the dataset. Enter the complete URL address of the related link. Permanent links are preferred - field_name: related_resource_title @@ -506,6 +516,7 @@ dataset_fields: form_include_blank_choice: false help_text: The entity that publishes the dataset form_snippet: hidden_field.html + display_snippet: publisher_field.html groupBy: Supporting Metadata - field_name: publisher_identifier @@ -519,6 +530,7 @@ dataset_fields: help_text: The persistent identifier of the data publisher form_include_blank_choice: false form_snippet: hidden_field.html + display_snippet: null groupBy: Supporting Metadata - field_name: publisher_identifier_type @@ -532,6 +544,7 @@ dataset_fields: form_include_blank_choice: false help_text: The type of the persistent identifier represents the data publisher form_snippet: hidden_field.html + display_snippet: null groupBy: Supporting Metadata - field_name: license @@ -567,7 +580,7 @@ dataset_fields: required: true default: auscope.doi@csiro.au display_snippet: email.html - display_email_name_field: primary_contact_name + # display_email_name_field: primary_contact_name help_text: Email of the primary contact form_snippet: hidden_field.html groupBy: Supporting Metadata @@ -576,6 +589,7 @@ dataset_fields: - field_name: citation label: Citation form_snippet: null + display_snippet: null help_text: The full bibliographic citation of the dataset groupBy: Supporting Metadata diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/helpers.py b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/helpers.py index 1b6c36ec..34f9336f 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/helpers.py +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/helpers.py @@ -7,12 +7,13 @@ def auscope_theme_hello(): return "Hello, auscope_theme!" - -def is_creating_dataset(): - """Determine if the user is creating or managing a dataset.""" +def is_creating_or_editing_dataset(): + """Determine if the user is creating or editing a dataset.""" current_path = toolkit.request.path if current_path.startswith('/dataset/new'): return True + elif "/dataset/edit/" in current_path: + return True return False @@ -50,7 +51,7 @@ def get_helpers(): def get_helpers(): return { "auscope_theme_hello": auscope_theme_hello, - "is_creating_dataset" :is_creating_dataset, + "is_creating_or_editing_dataset" :is_creating_or_editing_dataset, "get_search_facets" : get_search_facets, 'get_org_list': get_org_list, 'users_role_in_org': users_role_in_org, diff --git a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/views.py b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/views.py index 79d298a5..f358afa1 100644 --- a/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/views.py +++ b/ckan/src/ckanext-auscope-theme/ckanext/auscope_theme/views.py @@ -39,7 +39,7 @@ def fetch_gcmd(): def fetch_epsg(): page = request.args.get('page', 0) keywords = request.args.get('keywords', '') - external_url = f'https://apps.epsg.org/api/v1/CoordRefSystem/?includeDeprecated=false&pageSize=20&page={page}&keywords={keywords}' + external_url = f'https://apps.epsg.org/api/v1/CoordRefSystem/?includeDeprecated=false&pageSize=50&page={page}&keywords={keywords}' response = requests.get(external_url) if response.ok: diff --git a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/helpers.py b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/helpers.py index b722e619..e033cd41 100644 --- a/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/helpers.py +++ b/ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/helpers.py @@ -4,11 +4,13 @@ def igsn_theme_hello(): return "Hello, igsn_theme!" -def is_creating_dataset(): - """Determine if the user is creating or managing a dataset.""" +def is_creating_or_editing_dataset(): + """Determine if the user is creating or editing a dataset.""" current_path = toolkit.request.path if current_path.startswith('/dataset/new'): return True + elif "/dataset/edit/" in current_path: + return True return False def get_search_facets(): @@ -31,6 +33,6 @@ def get_search_facets(): def get_helpers(): return { "igsn_theme_hello": igsn_theme_hello, - "is_creating_dataset" :is_creating_dataset, + "is_creating_or_editing_dataset" :is_creating_or_editing_dataset, "get_search_facets" : get_search_facets } diff --git a/ckan/src/shared/public/base/js/display-map-module.js b/ckan/src/shared/public/base/js/display-map-module.js index 970b0823..ef296b22 100644 --- a/ckan/src/shared/public/base/js/display-map-module.js +++ b/ckan/src/shared/public/base/js/display-map-module.js @@ -5,21 +5,31 @@ ckan.module('display-map-module', function ($, _) { }, setupMap: function () { - var pointLat = this.el.data('point-lat'); - var pointLong = this.el.data('point-long'); - var boundingBox = this.el.data('bounding-box'); - - if (pointLat && pointLong) { - this.initializeMapWithPoint(pointLat, pointLong); - } else if (boundingBox) { - var bboxValues = boundingBox.split(',').map(function (item) { return parseFloat(item.trim()); }); - if (bboxValues.length === 4) { - this.initializeMapWithBoundingBox(bboxValues); + var allData = JSON.parse(this.el.attr('data-all-data')); + var locationChoice = allData['location_choice']; + var pointLat = allData['point_latitude']; + var pointLong = allData['point_longitude']; + var pointElevation = allData['elevation']; + var boundingBox = allData['bounding_box']; + console.log(allData) + if (locationChoice != null && locationChoice != "noLocation") { + $('#map-container').show(); + $('#epsg-info').show(); + + if (locationChoice == "point") { + this.initializeMapWithPoint(pointLat, pointLong, pointElevation); + } else if (locationChoice == "area") { + var bboxValues = boundingBox.split(',').map(function (item) { return parseFloat(item.trim()); }); + if (bboxValues.length === 4) { + this.initializeMapWithBoundingBox(bboxValues); + } } + } else { + $('#location-info').text('Location not specified.'); } }, - initializeMapWithPoint: function (lat, lng) { + initializeMapWithPoint: function (lat, lng, elevation) { var map = L.map('map-container').setView([lat, lng], 3); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Map data © OpenStreetMap contributors', @@ -27,7 +37,9 @@ ckan.module('display-map-module', function ($, _) { }).addTo(map); L.marker([lat, lng]).addTo(map); - $('#location-info').text('Latitude: ' + lat + ', Longitude: ' + lng); + $('#location-info').text('Latitude: ' + lat + ', Longitude: ' + lng + ', Elevation: ' + elevation).attr('style', 'padding-top: 10px; font-size: small;'); + $('#elevation-info').show(); + }, @@ -51,7 +63,7 @@ ckan.module('display-map-module', function ($, _) { var bounds = [[bbox[1], bbox[0]], [bbox[3], bbox[2]]]; L.rectangle(bounds).addTo(map); - $('#location-info').html('Bounding Box: ' + bbox.join(', ')); + $('#location-info').html('Bounding Box: ' + bbox.join(', ')).attr('style', 'padding-top: 10px; font-size: small;'); } }; diff --git a/ckan/src/shared/public/base/js/for-fields-handler-module.js b/ckan/src/shared/public/base/js/for-fields-handler-module.js index 37c9c0ed..b8b42f54 100644 --- a/ckan/src/shared/public/base/js/for-fields-handler-module.js +++ b/ckan/src/shared/public/base/js/for-fields-handler-module.js @@ -43,7 +43,7 @@ this.ckan.module('for-fields-handler-module', function ($, _) { success: function (response) { nextUrl = response.result.next; var items = response.result.items.map(function (item) { - return { id: item._about, text: item.prefLabel._value }; + return { id: item.notation, text: item.prefLabel._value }; }); nextPage = response.result.page + 1; diff --git a/ckan/src/shared/templates/package/read.html b/ckan/src/shared/templates/package/read.html new file mode 100644 index 00000000..632fe570 --- /dev/null +++ b/ckan/src/shared/templates/package/read.html @@ -0,0 +1,38 @@ +{% ckan_extends %} + {% block package_description %} + {% if pkg.private %} + + + {{ _('Private') }} + + {% endif %} +