From c99cd2a81279bdb411c32d9d6357ac5899b75522 Mon Sep 17 00:00:00 2001 From: kreafox Date: Tue, 24 Sep 2024 13:46:19 +0300 Subject: [PATCH 1/7] Move case study blocks layout to volto_layout --- eea/climateadapt/behaviors/casestudy.py | 417 +------------------- eea/climateadapt/behaviors/volto_layout.py | 419 +++++++++++++++++++++ 2 files changed, 422 insertions(+), 414 deletions(-) diff --git a/eea/climateadapt/behaviors/casestudy.py b/eea/climateadapt/behaviors/casestudy.py index f1a1e5733..020fef0c2 100644 --- a/eea/climateadapt/behaviors/casestudy.py +++ b/eea/climateadapt/behaviors/casestudy.py @@ -14,6 +14,7 @@ from eea.climateadapt import CcaAdminMessageFactory as _ from eea.climateadapt.behaviors.acemeasure import IAceMeasure +from .volto_layout import case_study_layout_blocks, case_study_layout_items class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): @@ -189,416 +190,7 @@ class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): title=_("Blocks"), description=_("The JSON representation of the object blocks."), schema=BLOCKS_SCHEMA, - default={ - "3f1f3ddd-0c38-4408-9ab7-5191099dec50": { - "@type": "title", - "copyrightIcon": "ri-copyright-line", - }, - "d4ea2e59-b6ba-44e7-a720-06d31d9d3e5c": { - "@type": "tabs_block", - "data": { - "blocks": { - "0b28077a-f698-4ca4-b932-48783a623519": { - "@type": "tab", - "blocks": { - "e416be82-c5df-4acd-98e9-675dbb88298c": { - "@type": "metadataSection", - "fields": [ - { - "@id": "80e5975a-c12b-4f5c-8ce0-89706e2def32", - "field": { - "id": "stakeholder_participation", - "title": "Stakeholder participation", - "widget": "richtext", - }, - }, - { - "@id": "ae0e8da3-2cd2-4395-908f-0af3e46a942d", - "field": { - "id": "success_limitations", - "title": "Success / limitations", - "widget": "richtext", - }, - }, - { - "@id": "80286b54-736a-4ebc-b09a-71ddef8d8bd8", - "field": { - "id": "cost_benefit", - "title": "Cost / Benefit", - "widget": "richtext", - }, - }, - { - "@id": "7a998946-1461-4aea-bf8e-65c19547e7fe", - "field": { - "id": "legal_aspects", - "title": "Legal aspects", - "widget": "richtext", - }, - }, - { - "@id": "db32e80b-a32d-4af0-933e-1f56a2b21aec", - "field": { - "id": "implementation_time", - "title": "Implementation Time", - "widget": "richtext", - }, - }, - { - "@id": "1d76bb7c-d417-40fd-b4bc-375c7c0d3248", - "field": { - "id": "lifetime", - "title": "Lifetime", - "widget": "richtext", - }, - }, - ], - "variation": "default", - } - }, - "blocks_layout": { - "items": ["e416be82-c5df-4acd-98e9-675dbb88298c"] - }, - "title": "Additional details", - }, - "43e34955-feb2-4c85-b3d0-f8afa4397b0a": { - "@type": "tab", - "blocks": { - "852102b8-ef6e-44ee-a6b6-a55bd7321dc5": { - "@type": "metadataSection", - "fields": [ - { - "@id": "5ea6c91a-9ecc-4639-a5ad-39c777da271d", - "field": { - "id": "governance_level", - "title": "Governance Level", - "widget": "array", - }, - }, - { - "@id": "79b7f6a2-a8d8-4f09-b907-415f8d485799", - "field": { - "id": "geochars", - "title": "Geographic characterisation", - "widget": "textarea", - }, - }, - { - "@id": "906faa69-0a7d-4fbf-a692-202a545db608", - "field": { - "id": "geolocation", - "title": "Geolocation", - "widget": "file", - }, - }, - ], - "variation": "default", - } - }, - "blocks_layout": { - "items": ["852102b8-ef6e-44ee-a6b6-a55bd7321dc5"] - }, - "title": "Geographic info", - }, - "8c14ec8c-3704-4381-a193-c3698459eb35": { - "@type": "tab", - "blocks": { - "05b1558d-86ca-44ac-8f15-f150b0625aab": { - "@type": "metadataSection", - "fields": [ - { - "@id": "c3244293-23b9-4ab6-8524-f7a37e7a1644", - "field": { - "id": "publication_date", - "title": "Date of item's creation", - "widget": "date", - }, - }, - { - "@id": "68c6e0e6-2e4d-4539-a8e6-ff22c5a137a2", - "field": { - "id": "title", - "title": "Title", - "widget": "title", - }, - }, - { - "@id": "ecb9d2ee-3757-4d33-be2c-686152a3610a", - "field": { - "id": "description", - "title": "Short summary", - "widget": "description", - }, - }, - { - "@id": "75aaed01-8e91-4bf7-bbdf-b133c3a222e9", - "field": { - "id": "long_description", - "title": "Description", - "widget": "richtext", - }, - }, - { - "@id": "c591457f-1d18-4136-b506-5594ce81e549", - "field": { - "id": "logo", - "title": "Logo", - "widget": "image", - }, - }, - { - "@id": "7ce74052-db09-4a0a-9812-a8b0cb7d6957", - "field": { - "id": "primary_photo", - "title": "Primary photo", - "widget": "image", - }, - }, - { - "@id": "04449d0e-62ff-4778-a295-7b57ce1952a4", - "field": { - "id": "primary_photo_copyright", - "title": "Primary Photo Copyright", - "widget": "string", - }, - }, - { - "@id": "ecfe707e-970c-490b-a942-97c1337e4095", - "field": { - "id": "image", - "title": "Thumbnail", - "widget": "image", - }, - }, - { - "@id": "9a5b8507-6730-4762-bcd6-4fc1b10c7710", - "field": { - "id": "climate_impacts", - "title": "Climate impacts", - "widget": "array", - }, - }, - { - "@id": "6936482f-f3db-45b7-bb10-d2b8d69dcf32", - "field": { - "id": "challenges", - "title": "Challenges", - "widget": "richtext", - }, - }, - { - "@id": "d903f345-1f5b-402a-8ca3-9d7108fe60af", - "field": { - "id": "objectives", - "title": "Objectives", - "widget": "richtext", - }, - }, - { - "@id": "7bcac560-a25d-4845-b397-21d6e476e569", - "field": { - "id": "adaptationoptions", - "title": "Adaptation measures implemented in the case:", - "widget": "relations", - }, - }, - { - "@id": "f51092ac-6986-4f07-9993-871f2111cad9", - "field": { - "id": "solutions", - "title": "Solutions", - "widget": "richtext", - }, - }, - { - "@id": "c5480561-405a-4634-b925-bb31f1bef472", - "field": { - "id": "relevance", - "title": "Relevance", - "widget": "array", - }, - }, - { - "@id": "775a5368-df44-42b4-814e-02efb7f79d61", - "field": { - "id": "keywords", - "title": "Keywords", - "widget": "array", - }, - }, - { - "@id": "18953f8e-29bf-4868-94d6-5fccd2a759a7", - "field": { - "id": "sectors", - "title": "Sectors", - "widget": "array", - }, - }, - { - "@id": "ad026a59-e3e0-44a6-b809-46edead10a44", - "field": { - "id": "elements", - "title": "Adaptation approaches", - "widget": "array", - }, - }, - { - "@id": "2aa73c72-2376-42fb-a216-83b2ed8d0def", - "field": { - "id": "contributor_list", - "title": "Contributor(s)", - "widget": "relations", - }, - }, - { - "@id": "584150ff-adc0-4e0f-bb79-49d7b18863f5", - "field": { - "id": "other_contributor", - "title": "Other contributor(s)", - "widget": "textarea", - }, - }, - { - "@id": "d36945e8-5efb-4932-a606-a7bf4d45d3ab", - "field": { - "id": "origin_website", - "title": "Item from third parties", - "widget": "array", - }, - }, - ], - "variation": "default", - } - }, - "blocks_layout": { - "items": ["05b1558d-86ca-44ac-8f15-f150b0625aab"] - }, - "title": "Item description", - }, - "c94564c7-2eae-4801-8f59-4e391ae6636c": { - "@type": "tab", - "blocks": { - "d54abe78-0596-4650-a3af-73f3bd597b5f": { - "@type": "metadataSection", - "fields": [ - { - "@id": "b61d6bc3-a2a5-4372-a327-baeb5fe769d9", - "field": { - "id": "include_in_observatory", - "title": "Include in observatory", - "widget": "boolean", - }, - }, - { - "@id": "95ebbd25-2e1a-4426-ba6c-de261f460a2d", - "field": { - "id": "include_in_mission", - "title": "Include in the Mission Portal", - "widget": "boolean", - }, - }, - { - "@id": "97f90179-cb2e-4747-a878-f10e6464e0bf", - "field": { - "id": "health_impacts", - "title": "Health impacts", - "widget": "array", - }, - }, - { - "@id": "d52bf489-5c2c-447b-a8a6-955fd44c0c20", - "field": { - "id": "relatedItems", - "title": "Related Items", - "widget": "relations", - }, - }, - ], - "variation": "default", - } - }, - "blocks_layout": { - "items": ["d54abe78-0596-4650-a3af-73f3bd597b5f"] - }, - "title": "Include in ECHO", - }, - "def26b70-983a-4d51-8563-c0f3a54267de": { - "@type": "tab", - "blocks": { - "3a2c0011-323a-4a95-9948-76ad7d7c61be": { - "@type": "slate" - }, - "8045304a-9f8b-4946-bda4-b45bfd150aba": { - "@type": "metadataSection", - "fields": [ - { - "@id": "2e92b309-4967-4669-ab70-be4e10a1b52d", - "field": { - "id": "contact", - "title": "Contact", - "widget": "richtext", - }, - }, - { - "@id": "5f61771b-2d7c-4a05-afaf-aa4d035b615f", - "field": { - "id": "websites", - "title": "Websites", - "widget": "array", - }, - }, - { - "@id": "2063c06d-90ed-404b-a0e5-b4cf1d778cf8", - "field": { - "id": "source", - "title": "References", - "widget": "richtext", - }, - }, - { - "@id": "f4731661-9d0e-42d4-894e-997ed339d5c6", - "field": { - "id": "special_tags", - "title": "Special tagging", - "widget": "array", - }, - }, - { - "@id": "57e4fbdd-ab03-4fa7-a758-e9eb4add1d50", - "field": { - "id": "comments", - "title": "Comments", - "widget": "textarea", - }, - }, - ], - "variation": "default", - }, - }, - "blocks_layout": { - "items": [ - "8045304a-9f8b-4946-bda4-b45bfd150aba", - "3a2c0011-323a-4a95-9948-76ad7d7c61be", - ] - }, - "title": "Reference info", - }, - }, - "blocks_layout": { - "items": [ - "8c14ec8c-3704-4381-a193-c3698459eb35", - "0b28077a-f698-4ca4-b932-48783a623519", - "def26b70-983a-4d51-8563-c0f3a54267de", - "43e34955-feb2-4c85-b3d0-f8afa4397b0a", - "c94564c7-2eae-4801-8f59-4e391ae6636c", - ] - }, - }, - "template": "default", - "verticalAlign": "flex-start", - }, - - }, + default=case_study_layout_blocks, required=False, ) @@ -607,10 +199,7 @@ class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): description=_("The JSON representation of the object blocks layout."), schema=LAYOUT_SCHEMA, default={ - "items": [ - "3f1f3ddd-0c38-4408-9ab7-5191099dec50", - "d4ea2e59-b6ba-44e7-a720-06d31d9d3e5c" - ] + "items": case_study_layout_items }, required=False, ) diff --git a/eea/climateadapt/behaviors/volto_layout.py b/eea/climateadapt/behaviors/volto_layout.py index 5ec634886..6440cc852 100644 --- a/eea/climateadapt/behaviors/volto_layout.py +++ b/eea/climateadapt/behaviors/volto_layout.py @@ -2880,3 +2880,422 @@ "613a783e-8652-410c-b57e-08e96913e0f2", "72eff79b-8c00-44f1-98b9-16fcca2a3f03", ] + + +case_study_layout_items = [ + "3f1f3ddd-0c38-4408-9ab7-5191099dec50", + "d4ea2e59-b6ba-44e7-a720-06d31d9d3e5c" +] + +case_study_layout_blocks = { + "3f1f3ddd-0c38-4408-9ab7-5191099dec50": { + "@type": "title", + "copyrightIcon": "ri-copyright-line" + }, + "d4ea2e59-b6ba-44e7-a720-06d31d9d3e5c": { + "@type": "tabs_block", + "data": { + "blocks": { + "0b28077a-f698-4ca4-b932-48783a623519": { + "@type": "tab", + "blocks": { + "e416be82-c5df-4acd-98e9-675dbb88298c": { + "@type": "metadataSection", + "fields": [{ + "@id": "80e5975a-c12b-4f5c-8ce0-89706e2def32", + "field": { + "id": "stakeholder_participation", + "title": "Stakeholder participation", + "widget": "richtext" + } + }, + { + "@id": "ae0e8da3-2cd2-4395-908f-0af3e46a942d", + "field": { + "id": "success_limitations", + "title": "Success / limitations", + "widget": "richtext" + } + }, + { + "@id": "80286b54-736a-4ebc-b09a-71ddef8d8bd8", + "field": { + "id": "cost_benefit", + "title": "Cost / Benefit", + "widget": "richtext" + } + }, + { + "@id": "7a998946-1461-4aea-bf8e-65c19547e7fe", + "field": { + "id": "legal_aspects", + "title": "Legal aspects", + "widget": "richtext" + } + }, + { + "@id": "db32e80b-a32d-4af0-933e-1f56a2b21aec", + "field": { + "id": "implementation_time", + "title": "Implementation Time", + "widget": "richtext" + } + }, + { + "@id": "1d76bb7c-d417-40fd-b4bc-375c7c0d3248", + "field": { + "id": "lifetime", + "title": "Lifetime", + "widget": "richtext" + } + } + ], + "variation": "default" + } + }, + "blocks_layout": { + "items": [ + "e416be82-c5df-4acd-98e9-675dbb88298c" + ] + }, + "title": "Additional details" + }, + "43e34955-feb2-4c85-b3d0-f8afa4397b0a": { + "@type": "tab", + "blocks": { + "852102b8-ef6e-44ee-a6b6-a55bd7321dc5": { + "@type": "metadataSection", + "fields": [{ + "@id": "5ea6c91a-9ecc-4639-a5ad-39c777da271d", + "field": { + "id": "governance_level", + "title": "Governance Level", + "widget": "array" + } + }, + { + "@id": "79b7f6a2-a8d8-4f09-b907-415f8d485799", + "field": { + "id": "geochars", + "title": "Geographic characterisation", + "widget": "textarea" + } + }, + { + "@id": "906faa69-0a7d-4fbf-a692-202a545db608", + "field": { + "id": "geolocation", + "title": "Geolocation", + "widget": "file" + } + } + ], + "variation": "default" + } + }, + "blocks_layout": { + "items": [ + "852102b8-ef6e-44ee-a6b6-a55bd7321dc5" + ] + }, + "title": "Geographic info" + }, + "8c14ec8c-3704-4381-a193-c3698459eb35": { + "@type": "tab", + "blocks": { + "05b1558d-86ca-44ac-8f15-f150b0625aab": { + "@type": "metadataSection", + "fields": [{ + "@id": "c3244293-23b9-4ab6-8524-f7a37e7a1644", + "field": { + "id": "publication_date", + "title": "Date of item's creation", + "widget": "date" + } + }, + { + "@id": "68c6e0e6-2e4d-4539-a8e6-ff22c5a137a2", + "field": { + "id": "title", + "title": "Title", + "widget": "title" + } + }, + { + "@id": "ecb9d2ee-3757-4d33-be2c-686152a3610a", + "field": { + "id": "description", + "title": "Short summary", + "widget": "description" + } + }, + { + "@id": "75aaed01-8e91-4bf7-bbdf-b133c3a222e9", + "field": { + "id": "long_description", + "title": "Description", + "widget": "richtext" + } + }, + { + "@id": "c591457f-1d18-4136-b506-5594ce81e549", + "field": { + "id": "logo", + "title": "Logo", + "widget": "image" + } + }, + { + "@id": "7ce74052-db09-4a0a-9812-a8b0cb7d6957", + "field": { + "id": "primary_photo", + "title": "Primary photo", + "widget": "image" + } + }, + { + "@id": "04449d0e-62ff-4778-a295-7b57ce1952a4", + "field": { + "id": "primary_photo_copyright", + "title": "Primary Photo Copyright", + "widget": "string" + } + }, + { + "@id": "ecfe707e-970c-490b-a942-97c1337e4095", + "field": { + "id": "image", + "title": "Thumbnail", + "widget": "image" + } + }, + { + "@id": "9a5b8507-6730-4762-bcd6-4fc1b10c7710", + "field": { + "id": "climate_impacts", + "title": "Climate impacts", + "widget": "array" + } + }, + { + "@id": "6936482f-f3db-45b7-bb10-d2b8d69dcf32", + "field": { + "id": "challenges", + "title": "Challenges", + "widget": "richtext" + } + }, + { + "@id": "d903f345-1f5b-402a-8ca3-9d7108fe60af", + "field": { + "id": "objectives", + "title": "Objectives", + "widget": "richtext" + } + }, + { + "@id": "7bcac560-a25d-4845-b397-21d6e476e569", + "field": { + "id": "adaptationoptions", + "title": "Adaptation measures implemented in the case:", + "widget": "relations" + } + }, + { + "@id": "f51092ac-6986-4f07-9993-871f2111cad9", + "field": { + "id": "solutions", + "title": "Solutions", + "widget": "richtext" + } + }, + { + "@id": "c5480561-405a-4634-b925-bb31f1bef472", + "field": { + "id": "relevance", + "title": "Relevance", + "widget": "array" + } + }, + { + "@id": "775a5368-df44-42b4-814e-02efb7f79d61", + "field": { + "id": "keywords", + "title": "Keywords", + "widget": "array" + } + }, + { + "@id": "18953f8e-29bf-4868-94d6-5fccd2a759a7", + "field": { + "id": "sectors", + "title": "Sectors", + "widget": "array" + } + }, + { + "@id": "ad026a59-e3e0-44a6-b809-46edead10a44", + "field": { + "id": "elements", + "title": "Adaptation elements", + "widget": "array" + } + }, + { + "@id": "2aa73c72-2376-42fb-a216-83b2ed8d0def", + "field": { + "id": "contributor_list", + "title": "Contributor(s)", + "widget": "relations" + } + }, + { + "@id": "584150ff-adc0-4e0f-bb79-49d7b18863f5", + "field": { + "id": "other_contributor", + "title": "Other contributor(s)", + "widget": "textarea" + } + }, + { + "@id": "d36945e8-5efb-4932-a606-a7bf4d45d3ab", + "field": { + "id": "origin_website", + "title": "Item from third parties", + "widget": "array" + } + } + ], + "variation": "default" + } + }, + "blocks_layout": { + "items": [ + "05b1558d-86ca-44ac-8f15-f150b0625aab" + ] + }, + "title": "Item description" + }, + "c94564c7-2eae-4801-8f59-4e391ae6636c": { + "@type": "tab", + "blocks": { + "d54abe78-0596-4650-a3af-73f3bd597b5f": { + "@type": "metadataSection", + "fields": [{ + "@id": "b61d6bc3-a2a5-4372-a327-baeb5fe769d9", + "field": { + "id": "include_in_observatory", + "title": "Include in observatory", + "widget": "boolean" + } + }, + { + "@id": "95ebbd25-2e1a-4426-ba6c-de261f460a2d", + "field": { + "id": "include_in_mission", + "title": "Include in the Mission Portal", + "widget": "boolean" + } + }, + { + "@id": "97f90179-cb2e-4747-a878-f10e6464e0bf", + "field": { + "id": "health_impacts", + "title": "Health impacts", + "widget": "array" + } + }, + { + "@id": "d52bf489-5c2c-447b-a8a6-955fd44c0c20", + "field": { + "id": "relatedItems", + "title": "Related Items", + "widget": "relations" + } + } + ], + "variation": "default" + } + }, + "blocks_layout": { + "items": [ + "d54abe78-0596-4650-a3af-73f3bd597b5f" + ] + }, + "title": "Include in ECHO" + }, + "def26b70-983a-4d51-8563-c0f3a54267de": { + "@type": "tab", + "blocks": { + "3a2c0011-323a-4a95-9948-76ad7d7c61be": { + "@type": "slate" + }, + "8045304a-9f8b-4946-bda4-b45bfd150aba": { + "@type": "metadataSection", + "fields": [{ + "@id": "2e92b309-4967-4669-ab70-be4e10a1b52d", + "field": { + "id": "contact", + "title": "Contact", + "widget": "richtext" + } + }, + { + "@id": "5f61771b-2d7c-4a05-afaf-aa4d035b615f", + "field": { + "id": "websites", + "title": "Websites", + "widget": "array" + } + }, + { + "@id": "2063c06d-90ed-404b-a0e5-b4cf1d778cf8", + "field": { + "id": "source", + "title": "References", + "widget": "richtext" + } + }, + { + "@id": "f4731661-9d0e-42d4-894e-997ed339d5c6", + "field": { + "id": "special_tags", + "title": "Special tagging", + "widget": "array" + } + }, + { + "@id": "57e4fbdd-ab03-4fa7-a758-e9eb4add1d50", + "field": { + "id": "comments", + "title": "Comments", + "widget": "textarea" + } + } + ], + "variation": "default" + } + }, + "blocks_layout": { + "items": [ + "8045304a-9f8b-4946-bda4-b45bfd150aba", + "3a2c0011-323a-4a95-9948-76ad7d7c61be" + ] + }, + "title": "Reference info" + } + }, + "blocks_layout": { + "items": [ + "8c14ec8c-3704-4381-a193-c3698459eb35", + "0b28077a-f698-4ca4-b932-48783a623519", + "def26b70-983a-4d51-8563-c0f3a54267de", + "43e34955-feb2-4c85-b3d0-f8afa4397b0a", + "c94564c7-2eae-4801-8f59-4e391ae6636c" + ] + } + }, + "template": "default", + "verticalAlign": "flex-start" + } +} \ No newline at end of file From 77baac0960734787c410b5291a8106f278c7ebe1 Mon Sep 17 00:00:00 2001 From: kreafox Date: Tue, 24 Sep 2024 14:06:25 +0300 Subject: [PATCH 2/7] Update "Relevance" vocabulary --- eea/climateadapt/vocabulary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eea/climateadapt/vocabulary.py b/eea/climateadapt/vocabulary.py index 0668b5c9d..c74b9d356 100644 --- a/eea/climateadapt/vocabulary.py +++ b/eea/climateadapt/vocabulary.py @@ -392,18 +392,18 @@ def __call__(self, context, query=None): _relevance = [ ( "IMPL_AS_CCA", - _("Case developed and implemented as a Climate Change Adaptation Measure."), + _("Case developed and implemented as a climate change adaptation measure."), ), ( "PARTFUND_AS_CCA", _( - "Case developed and implemented and partially funded as a Climate Change Adaptation measure." + "Case partially developed, implemented and funded as a climate change adaptation measure." ), ), ( "OTHER_POL_OBJ", _( - "Case mainly developed and implemented because of other policy objectives, but with significant consideration of Climate Change Adaptation aspects" + "Case mainly developed and implemented because of other policy objectives, but with significant consideration of climate change adaptation aspects." ), ), ] From 98ec24acf108ae3ff53f34ae337fbc0f435c981d Mon Sep 17 00:00:00 2001 From: kreafox Date: Tue, 24 Sep 2024 14:23:17 +0300 Subject: [PATCH 3/7] Update "Objectives" field title --- eea/climateadapt/behaviors/casestudy.py | 2 +- eea/climateadapt/behaviors/volto_layout.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eea/climateadapt/behaviors/casestudy.py b/eea/climateadapt/behaviors/casestudy.py index 020fef0c2..940451e73 100644 --- a/eea/climateadapt/behaviors/casestudy.py +++ b/eea/climateadapt/behaviors/casestudy.py @@ -47,7 +47,7 @@ class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): ) objectives = RichText( - title=_("Objectives"), + title=_("Objectives of the adaptation measure"), required=True, default=None, description=_( diff --git a/eea/climateadapt/behaviors/volto_layout.py b/eea/climateadapt/behaviors/volto_layout.py index 6440cc852..7f1c28151 100644 --- a/eea/climateadapt/behaviors/volto_layout.py +++ b/eea/climateadapt/behaviors/volto_layout.py @@ -3089,7 +3089,7 @@ "@id": "d903f345-1f5b-402a-8ca3-9d7108fe60af", "field": { "id": "objectives", - "title": "Objectives", + "title": "Objectives of the adaptation measure", "widget": "richtext" } }, From 3d81318b9f95db5612eca153bc935597a4a2c1cc Mon Sep 17 00:00:00 2001 From: kreafox Date: Tue, 24 Sep 2024 15:57:52 +0300 Subject: [PATCH 4/7] Update fields title --- eea/climateadapt/behaviors/acemeasure.py | 8 ++++---- eea/climateadapt/behaviors/adaptationoption.py | 6 +++--- eea/climateadapt/behaviors/volto_layout.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eea/climateadapt/behaviors/acemeasure.py b/eea/climateadapt/behaviors/acemeasure.py index e3f7595da..fe8092207 100644 --- a/eea/climateadapt/behaviors/acemeasure.py +++ b/eea/climateadapt/behaviors/acemeasure.py @@ -66,8 +66,8 @@ class IAceMeasure(form.Schema, IImageScaleTraversable): fields=[ "publication_date", "title", - "long_description", "description", + "long_description", "climate_impacts", "keywords", "sectors", @@ -236,7 +236,7 @@ class IAceMeasure(form.Schema, IImageScaleTraversable): dexteritytextindexer.searchable("success_limitations") success_limitations = RichText( - title=_("Success / limitations"), + title=_("Success and limiting factors"), required=False, default=unicode(""), description=_( @@ -249,7 +249,7 @@ class IAceMeasure(form.Schema, IImageScaleTraversable): dexteritytextindexer.searchable("cost_benefit") cost_benefit = RichText( - title=_("Cost / Benefit"), + title=_("Costs and benefits"), required=False, default=unicode(""), description=_( @@ -282,7 +282,7 @@ class IAceMeasure(form.Schema, IImageScaleTraversable): dexteritytextindexer.searchable("implementation_time") implementation_time = RichText( - title=_("Implementation Time"), + title=_("Implementation time"), required=False, default=None, description=_( diff --git a/eea/climateadapt/behaviors/adaptationoption.py b/eea/climateadapt/behaviors/adaptationoption.py index 5b3320dc3..b70b447cd 100644 --- a/eea/climateadapt/behaviors/adaptationoption.py +++ b/eea/climateadapt/behaviors/adaptationoption.py @@ -273,7 +273,7 @@ class IAdaptationOption(IAceMeasure, IBlocks): "@id": "8b66f602-4098-4083-ae4e-0d45a6061c41", "field": { "id": "success_limitations", - "title": "Success / limitations", + "title": "Success and limiting factors", "widget": "richtext", }, }, @@ -281,7 +281,7 @@ class IAdaptationOption(IAceMeasure, IBlocks): "@id": "07bf6b42-bdef-4505-8a80-369d4f096d34", "field": { "id": "cost_benefit", - "title": "Cost / Benefit", + "title": "Costs and benefits", "widget": "richtext", }, }, @@ -297,7 +297,7 @@ class IAdaptationOption(IAceMeasure, IBlocks): "@id": "6f100215-d407-4049-be3e-8c15c45f48b9", "field": { "id": "implementation_time", - "title": "Implementation Time", + "title": "Implementation time", "widget": "richtext", }, }, diff --git a/eea/climateadapt/behaviors/volto_layout.py b/eea/climateadapt/behaviors/volto_layout.py index 7f1c28151..965a7fc8d 100644 --- a/eea/climateadapt/behaviors/volto_layout.py +++ b/eea/climateadapt/behaviors/volto_layout.py @@ -2913,7 +2913,7 @@ "@id": "ae0e8da3-2cd2-4395-908f-0af3e46a942d", "field": { "id": "success_limitations", - "title": "Success / limitations", + "title": "Success and limiting factors", "widget": "richtext" } }, @@ -2921,7 +2921,7 @@ "@id": "80286b54-736a-4ebc-b09a-71ddef8d8bd8", "field": { "id": "cost_benefit", - "title": "Cost / Benefit", + "title": "Costs and benefits", "widget": "richtext" } }, @@ -2937,7 +2937,7 @@ "@id": "db32e80b-a32d-4af0-933e-1f56a2b21aec", "field": { "id": "implementation_time", - "title": "Implementation Time", + "title": "Implementation time", "widget": "richtext" } }, From 3449e302a2c3152bb5252c26a2c54f10cf9e800d Mon Sep 17 00:00:00 2001 From: kreafox Date: Wed, 25 Sep 2024 15:51:00 +0300 Subject: [PATCH 5/7] Add new fields for case study + upgrade step --- eea/climateadapt/behaviors/casestudy.py | 18 +++++++++++++++++- eea/climateadapt/behaviors/volto_layout.py | 16 ++++++++++++++++ eea/climateadapt/configure.zcml | 5 +++++ eea/climateadapt/profiles.zcml | 8 ++++++++ .../profiles/upgrades/to_76/catalog.xml | 6 ++++++ eea/climateadapt/upgrades/configure.zcml | 10 ++++++++++ eea/climateadapt/vocabulary.py | 1 + 7 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 eea/climateadapt/profiles/upgrades/to_76/catalog.xml diff --git a/eea/climateadapt/behaviors/casestudy.py b/eea/climateadapt/behaviors/casestudy.py index 940451e73..2e91d562d 100644 --- a/eea/climateadapt/behaviors/casestudy.py +++ b/eea/climateadapt/behaviors/casestudy.py @@ -10,7 +10,7 @@ from z3c.form.interfaces import IAddForm, IEditForm from z3c.relationfield.schema import RelationChoice, RelationList from zope.interface import alsoProvides -from zope.schema import Choice, List, TextLine +from zope.schema import Choice, List, TextLine, Tuple from eea.climateadapt import CcaAdminMessageFactory as _ from eea.climateadapt.behaviors.acemeasure import IAceMeasure @@ -32,6 +32,22 @@ class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): # directives.omitted(IEditForm, 'relatedItems') # directives.omitted(IAddForm, 'relatedItems') + directives.widget("updating_notes", vocabulary="updating_notes_vocabulary") + updating_notes = Tuple( + title=_("Updating notes"), + required=False, + default=(), + missing_value=None, + value_type=TextLine( + title=u"Single topic", + )) + + policy_legal_background = RichText( + title=_("Policy and legal background"), + required=False, + default=None, + ) + challenges = RichText( title=_("Challenges"), required=True, diff --git a/eea/climateadapt/behaviors/volto_layout.py b/eea/climateadapt/behaviors/volto_layout.py index 965a7fc8d..1f7e55667 100644 --- a/eea/climateadapt/behaviors/volto_layout.py +++ b/eea/climateadapt/behaviors/volto_layout.py @@ -3037,6 +3037,14 @@ "widget": "richtext" } }, + { + "@id": "fef80485-7212-4d52-8923-a7d030edc313", + "field": { + "id": "updating_notes", + "title": "Updating notes", + "widget": "array" + } + }, { "@id": "c591457f-1d18-4136-b506-5594ce81e549", "field": { @@ -3085,6 +3093,14 @@ "widget": "richtext" } }, + { + "@id": "dae44adf-b17b-4bdb-83d1-6fdd9446ef8f", + "field": { + "id": "policy_legal_background", + "title": "Policy and legal background", + "widget": "richtext" + } + }, { "@id": "d903f345-1f5b-402a-8ca3-9d7108fe60af", "field": { diff --git a/eea/climateadapt/configure.zcml b/eea/climateadapt/configure.zcml index 8d9f6cc34..889b0cf70 100644 --- a/eea/climateadapt/configure.zcml +++ b/eea/climateadapt/configure.zcml @@ -321,6 +321,11 @@ component=".vocabulary.ObjectProvidesVocabulary" /> + + + + diff --git a/eea/climateadapt/profiles/upgrades/to_76/catalog.xml b/eea/climateadapt/profiles/upgrades/to_76/catalog.xml new file mode 100644 index 000000000..ae7ecd3cc --- /dev/null +++ b/eea/climateadapt/profiles/upgrades/to_76/catalog.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/eea/climateadapt/upgrades/configure.zcml b/eea/climateadapt/upgrades/configure.zcml index c7de1ae21..723aafa4f 100644 --- a/eea/climateadapt/upgrades/configure.zcml +++ b/eea/climateadapt/upgrades/configure.zcml @@ -2,6 +2,16 @@ xmlns:genericsetup="http://namespaces.zope.org/genericsetup" i18n_domain="eea.climateadapt"> + + + + Date: Wed, 25 Sep 2024 16:08:20 +0300 Subject: [PATCH 6/7] Add missing title for keywords field --- eea/climateadapt/behaviors/acemeasure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eea/climateadapt/behaviors/acemeasure.py b/eea/climateadapt/behaviors/acemeasure.py index fe8092207..36a1d63ed 100644 --- a/eea/climateadapt/behaviors/acemeasure.py +++ b/eea/climateadapt/behaviors/acemeasure.py @@ -161,6 +161,7 @@ class IAceMeasure(form.Schema, IImageScaleTraversable): directives.widget("keywords", vocabulary="eea.climateadapt.keywords") keywords = Tuple( + title=_(u"Keywords"), description=_( "Describe and tag this item with relevant keywords. " "Press Enter after writing your keyword. " From 9971a1ff268f53b05d02a0cf12ecf542cb0f4411 Mon Sep 17 00:00:00 2001 From: kreafox Date: Thu, 26 Sep 2024 10:12:09 +0300 Subject: [PATCH 7/7] Move fields in case study template --- eea/climateadapt/behaviors/casestudy.py | 51 +++++++++++----------- eea/climateadapt/behaviors/volto_layout.py | 18 ++++---- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/eea/climateadapt/behaviors/casestudy.py b/eea/climateadapt/behaviors/casestudy.py index 2e91d562d..b12a1c9d5 100644 --- a/eea/climateadapt/behaviors/casestudy.py +++ b/eea/climateadapt/behaviors/casestudy.py @@ -175,32 +175,31 @@ class ICaseStudy(IAceMeasure, IBlocks): # , IGeolocatable): required=False, ) - # form.fieldset( - # "default", - # label=u"Item Description", - # fields=[ - # 'title', - # 'description', - # 'long_description', - # 'primary_photo', - # 'primary_photo_copyright', - # 'origin_website', - # 'logo', - # 'image', - # 'contributor_list', - # 'other_contributor', - # "climate_impacts", - # "challenges", - # "objectives", - # "adaptationoptions", - # "solutions", - # "relevance", - # "keywords", - # "sectors", - # "elements", - # # "featured", # 'year', - # ], - # ) + form.fieldset( + "default", + label=u"Item Description", + fields=[ + "updating_notes", + "primary_photo", + "primary_photo_copyright", + "challenges", + "policy_legal_background", + "relevance", + "objectives", + "adaptationoptions", + "solutions", + # "keywords", + # "sectors", + # "elements", + # 'origin_website', + # 'logo', + # 'image', + # 'contributor_list', + # 'other_contributor', + # "featured", # 'year', + ], + ) + blocks = JSONField( title=_("Blocks"), diff --git a/eea/climateadapt/behaviors/volto_layout.py b/eea/climateadapt/behaviors/volto_layout.py index 1f7e55667..571640f63 100644 --- a/eea/climateadapt/behaviors/volto_layout.py +++ b/eea/climateadapt/behaviors/volto_layout.py @@ -3101,6 +3101,14 @@ "widget": "richtext" } }, + { + "@id": "c5480561-405a-4634-b925-bb31f1bef472", + "field": { + "id": "relevance", + "title": "Relevance", + "widget": "array" + } + }, { "@id": "d903f345-1f5b-402a-8ca3-9d7108fe60af", "field": { @@ -3125,14 +3133,6 @@ "widget": "richtext" } }, - { - "@id": "c5480561-405a-4634-b925-bb31f1bef472", - "field": { - "id": "relevance", - "title": "Relevance", - "widget": "array" - } - }, { "@id": "775a5368-df44-42b4-814e-02efb7f79d61", "field": { @@ -3153,7 +3153,7 @@ "@id": "ad026a59-e3e0-44a6-b809-46edead10a44", "field": { "id": "elements", - "title": "Adaptation elements", + "title": "Adaptation approaches", "widget": "array" } },