diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt
index 76dba37..0e976e1 100644
--- a/docs/HISTORY.txt
+++ b/docs/HISTORY.txt
@@ -4,7 +4,11 @@ Changelog
1.4.8 (unreleased)
------------------
-- Nothing changed yet.
+- Do not use key/value pairs in tipologia_bando and destinatari.
+ [cekk]
+
+- Bandi querystring criteria to search by bandi state.
+ [folix-01]
1.4.7 (2024-12-12)
diff --git a/redturtle/bandi/configure.zcml b/redturtle/bandi/configure.zcml
index ae217c1..1c6cca0 100644
--- a/redturtle/bandi/configure.zcml
+++ b/redturtle/bandi/configure.zcml
@@ -31,6 +31,7 @@
+
@@ -58,6 +59,15 @@
description="RedTurtle Bandi migrate to version 1100"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
+
+
+
+
+
diff --git a/redturtle/bandi/interfaces/settings.py b/redturtle/bandi/interfaces/settings.py
index 88e8033..bdf00cb 100644
--- a/redturtle/bandi/interfaces/settings.py
+++ b/redturtle/bandi/interfaces/settings.py
@@ -10,47 +10,47 @@ class IBandoSettings(Interface):
"""
default_ente = schema.Tuple(
- title=_(u"default_ente_label", default=u"Default Ente"),
+ title=_("default_ente_label", default="Default Ente"),
description=_(
- u"default_ente_help",
- default=u"Insert a list of default Enti that will be automatically selected when adding a new Bando.",
+ "default_ente_help",
+ default="Insert a list of default Enti that will be automatically selected when adding a new Bando.",
),
required=False,
value_type=schema.TextLine(),
missing_value=None,
- default=(u"Regione Emilia-Romagna",),
+ default=("Regione Emilia-Romagna",),
)
default_destinatari = schema.Tuple(
- title=_(u"default_destinatari_label", default=u"Destinatari types"),
+ title=_("default_destinatari_label", default="Destinatari types"),
description=_(
- u"default_destinatari_help",
- default=u"Insert a list of available destinatari that can be selected when adding a new Bando.",
+ "default_destinatari_help",
+ default="Insert a list of available destinatari that can be selected when adding a new Bando.",
),
required=False,
value_type=schema.TextLine(),
missing_value=None,
default=(
- u"Cittadini|Cittadini",
- u"Imprese|Imprese",
- u"Enti locali|Enti locali",
- u"Associazioni|Associazioni",
- u"Altro|Altro",
+ "Cittadini",
+ "Imprese",
+ "Enti locali",
+ "Associazioni",
+ "Altro",
),
)
tipologie_bando = schema.Tuple(
- title=_("tipologie_bando_label", default=u"Announcement types"),
+ title=_("tipologie_bando_label", default="Announcement types"),
description=_(
"tipologie_help",
- u"These values will extend bandi.xml vocabulary on filesystem",
+ "These values will extend bandi.xml vocabulary on filesystem",
),
required=False,
value_type=schema.TextLine(),
missing_value=None,
default=(
- u"beni_servizi|Acquisizione beni e servizi",
- u"agevolazioni|Agevolazioni, finanziamenti, contributi",
- u"altro|Altro",
+ "Acquisizione beni e servizi",
+ "Agevolazioni, finanziamenti, contributi",
+ "Altro",
),
)
diff --git a/redturtle/bandi/locales/it/LC_MESSAGES/redturtle.bandi.po b/redturtle/bandi/locales/it/LC_MESSAGES/redturtle.bandi.po
index ce5773e..d109e6b 100644
--- a/redturtle/bandi/locales/it/LC_MESSAGES/redturtle.bandi.po
+++ b/redturtle/bandi/locales/it/LC_MESSAGES/redturtle.bandi.po
@@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2024-12-04 07:35+0000\n"
+"POT-Creation-Date: 2025-02-05 13:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: Filippo Campi \n"
"Language-Team: LANGUAGE \n"
@@ -17,405 +17,465 @@ msgstr ""
"Preferred-Encodings: utf-8 latin1\n"
"Domain: redturtle.bandi\n"
-#: ../portlets/collection.py:299
+#: redturtle/bandi/portlets/collection.py:299
msgid "Add Bandi Portlet"
msgstr "Aggiungi Portlet Bandi"
-#: ../portlets/collection.py:23
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "After Date"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "After selected date"
+msgstr ""
+
+#: redturtle/bandi/portlets/collection.py:23
msgid "Alternative text to show in 'other' link."
msgstr "Testo alternativo da mostrare nel link ad 'altro'"
-#: ../profiles/default/controlpanel.xml
+#: redturtle/bandi/profiles/default/controlpanel.xml
msgid "Bandi Settings"
msgstr "Bandi"
-#: ../browser/configure.zcml:114
+#: redturtle/bandi/browser/configure.zcml:114
msgid "Bandi con scadenza"
msgstr ""
-#: ../browser/configure.zcml:120
+#: redturtle/bandi/browser/configure.zcml:120
msgid "Bandi con tipologia e scadenza"
msgstr ""
-#: ../browser/bando.py:252
-#: ../portlets/collection.py:261
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Bando"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Before Date"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Before selected date"
+msgstr ""
+
+#: redturtle/bandi/browser/bando.py:252
+#: redturtle/bandi/portlets/collection.py:261
msgid "Closed"
-msgstr "Scaduto"
+msgstr "Chiuso"
-#: ../browser/configure.zcml:46
+#: redturtle/bandi/browser/configure.zcml:46
msgid "Default"
msgstr ""
-#: ../portlets/collection.py:318
+#: redturtle/bandi/portlets/collection.py:318
msgid "Edit Bandi Portlet"
msgstr "Modifica Portlet Bandi"
-#: ../browser/bando.py:257
-#: ../portlets/collection.py:266
+#: redturtle/bandi/browser/bando.py:257
+#: redturtle/bandi/portlets/collection.py:266
msgid "In progress"
msgstr "In corso"
-#: ../portlets/collection.py:30
+#: redturtle/bandi/portlets/collection.py:30
msgid "Insert an internal link. This field override external link field"
msgstr "Inserisci un link interno. Questo campo sovrascriverà il campo link esterno."
-#: ../portlets/collection.py:29
+#: redturtle/bandi/portlets/collection.py:29
msgid "Internal link"
msgstr "Link interno."
-#: ../configure.zcml:60
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Is"
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:61
msgid "Migrate to version 1100"
msgstr ""
-#: ../browser/configure.zcml:64
+#: redturtle/bandi/configure.zcml:69
+msgid "Migrate to version 2300"
+msgstr ""
+
+#: redturtle/bandi/browser/configure.zcml:64
msgid "Mostra altre informazioni a destra"
msgstr ""
-#: ../browser/bando.py:242
-#: ../portlets/collection.py:253
+#: redturtle/bandi/browser/bando.py:242
+#: redturtle/bandi/portlets/collection.py:253
msgid "Open"
msgstr "Attivo"
-#: ../portlets/collection.py:22
+#: redturtle/bandi/portlets/collection.py:22
msgid "Other text"
msgstr "Testo per 'altro'"
-#: ../configure.zcml:60
+#: redturtle/bandi/configure.zcml:61
msgid "RedTurtle Bandi migrate to version 1100"
msgstr ""
-#: ../configure.zcml:44
+#: redturtle/bandi/configure.zcml:69
+msgid "RedTurtle Bandi migrate to version 2300"
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:45
msgid "Redturtle: Bandi"
msgstr ""
-#: ../browser/bando.py:241
+#: redturtle/bandi/browser/bando.py:241
msgid "Scheduled"
msgstr "Programmato"
-#: ../browser/configure.zcml:64
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Stato del bando"
+msgstr ""
+
+#: redturtle/bandi/browser/configure.zcml:64
msgid "Sulla destra"
msgstr ""
-#: ../portlets/collection.py:300
+#: redturtle/bandi/portlets/collection.py:300
msgid "This portlet display a listing of bandi from a Collection."
msgstr "Questa portlet mostra una lista di bandi da una collezione."
-#: ../configure.zcml:52
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Tip: you can use * to autocomplete."
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:53
msgid "Uninstalls the redturtle.bandi package"
msgstr ""
-#: ../browser/configure.zcml:46
+#: redturtle/bandi/browser/configure.zcml:46
msgid "Vista predefinita, altre informazioni sotto"
msgstr ""
#. Default: "Date and time of the opening of the announcement. Use this field if you want to set a specific opening date. If not set, the announcement will be open immediately."
-#: ../interfaces/bandoSchema.py:41
+#: redturtle/bandi/interfaces/bandoSchema.py:41
msgid "apertura_bando_help"
msgstr "Data e ora dell'apertura del bando. Usa questo campo se vuoi impostare una data di apertura specifica. Se non impostato, il bando sarà aperto immediatamente."
#. Default: "Opening date"
-#: ../browser/bando.pt:84
-#: ../interfaces/bandoSchema.py:40
-#: ../profiles/default/registry.xml
+#: redturtle/bandi/browser/bando.pt:84
+#: redturtle/bandi/interfaces/bandoSchema.py:40
+#: redturtle/bandi/profiles/default/registry.xml
msgid "apertura_bando_label"
msgstr "Data di apertura"
#. Default: "Layout Bandi"
-#: ../tiles/bandi_render.py:11
+#: redturtle/bandi/tiles/bandi_render.py:11
msgid "bandi_layout"
msgstr ""
#. Default: "Published on"
-#: ../browser/collection.pt:77
-#: ../browser/search.pt:124
-#: ../portlets/collection.pt:46
+#: redturtle/bandi/browser/collection.pt:77
+#: redturtle/bandi/browser/search.pt:124
+#: redturtle/bandi/portlets/collection.pt:46
msgid "bandi_published_on"
msgstr "Pubblicato il"
#. Default: "Authorities"
-#: ../browser/search_form.pt:113
+#: redturtle/bandi/browser/search_form.pt:113
msgid "bandi_search_authority_label"
msgstr "Enti"
#. Default: "This search mask allows to find announcements in the site that satisfy one or more search criteria."
-#: ../browser/search_form.pt:22
+#: redturtle/bandi/browser/search_form.pt:22
msgid "bandi_search_help"
msgstr "Questa maschera di ricerca permette di trovare i bandi nel sito che soddisfano uno o più criteri di ricerca."
#. Default: "Announcements Search"
-#: ../browser/search_form.pt:20
+#: redturtle/bandi/browser/search_form.pt:20
msgid "bandi_search_label"
msgstr "Ricerca bandi"
#. Default: "Select announcements recipients."
-#: ../browser/search_form.pt:94
+#: redturtle/bandi/browser/search_form.pt:94
msgid "bandi_search_recipients_help"
msgstr "Seleziona i destinatari dei bandi."
#. Default: "Recipients"
-#: ../browser/search_form.pt:92
+#: redturtle/bandi/browser/search_form.pt:92
msgid "bandi_search_recipients_label"
msgstr "Destinatari"
#. Default: "All"
-#: ../browser/search_form.pt:60
+#: redturtle/bandi/browser/search_form.pt:60
msgid "bandi_search_state_all"
msgstr "Tutti"
#. Default: "Closed"
-#: ../browser/search_form.pt:64
+#: redturtle/bandi/browser/search_form.pt:64
msgid "bandi_search_state_closed"
msgstr "Chiusi"
#. Default: "Search announcements scheduled (with open date in the future), open (with participation terms not expired), in progress (participation terms expired, but the procedure isn't already closed) or closed (the procedure is closed)."
-#: ../browser/search_form.pt:52
+#: redturtle/bandi/browser/search_form.pt:52
#, fuzzy
msgid "bandi_search_state_help"
msgstr "Cerca i bandi aperti (non sono scaduti i termini per la partecipazione), in corso (sono scaduti i termini di partecipazione e il procedimento non è ancora chiuso) o chiusi (il procedimento è chiuso)."
#. Default: "In progress"
-#: ../browser/search_form.pt:63
+#: redturtle/bandi/browser/search_form.pt:63
msgid "bandi_search_state_inprogress"
msgstr "In corso"
#. Default: "State"
-#: ../browser/search_form.pt:50
+#: redturtle/bandi/browser/search_form.pt:50
msgid "bandi_search_state_label"
msgstr "Stato"
#. Default: "Open"
-#: ../browser/search_form.pt:62
+#: redturtle/bandi/browser/search_form.pt:62
msgid "bandi_search_state_open"
msgstr "Aperti"
#. Default: "Scheduled"
-#: ../browser/search_form.pt:61
+#: redturtle/bandi/browser/search_form.pt:61
msgid "bandi_search_state_scheduled"
msgstr "Programmati"
#. Default: "For a simple text search, enter your search term here. Multiple words may be found by combining them with AND and OR. The text in this field will be matched with Announcements' title, description and text."
-#: ../browser/search_form.pt:35
+#: redturtle/bandi/browser/search_form.pt:35
msgid "bandi_search_text_help"
msgstr "Per una semplice ricerca di testo inserisci qui i termini desiderati. Possono essere cercate più parole contemporaneamente combinandole con gli operatori AND e OR. Il testo inserito in questo campo verrà cercato nel titolo, descrizione e testo dei bandi."
#. Default: "Search text"
-#: ../browser/search_form.pt:33
+#: redturtle/bandi/browser/search_form.pt:33
msgid "bandi_search_text_label"
msgstr "Ricerca testuale"
#. Default: "Select an annonuncement type."
-#: ../browser/search_form.pt:72
+#: redturtle/bandi/browser/search_form.pt:72
msgid "bandi_search_type_help"
msgstr "Seleziona una tipologia di bando."
#. Default: "Type"
-#: ../browser/search_form.pt:70
+#: redturtle/bandi/browser/search_form.pt:70
msgid "bandi_search_type_label"
msgstr "Tipologia"
#. Default: "Select where to search."
-#: ../browser/search_form.pt:184
+#: redturtle/bandi/browser/search_form.pt:184
msgid "bandi_searchsites_help"
msgstr "Seleziona i portali dove effettuare la ricerca."
#. Default: "Available sites"
-#: ../browser/search_form.pt:183
+#: redturtle/bandi/browser/search_form.pt:183
msgid "bandi_searchsites_label"
msgstr "Portali disponibili"
#. Default: "Impostazioni per i bandi"
-#: ../browser/controlpanel.py:9
+#: redturtle/bandi/browser/controlpanel.py:10
msgid "bandi_settings_label"
msgstr "Impostazioni per i bandi"
#. Default: "If checked, the search will be made on a selected list of ER Sites. If not checked, the search will be made only on this site."
-#: ../browser/search_form.pt:176
+#: redturtle/bandi/browser/search_form.pt:176
msgid "bandi_use_solr_help"
msgstr "Se selezionato, la ricerca verrà effettuata in una serie di portali ER. Se non selezionato, la ricerca verrà effettuata solamente in questo portale."
#. Default: "Multisite search"
-#: ../browser/search_form.pt:175
+#: redturtle/bandi/browser/search_form.pt:175
msgid "bandi_use_solr_label"
msgstr "Ricerca multisito"
#. Default: "Consulta gli approfondimenti"
-#: ../browser/bando.pt:111
+#: redturtle/bandi/browser/bando.pt:111
msgid "bando_anchor_foldeeps"
msgstr ""
#. Default: "Closing process"
-#: ../browser/bando-right.pt:91
-#: ../browser/bando.pt:100
+#: redturtle/bandi/browser/bando-right.pt:91
+#: redturtle/bandi/browser/bando.pt:100
msgid "bando_chiusura_procedimento"
msgstr "Chiusura procedimento"
#. Default: "Publication date"
-#: ../browser/bando-right.pt:74
-#: ../browser/bando.pt:76
+#: redturtle/bandi/browser/bando-right.pt:74
+#: redturtle/bandi/browser/bando.pt:76
msgid "bando_pub_date"
msgstr "Data di pubblicazione"
#. Default: "Deadline participation terms"
-#: ../browser/bando-right.pt:83
-#: ../browser/bando.pt:92
-#: ../browser/collection.pt:85
+#: redturtle/bandi/browser/bando-right.pt:83
+#: redturtle/bandi/browser/bando.pt:92
+#: redturtle/bandi/browser/collection.pt:85
msgid "bando_scadenza_partecipazione"
msgstr "Scadenza termini partecipazione"
#. Default: "Status"
-#: ../browser/bando-right.pt:32
-#: ../browser/bando.pt:35
+#: redturtle/bandi/browser/bando-right.pt:32
+#: redturtle/bandi/browser/bando.pt:35
msgid "bando_status_label"
msgstr "Stato"
#. Default: "${number} item matching your search terms"
-#: ../browser/search.pt:57
+#: redturtle/bandi/browser/search.pt:57
msgid "batch_x_item_matching_your_criteria"
msgstr "${number} elemento soddisfa i criteri specificati"
#. Default: "${number} items matching your search terms"
-#: ../browser/search.pt:48
+#: redturtle/bandi/browser/search.pt:48
msgid "batch_x_items_matching_your_criteria"
msgstr "${number} elementi soddisfano i criteri specificati"
#. Default: "Chiusura procedimento bando"
-#: ../profiles/default/registry.xml
+#: redturtle/bandi/profiles/default/registry.xml
msgid "chiusura_procedimento_bando"
msgstr ""
-#: ../interfaces/bandoSchema.py:54
+#: redturtle/bandi/interfaces/bandoSchema.py:54
msgid "chiusura_procedimento_bando_help"
msgstr ""
#. Default: "Closing date procedure"
-#: ../interfaces/bandoSchema.py:50
+#: redturtle/bandi/interfaces/bandoSchema.py:50
msgid "chiusura_procedimento_bando_label"
msgstr "Data chiusura procedimento"
+msgid "closed"
+msgstr "Chiuso"
+
#. Default: "Insert a list of available destinatari that can be selected when adding a new Bando."
-#: ../interfaces/settings.py:26
+#: redturtle/bandi/interfaces/settings.py:26
msgid "default_destinatari_help"
msgstr "Inserisci una lista di possibili destinatari che possono essere selezionati quando si aggiunge o modifica un Bando."
#. Default: "Destinatari types"
-#: ../interfaces/settings.py:25
+#: redturtle/bandi/interfaces/settings.py:25
msgid "default_destinatari_label"
msgstr "Destinatari"
#. Default: "Insert a list of default Enti that will be automatically selected when adding a new Bando."
-#: ../interfaces/settings.py:14
+#: redturtle/bandi/interfaces/settings.py:14
msgid "default_ente_help"
msgstr "Inserisci una lista di enti di default che verranno automaticamente selezionati quando si aggiunge un nuovo Bando."
#. Default: "Default Ente"
-#: ../interfaces/settings.py:13
+#: redturtle/bandi/interfaces/settings.py:13
msgid "default_ente_label"
msgstr "Enti di default"
#. Default: "There are currently no items in this folder."
-#: ../browser/collection.pt:96
+#: redturtle/bandi/browser/collection.pt:96
msgid "description_no_items_in_folder"
msgstr "Non ci sono elementi."
#. Default: "No results were found."
-#: ../browser/search.pt:84
+#: redturtle/bandi/browser/search.pt:84
msgid "description_no_results_found"
msgstr "Nessun risultato è stato trovato"
-#: ../interfaces/bandoSchema.py:78
+#: redturtle/bandi/interfaces/bandoSchema.py:78
msgid "destinatari_help"
msgstr ""
#. Default: "Recipients"
-#: ../browser/bando-right.pt:52
-#: ../browser/bando.pt:54
-#: ../interfaces/bandoSchema.py:77
+#: redturtle/bandi/browser/bando-right.pt:52
+#: redturtle/bandi/browser/bando.pt:54
+#: redturtle/bandi/interfaces/bandoSchema.py:77
msgid "destinatari_label"
msgstr "Destinatari"
#. Default: "Select some authorities."
-#: ../interfaces/bandoSchema.py:69
+#: redturtle/bandi/interfaces/bandoSchema.py:69
msgid "ente_help"
msgstr "Selezionare l'ente proponente del bando."
#. Default: "Authority"
-#: ../browser/bando-right.pt:63
-#: ../browser/bando.pt:65
-#: ../interfaces/bandoSchema.py:68
+#: redturtle/bandi/browser/bando-right.pt:63
+#: redturtle/bandi/browser/bando.pt:65
+#: redturtle/bandi/interfaces/bandoSchema.py:68
msgid "ente_label"
msgstr "Ente"
#. Default: "Announcements search results"
-#: ../browser/search.pt:40
+#: redturtle/bandi/browser/search.pt:40
msgid "heading_search_results"
msgstr "Risultati ricerca bandi"
#. Default: "Return items matching some or all of these authorities. Multiple words may be found by pressing Ctrl (or Apple key on Mac) while clicking the keywords."
-#: ../browser/search_form.pt:115
+#: redturtle/bandi/browser/search_form.pt:115
msgid "help_search_authorities"
msgstr "Mostra i bandi appartenenti a questi enti. Possono essere selezionati più tag mantenendo premuto il tasto Ctrl (o il tasto Mela sul Mac)."
+msgid "in-progress"
+msgstr "In corso"
+
#. Default: "Search"
-#: ../browser/search_form.pt:203
+#: redturtle/bandi/browser/search_form.pt:203
msgid "label_search"
msgstr "Cerca"
#. Default: "More…"
-#: ../tiles/bandi_render.pt:80
+#: redturtle/bandi/tiles/bandi_render.pt:80
msgid "more_url"
msgstr "Altro…"
-#: ../configure.zcml:52
+msgid "open"
+msgstr "Attivo"
+
+#: redturtle/bandi/configure.zcml:53
msgid "redturtle.bandi uninstall"
msgstr ""
#. Default: "indicare la struttura di riferimento e il responsabile del procedimento"
-#: ../interfaces/bandoSchema.py:36
+#: redturtle/bandi/interfaces/bandoSchema.py:36
msgid "riferimenti_bando_help"
msgstr "indicare la struttura di riferimento e il responsabile del procedimento"
#. Default: "References"
-#: ../interfaces/bandoSchema.py:35
+#: redturtle/bandi/interfaces/bandoSchema.py:35
msgid "riferimenti_bando_label"
msgstr "Riferimenti"
#. Default: "Deadline to participate in the announcement"
-#: ../interfaces/bandoSchema.py:60
+#: redturtle/bandi/interfaces/bandoSchema.py:60
msgid "scadenza_bando_help"
msgstr "Scadenza dei termini per partecipare al bando"
#. Default: "Expiration date and time"
-#: ../interfaces/bandoSchema.py:59
+#: redturtle/bandi/interfaces/bandoSchema.py:59
msgid "scadenza_bando_label"
msgstr "Data e ora di scadenza"
+msgid "scheduled"
+msgstr "Programmato"
+
#. Default: "No results found"
-#: ../tiles/bandi_render.pt:23
+#: redturtle/bandi/tiles/bandi_render.pt:23
msgid "tiles_collection_noresults"
msgstr "Non sono stati trovati bandi"
-#: ../interfaces/bandoSchema.py:85
+#: redturtle/bandi/interfaces/bandoSchema.py:85
msgid "tipologia_bando_help"
msgstr ""
#. Default: "Announcement type"
-#: ../browser/bando-right.pt:45
-#: ../browser/bando.pt:47
-#: ../browser/collection.pt:69
+#: redturtle/bandi/browser/bando-right.pt:45
+#: redturtle/bandi/browser/bando.pt:47
+#: redturtle/bandi/browser/collection.pt:69
msgid "tipologia_bando_label"
msgstr "Tipologia di bando"
#. Default: "Announcement types"
-#: ../interfaces/settings.py:43
+#: redturtle/bandi/interfaces/settings.py:43
msgid "tipologie_bando_label"
msgstr "Tipi di Bando"
#. Default: "These values will extend bandi.xml vocabulary on filesystem"
-#: ../interfaces/settings.py:44
+#: redturtle/bandi/interfaces/settings.py:44
msgid "tipologie_help"
msgstr "Questi valori estendono quelli del file bandi.xml su filesystem"
#. Default: "Subscribe to an always-updated feed of these search terms"
-#: ../browser/search.pt:75
+#: redturtle/bandi/browser/search.pt:75
msgid "title_rss_feed"
msgstr "Ricevi il flusso RSS costantemente aggiornato dei risultati di questa ricerca"
diff --git a/redturtle/bandi/locales/manual.pot b/redturtle/bandi/locales/manual.pot
new file mode 100644
index 0000000..cfc888d
--- /dev/null
+++ b/redturtle/bandi/locales/manual.pot
@@ -0,0 +1,32 @@
+# --- PLEASE EDIT THE LINES BELOW CORRECTLY ---
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR , YEAR.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2013-04-30 08:03+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"Language-Code: en\n"
+"Language-Name: English\n"
+"Preferred-Encodings: utf-8 latin1\n"
+"Domain: DOMAIN\n"
+
+
+msgid "open"
+msgstr ""
+
+msgid "in-progress"
+msgstr ""
+
+msgid "closed"
+msgstr ""
+
+msgid "scheduled"
+msgstr ""
+
diff --git a/redturtle/bandi/locales/redturtle.bandi.pot b/redturtle/bandi/locales/redturtle.bandi.pot
index a9c600f..dd5405c 100644
--- a/redturtle/bandi/locales/redturtle.bandi.pot
+++ b/redturtle/bandi/locales/redturtle.bandi.pot
@@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2024-12-04 07:35+0000\n"
+"POT-Creation-Date: 2025-02-05 13:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -17,403 +17,463 @@ msgstr ""
"Preferred-Encodings: utf-8 latin1\n"
"Domain: redturtle.bandi\n"
-#: ../portlets/collection.py:299
+#: redturtle/bandi/portlets/collection.py:299
msgid "Add Bandi Portlet"
msgstr ""
-#: ../portlets/collection.py:23
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "After Date"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "After selected date"
+msgstr ""
+
+#: redturtle/bandi/portlets/collection.py:23
msgid "Alternative text to show in 'other' link."
msgstr ""
-#: ../profiles/default/controlpanel.xml
+#: redturtle/bandi/profiles/default/controlpanel.xml
msgid "Bandi Settings"
msgstr ""
-#: ../browser/configure.zcml:114
+#: redturtle/bandi/browser/configure.zcml:114
msgid "Bandi con scadenza"
msgstr ""
-#: ../browser/configure.zcml:120
+#: redturtle/bandi/browser/configure.zcml:120
msgid "Bandi con tipologia e scadenza"
msgstr ""
-#: ../browser/bando.py:252
-#: ../portlets/collection.py:261
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Bando"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Before Date"
+msgstr ""
+
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Before selected date"
+msgstr ""
+
+#: redturtle/bandi/browser/bando.py:252
+#: redturtle/bandi/portlets/collection.py:261
msgid "Closed"
msgstr ""
-#: ../browser/configure.zcml:46
+#: redturtle/bandi/browser/configure.zcml:46
msgid "Default"
msgstr ""
-#: ../portlets/collection.py:318
+#: redturtle/bandi/portlets/collection.py:318
msgid "Edit Bandi Portlet"
msgstr ""
-#: ../browser/bando.py:257
-#: ../portlets/collection.py:266
+#: redturtle/bandi/browser/bando.py:257
+#: redturtle/bandi/portlets/collection.py:266
msgid "In progress"
msgstr ""
-#: ../portlets/collection.py:30
+#: redturtle/bandi/portlets/collection.py:30
msgid "Insert an internal link. This field override external link field"
msgstr ""
-#: ../portlets/collection.py:29
+#: redturtle/bandi/portlets/collection.py:29
msgid "Internal link"
msgstr ""
-#: ../configure.zcml:60
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Is"
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:61
msgid "Migrate to version 1100"
msgstr ""
-#: ../browser/configure.zcml:64
+#: redturtle/bandi/configure.zcml:69
+msgid "Migrate to version 2300"
+msgstr ""
+
+#: redturtle/bandi/browser/configure.zcml:64
msgid "Mostra altre informazioni a destra"
msgstr ""
-#: ../browser/bando.py:242
-#: ../portlets/collection.py:253
+#: redturtle/bandi/browser/bando.py:242
+#: redturtle/bandi/portlets/collection.py:253
msgid "Open"
msgstr ""
-#: ../portlets/collection.py:22
+#: redturtle/bandi/portlets/collection.py:22
msgid "Other text"
msgstr ""
-#: ../configure.zcml:60
+#: redturtle/bandi/configure.zcml:61
msgid "RedTurtle Bandi migrate to version 1100"
msgstr ""
-#: ../configure.zcml:44
+#: redturtle/bandi/configure.zcml:69
+msgid "RedTurtle Bandi migrate to version 2300"
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:45
msgid "Redturtle: Bandi"
msgstr ""
-#: ../browser/bando.py:241
+#: redturtle/bandi/browser/bando.py:241
msgid "Scheduled"
msgstr ""
-#: ../browser/configure.zcml:64
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Stato del bando"
+msgstr ""
+
+#: redturtle/bandi/browser/configure.zcml:64
msgid "Sulla destra"
msgstr ""
-#: ../portlets/collection.py:300
+#: redturtle/bandi/portlets/collection.py:300
msgid "This portlet display a listing of bandi from a Collection."
msgstr ""
-#: ../configure.zcml:52
+#: redturtle/bandi/profiles/default/registry.xml
+#: redturtle/bandi/profiles/to_2300/registry.xml
+msgid "Tip: you can use * to autocomplete."
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:53
msgid "Uninstalls the redturtle.bandi package"
msgstr ""
-#: ../browser/configure.zcml:46
+#: redturtle/bandi/browser/configure.zcml:46
msgid "Vista predefinita, altre informazioni sotto"
msgstr ""
#. Default: "Date and time of the opening of the announcement. Use this field if you want to set a specific opening date. If not set, the announcement will be open immediately."
-#: ../interfaces/bandoSchema.py:41
+#: redturtle/bandi/interfaces/bandoSchema.py:41
msgid "apertura_bando_help"
msgstr ""
#. Default: "Opening date"
-#: ../browser/bando.pt:84
-#: ../interfaces/bandoSchema.py:40
-#: ../profiles/default/registry.xml
+#: redturtle/bandi/browser/bando.pt:84
+#: redturtle/bandi/interfaces/bandoSchema.py:40
+#: redturtle/bandi/profiles/default/registry.xml
msgid "apertura_bando_label"
msgstr ""
#. Default: "Layout Bandi"
-#: ../tiles/bandi_render.py:11
+#: redturtle/bandi/tiles/bandi_render.py:11
msgid "bandi_layout"
msgstr ""
#. Default: "Published on"
-#: ../browser/collection.pt:77
-#: ../browser/search.pt:124
-#: ../portlets/collection.pt:46
+#: redturtle/bandi/browser/collection.pt:77
+#: redturtle/bandi/browser/search.pt:124
+#: redturtle/bandi/portlets/collection.pt:46
msgid "bandi_published_on"
msgstr ""
#. Default: "Authorities"
-#: ../browser/search_form.pt:113
+#: redturtle/bandi/browser/search_form.pt:113
msgid "bandi_search_authority_label"
msgstr ""
#. Default: "This search mask allows to find announcements in the site that satisfy one or more search criteria."
-#: ../browser/search_form.pt:22
+#: redturtle/bandi/browser/search_form.pt:22
msgid "bandi_search_help"
msgstr ""
#. Default: "Announcements Search"
-#: ../browser/search_form.pt:20
+#: redturtle/bandi/browser/search_form.pt:20
msgid "bandi_search_label"
msgstr ""
#. Default: "Select announcements recipients."
-#: ../browser/search_form.pt:94
+#: redturtle/bandi/browser/search_form.pt:94
msgid "bandi_search_recipients_help"
msgstr ""
#. Default: "Recipients"
-#: ../browser/search_form.pt:92
+#: redturtle/bandi/browser/search_form.pt:92
msgid "bandi_search_recipients_label"
msgstr ""
#. Default: "All"
-#: ../browser/search_form.pt:60
+#: redturtle/bandi/browser/search_form.pt:60
msgid "bandi_search_state_all"
msgstr ""
#. Default: "Closed"
-#: ../browser/search_form.pt:64
+#: redturtle/bandi/browser/search_form.pt:64
msgid "bandi_search_state_closed"
msgstr ""
#. Default: "Search announcements scheduled (with open date in the future), open (with participation terms not expired), in progress (participation terms expired, but the procedure isn't already closed) or closed (the procedure is closed)."
-#: ../browser/search_form.pt:52
+#: redturtle/bandi/browser/search_form.pt:52
msgid "bandi_search_state_help"
msgstr ""
#. Default: "In progress"
-#: ../browser/search_form.pt:63
+#: redturtle/bandi/browser/search_form.pt:63
msgid "bandi_search_state_inprogress"
msgstr ""
#. Default: "State"
-#: ../browser/search_form.pt:50
+#: redturtle/bandi/browser/search_form.pt:50
msgid "bandi_search_state_label"
msgstr ""
#. Default: "Open"
-#: ../browser/search_form.pt:62
+#: redturtle/bandi/browser/search_form.pt:62
msgid "bandi_search_state_open"
msgstr ""
#. Default: "Scheduled"
-#: ../browser/search_form.pt:61
+#: redturtle/bandi/browser/search_form.pt:61
msgid "bandi_search_state_scheduled"
msgstr ""
#. Default: "For a simple text search, enter your search term here. Multiple words may be found by combining them with AND and OR. The text in this field will be matched with Announcements' title, description and text."
-#: ../browser/search_form.pt:35
+#: redturtle/bandi/browser/search_form.pt:35
msgid "bandi_search_text_help"
msgstr ""
#. Default: "Search text"
-#: ../browser/search_form.pt:33
+#: redturtle/bandi/browser/search_form.pt:33
msgid "bandi_search_text_label"
msgstr ""
#. Default: "Select an annonuncement type."
-#: ../browser/search_form.pt:72
+#: redturtle/bandi/browser/search_form.pt:72
msgid "bandi_search_type_help"
msgstr ""
#. Default: "Type"
-#: ../browser/search_form.pt:70
+#: redturtle/bandi/browser/search_form.pt:70
msgid "bandi_search_type_label"
msgstr ""
#. Default: "Select where to search."
-#: ../browser/search_form.pt:184
+#: redturtle/bandi/browser/search_form.pt:184
msgid "bandi_searchsites_help"
msgstr ""
#. Default: "Available sites"
-#: ../browser/search_form.pt:183
+#: redturtle/bandi/browser/search_form.pt:183
msgid "bandi_searchsites_label"
msgstr ""
#. Default: "Impostazioni per i bandi"
-#: ../browser/controlpanel.py:9
+#: redturtle/bandi/browser/controlpanel.py:10
msgid "bandi_settings_label"
msgstr ""
#. Default: "If checked, the search will be made on a selected list of ER Sites. If not checked, the search will be made only on this site."
-#: ../browser/search_form.pt:176
+#: redturtle/bandi/browser/search_form.pt:176
msgid "bandi_use_solr_help"
msgstr ""
#. Default: "Multisite search"
-#: ../browser/search_form.pt:175
+#: redturtle/bandi/browser/search_form.pt:175
msgid "bandi_use_solr_label"
msgstr ""
#. Default: "Consulta gli approfondimenti"
-#: ../browser/bando.pt:111
+#: redturtle/bandi/browser/bando.pt:111
msgid "bando_anchor_foldeeps"
msgstr ""
#. Default: "Closing process"
-#: ../browser/bando-right.pt:91
-#: ../browser/bando.pt:100
+#: redturtle/bandi/browser/bando-right.pt:91
+#: redturtle/bandi/browser/bando.pt:100
msgid "bando_chiusura_procedimento"
msgstr ""
#. Default: "Publication date"
-#: ../browser/bando-right.pt:74
-#: ../browser/bando.pt:76
+#: redturtle/bandi/browser/bando-right.pt:74
+#: redturtle/bandi/browser/bando.pt:76
msgid "bando_pub_date"
msgstr ""
#. Default: "Deadline participation terms"
-#: ../browser/bando-right.pt:83
-#: ../browser/bando.pt:92
-#: ../browser/collection.pt:85
+#: redturtle/bandi/browser/bando-right.pt:83
+#: redturtle/bandi/browser/bando.pt:92
+#: redturtle/bandi/browser/collection.pt:85
msgid "bando_scadenza_partecipazione"
msgstr ""
#. Default: "Status"
-#: ../browser/bando-right.pt:32
-#: ../browser/bando.pt:35
+#: redturtle/bandi/browser/bando-right.pt:32
+#: redturtle/bandi/browser/bando.pt:35
msgid "bando_status_label"
msgstr ""
#. Default: "${number} item matching your search terms"
-#: ../browser/search.pt:57
+#: redturtle/bandi/browser/search.pt:57
msgid "batch_x_item_matching_your_criteria"
msgstr ""
#. Default: "${number} items matching your search terms"
-#: ../browser/search.pt:48
+#: redturtle/bandi/browser/search.pt:48
msgid "batch_x_items_matching_your_criteria"
msgstr ""
#. Default: "Chiusura procedimento bando"
-#: ../profiles/default/registry.xml
+#: redturtle/bandi/profiles/default/registry.xml
msgid "chiusura_procedimento_bando"
msgstr ""
-#: ../interfaces/bandoSchema.py:54
+#: redturtle/bandi/interfaces/bandoSchema.py:54
msgid "chiusura_procedimento_bando_help"
msgstr ""
#. Default: "Closing date procedure"
-#: ../interfaces/bandoSchema.py:50
+#: redturtle/bandi/interfaces/bandoSchema.py:50
msgid "chiusura_procedimento_bando_label"
msgstr ""
+msgid "closed"
+msgstr ""
+
#. Default: "Insert a list of available destinatari that can be selected when adding a new Bando."
-#: ../interfaces/settings.py:26
+#: redturtle/bandi/interfaces/settings.py:26
msgid "default_destinatari_help"
msgstr ""
#. Default: "Destinatari types"
-#: ../interfaces/settings.py:25
+#: redturtle/bandi/interfaces/settings.py:25
msgid "default_destinatari_label"
msgstr ""
#. Default: "Insert a list of default Enti that will be automatically selected when adding a new Bando."
-#: ../interfaces/settings.py:14
+#: redturtle/bandi/interfaces/settings.py:14
msgid "default_ente_help"
msgstr ""
#. Default: "Default Ente"
-#: ../interfaces/settings.py:13
+#: redturtle/bandi/interfaces/settings.py:13
msgid "default_ente_label"
msgstr ""
#. Default: "There are currently no items in this folder."
-#: ../browser/collection.pt:96
+#: redturtle/bandi/browser/collection.pt:96
msgid "description_no_items_in_folder"
msgstr ""
#. Default: "No results were found."
-#: ../browser/search.pt:84
+#: redturtle/bandi/browser/search.pt:84
msgid "description_no_results_found"
msgstr ""
-#: ../interfaces/bandoSchema.py:78
+#: redturtle/bandi/interfaces/bandoSchema.py:78
msgid "destinatari_help"
msgstr ""
#. Default: "Recipients"
-#: ../browser/bando-right.pt:52
-#: ../browser/bando.pt:54
-#: ../interfaces/bandoSchema.py:77
+#: redturtle/bandi/browser/bando-right.pt:52
+#: redturtle/bandi/browser/bando.pt:54
+#: redturtle/bandi/interfaces/bandoSchema.py:77
msgid "destinatari_label"
msgstr ""
#. Default: "Select some authorities."
-#: ../interfaces/bandoSchema.py:69
+#: redturtle/bandi/interfaces/bandoSchema.py:69
msgid "ente_help"
msgstr ""
#. Default: "Authority"
-#: ../browser/bando-right.pt:63
-#: ../browser/bando.pt:65
-#: ../interfaces/bandoSchema.py:68
+#: redturtle/bandi/browser/bando-right.pt:63
+#: redturtle/bandi/browser/bando.pt:65
+#: redturtle/bandi/interfaces/bandoSchema.py:68
msgid "ente_label"
msgstr ""
#. Default: "Announcements search results"
-#: ../browser/search.pt:40
+#: redturtle/bandi/browser/search.pt:40
msgid "heading_search_results"
msgstr ""
#. Default: "Return items matching some or all of these authorities. Multiple words may be found by pressing Ctrl (or Apple key on Mac) while clicking the keywords."
-#: ../browser/search_form.pt:115
+#: redturtle/bandi/browser/search_form.pt:115
msgid "help_search_authorities"
msgstr ""
+msgid "in-progress"
+msgstr ""
+
#. Default: "Search"
-#: ../browser/search_form.pt:203
+#: redturtle/bandi/browser/search_form.pt:203
msgid "label_search"
msgstr ""
#. Default: "More…"
-#: ../tiles/bandi_render.pt:80
+#: redturtle/bandi/tiles/bandi_render.pt:80
msgid "more_url"
msgstr ""
-#: ../configure.zcml:52
+msgid "open"
+msgstr ""
+
+#: redturtle/bandi/configure.zcml:53
msgid "redturtle.bandi uninstall"
msgstr ""
-#: ../interfaces/bandoSchema.py:36
+#: redturtle/bandi/interfaces/bandoSchema.py:36
msgid "riferimenti_bando_help"
msgstr ""
#. Default: "References"
-#: ../interfaces/bandoSchema.py:35
+#: redturtle/bandi/interfaces/bandoSchema.py:35
msgid "riferimenti_bando_label"
msgstr ""
#. Default: "Deadline to participate in the announcement"
-#: ../interfaces/bandoSchema.py:60
+#: redturtle/bandi/interfaces/bandoSchema.py:60
msgid "scadenza_bando_help"
msgstr ""
#. Default: "Expiration date and time"
-#: ../interfaces/bandoSchema.py:59
+#: redturtle/bandi/interfaces/bandoSchema.py:59
msgid "scadenza_bando_label"
msgstr ""
+msgid "scheduled"
+msgstr ""
+
#. Default: "No results found"
-#: ../tiles/bandi_render.pt:23
+#: redturtle/bandi/tiles/bandi_render.pt:23
msgid "tiles_collection_noresults"
msgstr ""
-#: ../interfaces/bandoSchema.py:85
+#: redturtle/bandi/interfaces/bandoSchema.py:85
msgid "tipologia_bando_help"
msgstr ""
#. Default: "Announcement type"
-#: ../browser/bando-right.pt:45
-#: ../browser/bando.pt:47
-#: ../browser/collection.pt:69
+#: redturtle/bandi/browser/bando-right.pt:45
+#: redturtle/bandi/browser/bando.pt:47
+#: redturtle/bandi/browser/collection.pt:69
msgid "tipologia_bando_label"
msgstr ""
#. Default: "Announcement types"
-#: ../interfaces/settings.py:43
+#: redturtle/bandi/interfaces/settings.py:43
msgid "tipologie_bando_label"
msgstr ""
#. Default: "These values will extend bandi.xml vocabulary on filesystem"
-#: ../interfaces/settings.py:44
+#: redturtle/bandi/interfaces/settings.py:44
msgid "tipologie_help"
msgstr ""
#. Default: "Subscribe to an always-updated feed of these search terms"
-#: ../browser/search.pt:75
+#: redturtle/bandi/browser/search.pt:75
msgid "title_rss_feed"
msgstr ""
diff --git a/redturtle/bandi/locales/update.py b/redturtle/bandi/locales/update.py
index d70e9dc..8c96e39 100644
--- a/redturtle/bandi/locales/update.py
+++ b/redturtle/bandi/locales/update.py
@@ -52,7 +52,18 @@ def _sync():
subprocess.call(cmd, shell=True)
+def _merge():
+ cmd = "{0} merge --pot {1}/{2}.pot --merge {3}/manual.pot".format(
+ i18ndude, locale_path, domain, locale_path
+ )
+ subprocess.call(
+ cmd,
+ shell=True,
+ )
+
+
def update_locale():
locale_folder_setup()
_sync()
_rebuild()
+ _merge()
diff --git a/redturtle/bandi/locales/update.sh b/redturtle/bandi/locales/update.sh
index 444517b..0e23004 100755
--- a/redturtle/bandi/locales/update.sh
+++ b/redturtle/bandi/locales/update.sh
@@ -9,4 +9,5 @@
domain=redturtle.bandi
i18ndude rebuild-pot --pot $domain.pot --create $domain ../
+i18ndude merge --pot $domain.pot --merge manual.pot
i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
diff --git a/redturtle/bandi/profiles/default/metadata.xml b/redturtle/bandi/profiles/default/metadata.xml
index 882cc6e..fbcc667 100644
--- a/redturtle/bandi/profiles/default/metadata.xml
+++ b/redturtle/bandi/profiles/default/metadata.xml
@@ -1,4 +1,4 @@
- 2102
+ 2300
diff --git a/redturtle/bandi/profiles/default/registry.xml b/redturtle/bandi/profiles/default/registry.xml
index f36c2d6..73df627 100644
--- a/redturtle/bandi/profiles/default/registry.xml
+++ b/redturtle/bandi/profiles/default/registry.xml
@@ -104,7 +104,7 @@
++plone++redturtle.bandi.styles/bandi.css
-
+
@@ -116,4 +116,63 @@
2017-11-26 00:00:00
+
+ Stato del bando
+
+ True
+ False
+
+ plone.app.querystring.operation.selection.bando_state_is
+
+ redturtle.bandi.vocabularies.bandi_states
+ Bando
+
+
+
+ Is
+ Tip: you can use * to autocomplete.
+ plone.app.querystring.queryparser._equal
+ MultipleSelectionWidget
+
+
+
+ After Date
+ After selected date
+ redturtle.bandi.querystring.queryparser._afterDateTime
+ DateWidget
+
+
+
+ Before Date
+ Before selected date
+ redturtle.bandi.querystring.queryparser._beforeDateTime
+ DateWidget
+
+
diff --git a/redturtle/bandi/profiles/to_2300/registry.xml b/redturtle/bandi/profiles/to_2300/registry.xml
new file mode 100644
index 0000000..19135d4
--- /dev/null
+++ b/redturtle/bandi/profiles/to_2300/registry.xml
@@ -0,0 +1,63 @@
+
+
+
+ Is
+ Tip: you can use * to autocomplete.
+ plone.app.querystring.queryparser._equal
+ MultipleSelectionWidget
+
+
+
+ Stato del bando
+
+ True
+ False
+
+ plone.app.querystring.operation.selection.is
+
+ redturtle.bandi.vocabularies.bandi_states
+ Bando
+
+
+
+ After Date
+ After selected date
+ redturtle.bandi.querystring.queryparser._afterDateTime
+ DateWidget
+
+
+
+ Before Date
+ Before selected date
+ redturtle.bandi.querystring.queryparser._beforeDateTime
+ DateWidget
+
+
+
\ No newline at end of file
diff --git a/redturtle/bandi/querymodifiers/__init__.py b/redturtle/bandi/querymodifiers/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/redturtle/bandi/querymodifiers/bandi_state.py b/redturtle/bandi/querymodifiers/bandi_state.py
new file mode 100644
index 0000000..27c2004
--- /dev/null
+++ b/redturtle/bandi/querymodifiers/bandi_state.py
@@ -0,0 +1,68 @@
+from plone.app.querystring.interfaces import IQueryModifier
+from zope.interface import provider
+from plone.restapi.serializer.converters import json_compatible
+from DateTime import DateTime
+
+
+@provider(IQueryModifier)
+def modify_bandi_state_query(query):
+ now = json_compatible(DateTime())
+ item = None
+ query_extender = []
+
+ state_operators = {
+ "open": (
+ {
+ "o": "plone.app.querystring.operation.date.largerThanRelativeDate",
+ "v": now,
+ "i": "scadenza_bando",
+ },
+ {
+ "o": "plone.app.querystring.operation.date.largerThanRelativeDate",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "in-progress": (
+ {
+ "o": "plone.app.querystring.operation.date.lessThanRelativeDate",
+ "v": now,
+ "i": "scadenza_bando",
+ },
+ {
+ "o": "plone.app.querystring.operation.date.largerThanRelativeDate",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "closed": (
+ {
+ "o": "plone.app.querystring.operation.date.lessThanRelativeDate",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "scheduled": (
+ {
+ "o": "plone.app.querystring.operation.date.largerThanRelativeDate",
+ "v": now,
+ "i": "apertura_bando",
+ },
+ ),
+ }
+
+ for i in query:
+ if i.get("i", "") == "bando_state":
+ item = i
+
+ for value in i.get("v", []):
+ operator = state_operators.get(value, None)
+
+ if operator:
+ query_extender.extend(operator)
+
+ if item:
+ query.remove(item)
+ query.extend(query_extender)
+
+ return query
diff --git a/redturtle/bandi/querymodifiers/configure.zcml b/redturtle/bandi/querymodifiers/configure.zcml
new file mode 100644
index 0000000..39133eb
--- /dev/null
+++ b/redturtle/bandi/querymodifiers/configure.zcml
@@ -0,0 +1,13 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/redturtle/bandi/querystring/__init__.py b/redturtle/bandi/querystring/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/redturtle/bandi/querystring/configure.zcml b/redturtle/bandi/querystring/configure.zcml
new file mode 100644
index 0000000..235254a
--- /dev/null
+++ b/redturtle/bandi/querystring/configure.zcml
@@ -0,0 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/redturtle/bandi/querystring/querymodifiers/__init__.py b/redturtle/bandi/querystring/querymodifiers/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/redturtle/bandi/querystring/querymodifiers/bandi_state.py b/redturtle/bandi/querystring/querymodifiers/bandi_state.py
new file mode 100644
index 0000000..05c63d8
--- /dev/null
+++ b/redturtle/bandi/querystring/querymodifiers/bandi_state.py
@@ -0,0 +1,77 @@
+from plone.app.querystring.interfaces import IQueryModifier
+from zope.interface import provider
+from plone.restapi.serializer.converters import json_compatible
+from DateTime import DateTime
+
+
+@provider(IQueryModifier)
+def modify_bandi_state_query(query):
+ now = json_compatible(DateTime())
+ item = None
+ query_extender = []
+
+ state_operators = {
+ "open": (
+ {
+ "o": "plone.app.querystring.operation.date.afterDateTime",
+ "v": now,
+ "i": "scadenza_bando",
+ },
+ {
+ "o": "plone.app.querystring.operation.date.afterDateTime",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "in-progress": (
+ {
+ "o": "plone.app.querystring.operation.date.beforeDateTime",
+ "v": now,
+ "i": "scadenza_bando",
+ },
+ {
+ "o": "plone.app.querystring.operation.date.afterDateTime",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "closed": (
+ {
+ "o": "plone.app.querystring.operation.date.beforeDateTime",
+ "v": now,
+ "i": "chiusura_procedimento_bando",
+ },
+ ),
+ "scheduled": (
+ {
+ "o": "plone.app.querystring.operation.date.afterDateTime",
+ "v": now,
+ "i": "apertura_bando",
+ },
+ ),
+ }
+
+ query_items_to_remove = []
+
+ for i in query:
+ if i.get("i", "") == "bando_state":
+ item = i
+
+ value = i.get("v", "")
+
+ if type(value) is list:
+ value = value and value[0] or ""
+
+ operator = state_operators.get(value, None)
+
+ if operator:
+ query_extender.extend(operator)
+ query_items_to_remove.append(item)
+
+ if query_extender:
+ for i in query_items_to_remove:
+ query.remove(i)
+
+ query.extend(query_extender)
+
+ return query
diff --git a/redturtle/bandi/querystring/querymodifiers/configure.zcml b/redturtle/bandi/querystring/querymodifiers/configure.zcml
new file mode 100644
index 0000000..39133eb
--- /dev/null
+++ b/redturtle/bandi/querystring/querymodifiers/configure.zcml
@@ -0,0 +1,13 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/redturtle/bandi/querystring/queryparser.py b/redturtle/bandi/querystring/queryparser.py
new file mode 100644
index 0000000..690ab11
--- /dev/null
+++ b/redturtle/bandi/querystring/queryparser.py
@@ -0,0 +1,27 @@
+import DateTime
+from collections import namedtuple
+from plone.app.querystring.queryparser import _lessThan, _largerThan
+
+Row = namedtuple("Row", ["index", "operator", "values"])
+
+
+def _afterDateTime(context, row): # noqa
+ try:
+ value = DateTime.DateTime(row.values)
+ except DateTime.interfaces.SyntaxError:
+ value = DateTime.DateTime()
+
+ row = Row(index=row.index, operator=row.operator, values=value)
+
+ return _largerThan(context, row)
+
+
+def _beforeDateTime(context, row): # noqa
+ try:
+ value = DateTime.DateTime(row.values)
+ except DateTime.interfaces.SyntaxError:
+ value = DateTime.DateTime()
+
+ row = Row(index=row.index, operator=row.operator, values=value)
+
+ return _lessThan(context, row)
diff --git a/redturtle/bandi/tests/test_bando_view.py b/redturtle/bandi/tests/test_bando_view.py
index d91839d..26a49cc 100644
--- a/redturtle/bandi/tests/test_bando_view.py
+++ b/redturtle/bandi/tests/test_bando_view.py
@@ -80,7 +80,7 @@ def test_tipologia_bando_in_view(self):
container=self.portal,
type="Bando",
title="Bando new",
- tipologia_bando="altro",
+ tipologia_bando="Altro",
)
view_new = api.content.get_view(
name="bando_view", context=bando_new, request=self.request
@@ -99,7 +99,7 @@ def test_tipologia_bando_in_right_view(self):
container=self.portal,
type="Bando",
title="Bando new",
- tipologia_bando="altro",
+ tipologia_bando="Altro",
)
view_new = api.content.get_view(
name="bando_right_view", context=bando_new, request=self.request
diff --git a/redturtle/bandi/upgrades.py b/redturtle/bandi/upgrades.py
index 9e0fc22..86cc8f2 100644
--- a/redturtle/bandi/upgrades.py
+++ b/redturtle/bandi/upgrades.py
@@ -2,6 +2,7 @@
from plone import api
from plone.app.event.base import default_timezone
from redturtle.bandi import logger
+from redturtle.bandi.interfaces.settings import IBandoSettings
import pytz
@@ -48,10 +49,10 @@ def migrate_to_1100(context):
)
criteria_mapping = {
- u"getTipologia_bando": u"tipologia_bando",
- u"getChiusura_procedimento_bando": u"chiusura_procedimento_bando",
- u"getScadenza_bando": u"scadenza_bando",
- u"getDestinatariBando": u"destinatari_bando",
+ "getTipologia_bando": "tipologia_bando",
+ "getChiusura_procedimento_bando": "chiusura_procedimento_bando",
+ "getScadenza_bando": "scadenza_bando",
+ "getDestinatariBando": "destinatari_bando",
}
collections = api.content.find(portal_type="Collection")
tot_results = len(collections)
@@ -169,7 +170,7 @@ def migrate_to_2101(context):
)
)
bando = brain.getObject()
- bando.reindexObject(idxs=['scadenza_bando'])
+ bando.reindexObject(idxs=["scadenza_bando"])
def migrate_to_2102(context):
@@ -185,4 +186,115 @@ def migrate_to_2102(context):
)
)
bando = brain.getObject()
- bando.reindexObject(idxs=['tipologia_bando_label'])
+ bando.reindexObject(idxs=["tipologia_bando_label"])
+
+
+def migrate_to_2200(context):
+ from Acquisition import aq_base
+ from plone.dexterity.utils import iterSchemata
+ from copy import deepcopy
+ from zope.schema import getFields
+
+ try:
+ from collective.volto.blocksfield.field import BlocksField
+
+ HAS_BLOCKS_FIELD = True
+ except ImportError:
+ HAS_BLOCKS_FIELD = True
+
+ bandi = api.content.find(portal_type="Bando")
+ tot_results = len(bandi)
+ logger.info("### Fixing {tot} Bandi ###".format(tot=tot_results))
+
+ def get_value(key, value):
+ for entry in api.portal.get_registry_record(
+ key, interface=IBandoSettings, default=[]
+ ):
+ id, label = entry.split("|")
+ if id == value:
+ return label
+ return value
+
+ def fix_listing(blocks):
+ for block in blocks.values():
+ if block.get("@type", "") != "listing":
+ continue
+ for query in block.get("querystring", {}).get("query", []):
+ value = query["v"]
+ if query["i"] == "destinatari_bando":
+ query["v"] = [
+ get_value(key="default_destinatari", value=v) for v in value
+ ]
+ elif query["i"] == "tipologia_bando":
+ query["v"] = [
+ get_value(key="tipologie_bando", value=v) for v in value
+ ]
+
+ for counter, brain in enumerate(bandi):
+ logger.info(
+ "[{counter}/{tot}] - {bando}".format(
+ counter=counter + 1, tot=tot_results, bando=brain.getPath()
+ )
+ )
+ bando = brain.getObject()
+ tipologia = getattr(bando, "tipologia_bando", "")
+ destinatari = getattr(bando, "destinatari", "")
+ if tipologia:
+ value = get_value(key="tipologie_bando", value=tipologia)
+ setattr(bando, "tipologia_bando", value)
+ if destinatari:
+ value = [get_value(key="default_destinatari", value=x) for x in destinatari]
+ setattr(bando, "destinatari", value)
+ bando.reindexObject(idxs=["tipologia_bando", "destinatari_bando"])
+
+ # fix blocks
+ # fix blocks in contents
+ logger.info("### Fixing blocks ###")
+ pc = api.portal.get_tool(name="portal_catalog")
+ brains = pc()
+ tot = len(brains)
+ i = 0
+ for brain in brains:
+ i += 1
+ if i % 1000 == 0:
+ logger.info("Progress: {}/{}".format(i, tot))
+ item = aq_base(brain.getObject())
+ if getattr(item, "blocks", {}):
+ blocks = deepcopy(item.blocks)
+ if blocks:
+ fix_listing(blocks)
+ item.blocks = blocks
+ if HAS_BLOCKS_FIELD:
+ for schema in iterSchemata(item):
+ # fix blocks in blocksfields
+ for name, field in getFields(schema).items():
+ if not isinstance(field, BlocksField):
+ continue
+ value = deepcopy(field.get(item))
+ if not value:
+ continue
+ blocks = value.get("blocks", {})
+ if blocks:
+ fix_listing(blocks)
+ setattr(item, name, value)
+
+ # cleanup vocabs
+ for key in ["tipologie_bando", "default_destinatari"]:
+ values = []
+ for old_val in api.portal.get_registry_record(
+ key, interface=IBandoSettings, default=[]
+ ):
+ id, label = old_val.split("|")
+ values.append(label)
+
+ api.portal.set_registry_record(key, tuple(values), interface=IBandoSettings)
+
+
+def migrate_to_2300(context):
+ PROFILE_ID = "profile-redturtle.bandi:to_2300"
+ context.runAllImportStepsFromProfile(PROFILE_ID)
+
+ # update indexes and topics
+ context.runImportStepFromProfile(
+ default_profile, "plone.app.registry", run_dependencies=False
+ )
diff --git a/redturtle/bandi/upgrades.zcml b/redturtle/bandi/upgrades.zcml
index 9c32caf..04b77b0 100644
--- a/redturtle/bandi/upgrades.zcml
+++ b/redturtle/bandi/upgrades.zcml
@@ -58,7 +58,7 @@
destination="2101"
handler=".upgrades.migrate_to_2101"
profile="redturtle.bandi:default" />
-
+
+
+
+
+
diff --git a/redturtle/bandi/vocabularies.py b/redturtle/bandi/vocabularies.py
index ecb8f97..38bdd28 100644
--- a/redturtle/bandi/vocabularies.py
+++ b/redturtle/bandi/vocabularies.py
@@ -14,13 +14,7 @@ def __call__(self, context):
values = api.portal.get_registry_record(
"tipologie_bando", interface=IBandoSettings, default=[]
)
- terms = []
- for tipologia in values:
- if tipologia and "|" in tipologia:
- key, value = tipologia.split("|", 1)
- terms.append(SimpleTerm(value=key, token=key, title=value))
- else:
- logger.error("invalid tipologia bando %s", tipologia)
+ terms = [SimpleTerm(value=x, token=x, title=x) for x in values if x]
return SimpleVocabulary(terms)
@@ -39,9 +33,12 @@ def __call__(self, context):
l.append(tuple(values[i].split("|")))
terms = [
- SimpleTerm(value=pair[0], token=pair[0], title=pair[1])
+ SimpleTerm(
+ value=pair[0], token=pair[0], title=len(pair) > 1 and pair[1] or ""
+ )
for pair in l
]
+
return SimpleVocabulary(terms)
@@ -53,11 +50,27 @@ class EnteVocabularyFactory(object):
def __call__(self, context):
catalog = api.portal.get_tool("portal_catalog")
enti = list(catalog._catalog.uniqueValuesFor("ente_bando"))
+ terms = [SimpleTerm(value=ente, token=ente, title=ente) for ente in enti]
+
+ return SimpleVocabulary(terms)
+
+
+EnteVocabulary = EnteVocabularyFactory()
+
+
+@implementer(IVocabularyFactory)
+class BandiStatesVcabulary(object):
+ def __call__(self, context):
terms = [
- SimpleTerm(value=ente, token=ente, title=ente) for ente in enti
+ SimpleTerm(
+ value=i,
+ token=i,
+ title=api.portal.translate(msgid=i, domain="redturtle.bandi"),
+ )
+ for i in ["open", "in-progress", "closed", "scheduled"]
]
return SimpleVocabulary(terms)
-EnteVocabulary = EnteVocabularyFactory()
+BandiStatesVcabularyFactory = BandiStatesVcabulary()