diff --git a/CHANGES.rst b/CHANGES.rst index 1e9c1246..50400870 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,8 +5,12 @@ Changelog 4.2.2 (unreleased) ------------------ +- Use batching on the saved data page. + [maurits] + - Pin version `Products.validation>=3.0.0` [petschki] + - Add a checkbox to disable autofocus on the first input [yurj] diff --git a/src/collective/easyform/browser/actions.py b/src/collective/easyform/browser/actions.py index 5d058d2b..71867abb 100644 --- a/src/collective/easyform/browser/actions.py +++ b/src/collective/easyform/browser/actions.py @@ -150,6 +150,7 @@ def view_schema(self): if ExtraData: return field.Fields(IExtraData).select(*ExtraData) + def get_items(self): return [ (key, DataWrapper(key, value, self.context)) @@ -200,6 +201,8 @@ def __call__(self): else: self.context.field.download(self.request.response) return u"" + if hasattr(self.context.field, 'BatchSize'): + self.form_instance.batch_size = self.context.field.BatchSize return super(SavedDataFormWrapper, self).__call__() diff --git a/src/collective/easyform/interfaces/savedata.py b/src/collective/easyform/interfaces/savedata.py index 20084978..c2a4d21d 100644 --- a/src/collective/easyform/interfaces/savedata.py +++ b/src/collective/easyform/interfaces/savedata.py @@ -91,3 +91,13 @@ class ISaveData(IAction): default=True, required=False, ) + BatchSize = zope.schema.Int( + title=_(u"label_batch_size", default=u"Batch size"), + description=_( + u"batch_size_text", + default=u"Define a batch size. Leave blank or set to 0 to disable batching in @@data view.", + ), + default=10, + min=0, + required=False, + ) diff --git a/src/collective/easyform/locales/collective.easyform.pot b/src/collective/easyform/locales/collective.easyform.pot index c2c8e19a..3913a9ff 100644 --- a/src/collective/easyform/locales/collective.easyform.pot +++ b/src/collective/easyform/locales/collective.easyform.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,7 +33,7 @@ msgstr "" msgid "Actions Model" msgstr "" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "" @@ -68,7 +68,7 @@ msgstr "" msgid "Choose an adapter." msgstr "" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "" @@ -96,11 +96,11 @@ msgstr "" msgid "EasyForm" msgstr "" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "" @@ -263,6 +263,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -634,6 +639,11 @@ msgstr "" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/de/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/de/LC_MESSAGES/collective.easyform.po index b1b245c6..bb339476 100644 --- a/src/collective/easyform/locales/de/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/de/LC_MESSAGES/collective.easyform.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: collective.easyform\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2017-01-20 09:48+0000\n" "Last-Translator: Johannes Raggam \n" "Language-Team: \n" @@ -32,7 +32,7 @@ msgstr "Art der Aktion" msgid "Actions Model" msgstr "Aktionsmodell" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Eine neue Aktion hinzufügen" @@ -67,7 +67,7 @@ msgstr "Das CSV Trennzeichen muss angegeben werden." msgid "Choose an adapter." msgstr "Wählen Sie einen Adapter aus." -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Alles löschen" @@ -95,11 +95,11 @@ msgstr "" msgid "EasyForm" msgstr "EasyForm" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Aktion '${fieldname}' bearbeiten" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "XML Aktionsmodell bearbeiten" @@ -262,6 +262,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -633,6 +638,11 @@ msgstr "Script zum Formular Setup" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/en/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/en/LC_MESSAGES/collective.easyform.po index ccd215ca..d7131d91 100644 --- a/src/collective/easyform/locales/en/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/en/LC_MESSAGES/collective.easyform.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,7 +30,7 @@ msgstr "" msgid "Actions Model" msgstr "" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "" @@ -65,7 +65,7 @@ msgstr "" msgid "Choose an adapter." msgstr "" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "" @@ -93,11 +93,11 @@ msgstr "" msgid "EasyForm" msgstr "" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "" @@ -260,6 +260,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -631,6 +636,11 @@ msgstr "" msgid "label_autofocus" msgstr "Autofocus" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/es/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/es/LC_MESSAGES/collective.easyform.po index ea9708d1..5a76e429 100644 --- a/src/collective/easyform/locales/es/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/es/LC_MESSAGES/collective.easyform.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2023-02-13 03:30-0400\n" "Last-Translator: Leonardo J. Caballero G. \n" "Language-Team: ES \n" @@ -36,7 +36,7 @@ msgstr "Tipo de Acción" msgid "Actions Model" msgstr "Modelo de Acción" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Añadir nueva acción" @@ -71,7 +71,7 @@ msgstr "El delimitador CSV es obligatorio." msgid "Choose an adapter." msgstr "Elige un adaptador." -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Limpiar" @@ -99,11 +99,11 @@ msgstr "Entrada de formulario de correos electrónicos" msgid "EasyForm" msgstr "EasyForm" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Editar acción '${fieldname}'" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Editar XML de Modelo de Acción" @@ -266,6 +266,11 @@ msgstr "Vista" msgid "Your E-Mail Address" msgstr "Su dirección de correo electrónico" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -638,6 +643,11 @@ msgstr "Script de preparación del formulario" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/eu/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/eu/LC_MESSAGES/collective.easyform.po index f05fc059..4f421f76 100644 --- a/src/collective/easyform/locales/eu/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/eu/LC_MESSAGES/collective.easyform.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2017-10-22 16:42+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -32,7 +32,7 @@ msgstr "Akzio mota" msgid "Actions Model" msgstr "Akzioen eredua" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Akzio berria gehitu" @@ -67,7 +67,7 @@ msgstr "" msgid "Choose an adapter." msgstr "" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Guztiak ezabatu" @@ -95,11 +95,11 @@ msgstr "" msgid "EasyForm" msgstr "EasyForm" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "'${fieldname}' akzioa aldatu" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Akzioen XML eredua editatu" @@ -262,6 +262,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -635,6 +640,11 @@ msgstr "Formularioa ezartzeko scripta" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/fr/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/fr/LC_MESSAGES/collective.easyform.po index 0e626db5..e0f95e12 100644 --- a/src/collective/easyform/locales/fr/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/fr/LC_MESSAGES/collective.easyform.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,7 +30,7 @@ msgstr "Type d'action" msgid "Actions Model" msgstr "Modèle des actions" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Ajouter une nouvelle action" @@ -65,7 +65,7 @@ msgstr "Le délimiteur CSV est requis." msgid "Choose an adapter." msgstr "Choisissez un élément." -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Effacer tout" @@ -93,11 +93,11 @@ msgstr "Envoie par courriel les réponses au formulaire" msgid "EasyForm" msgstr "Formulaire" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Editer l'action '${fieldname}'" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Editer le modèle XML des actions" @@ -260,6 +260,11 @@ msgstr "Voir" msgid "Your E-Mail Address" msgstr "Votre adresse courriel" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -633,6 +638,11 @@ msgstr "Script de configuration du formulaire" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/it/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/it/LC_MESSAGES/collective.easyform.po index c87283f4..8779384a 100644 --- a/src/collective/easyform/locales/it/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/it/LC_MESSAGES/collective.easyform.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2014-05-06 16.00+0000\n" "Last-Translator: Giorgio Borelli\n" "Language-Team: LANGUAGE \n" @@ -31,7 +31,7 @@ msgstr "Tipo di azione" msgid "Actions Model" msgstr "Modello azioni" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Aggiungi azione" @@ -66,7 +66,7 @@ msgstr "Il separatore per il CSV è obbligatorio" msgid "Choose an adapter." msgstr "Scegli un adattatore" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Cancella i dati salvati" @@ -76,7 +76,7 @@ msgstr "" #: ./collective/easyform/interfaces/fields.py:108 msgid "Define additional CSS class for this field here. This allowes for formating individual fields via CSS." -msgstr "" +msgstr "Definisci qui una classe CSS addizionale per questo campo. Questo serve a formattare individualmente un campo via CSS." #: ./collective/easyform/profiles/default/actions.xml msgid "Define form actions" @@ -94,11 +94,11 @@ msgstr "" msgid "EasyForm" msgstr "EasyForm" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Modifica l'azione '${fieldname}'" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Modifica l'XML delle azioni" @@ -124,7 +124,7 @@ msgstr "Esporta" #: ./collective/easyform/interfaces/fields.py:94 msgid "Field depends on" -msgstr "" +msgstr "Il campo dipende da" #: ./collective/easyform/interfaces/easyform.py:90 msgid "Fields Model" @@ -243,7 +243,7 @@ msgstr "Questi campi sono disponibili per le tue form" #: ./collective/easyform/interfaces/fields.py:97 msgid "This is using the pat-depends from patternslib, all options are supported. Please read the pat-depends documentations for options." -msgstr "" +msgstr "Utilizza pat-depends da patternslib, tutte le opzioni sono supportate. Si prega di leggere pat-depends documentations per le opzioni" #: ./collective/easyform/vocabularies.py:30 msgid "Traverse to" @@ -261,6 +261,11 @@ msgstr "Vista" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "Definisci in numero di elementi per pagina. Lascia in bianco o impostalo a 0 per disabilitare la paginazione nella vista @@data" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -484,12 +489,12 @@ msgstr "" #. Default: "Pick any extra data you'd like saved with the form input." #: ./collective/easyform/interfaces/savedata.py:72 msgid "help_savedataextra_text" -msgstr "" +msgstr "Scegli ogni altro dato extra che desideri salvare con il modulo di input." #. Default: "Pick the fields whose inputs you'd like to include in the saved data. If empty, all fields will be saved." #: ./collective/easyform/interfaces/savedata.py:60 msgid "help_savefields_text" -msgstr "" +msgstr "Scegli i campi il cui inserimento desideri includere nei dati salvati. Se vuoto, tutti i campi saranno salvati." #. Default: "Write your script here." #: ./collective/easyform/interfaces/customscript.py:32 @@ -601,7 +606,7 @@ msgstr "" #. Default: "Do you wish to have column names on the first line of downloaded input?" #: ./collective/easyform/interfaces/savedata.py:86 msgid "help_usecolumnnames_text" -msgstr "" +msgstr "Desideri avere i nomi delle colonne sulla prima linea degli input scaricati?" #. Default: "Select the validators to use on this field" #: ./collective/easyform/interfaces/fields.py:77 @@ -632,6 +637,11 @@ msgstr "" msgid "label_autofocus" msgstr "Autofocus" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/ja/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/ja/LC_MESSAGES/collective.easyform.po index 733b8dfa..314018e6 100644 --- a/src/collective/easyform/locales/ja/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/ja/LC_MESSAGES/collective.easyform.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2021-03-31 11:45 +0900\n" "Last-Translator: Manabu TERADA \n" "Language-Team: None\n" @@ -40,7 +40,7 @@ msgid "Actions Model" msgstr "アクションモデル" # Define form actions→「アクションを編集」右上ボタン -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "新規アクションを追加" @@ -80,7 +80,7 @@ msgid "Choose an adapter." msgstr "アダプターを選択してください" # セーブデータ内など -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "全件削除" @@ -112,13 +112,13 @@ msgid "EasyForm" msgstr "EasyForm" # Define form actions→「actionsを編集」 -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "‘${fieldname}‘のアクションを編集" # 開発者に問い合わせ(何をやっているのか?) # Define form actions→actionsを編集→右下ボタン -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr " XML アクションズモデルを編集" @@ -305,6 +305,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + # Easyform最初のページ下ボタン? #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 @@ -766,6 +771,11 @@ msgstr "フォームセットアップスクリプト" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + # 開発者に何を行うものなのか確認 # actions を編集⇒MailerのSettings⇒Overrides #. Default: "BCC Expression" diff --git a/src/collective/easyform/locales/nl/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/nl/LC_MESSAGES/collective.easyform.po index 3707497a..27923b36 100644 --- a/src/collective/easyform/locales/nl/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/nl/LC_MESSAGES/collective.easyform.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: plone 5-buildout\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2021-06-02 16:11+0200\n" "Last-Translator: Thibaut Born \n" "Language-Team: Dutch\n" @@ -34,7 +34,7 @@ msgstr "Type actie" msgid "Actions Model" msgstr "Actiemodel" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Voeg nieuwe actie toe" @@ -69,7 +69,7 @@ msgstr "" msgid "Choose an adapter." msgstr "Kies een adapter" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Wis alles" @@ -97,11 +97,11 @@ msgstr "" msgid "EasyForm" msgstr "" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Bewerk '${fieldname}' actie" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Bewerk XML actiemodel" @@ -264,6 +264,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "Jouw e-mailadres" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -637,6 +642,11 @@ msgstr "Formulier opstart script" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/pt_BR/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/pt_BR/LC_MESSAGES/collective.easyform.po index 8e8a42fd..c506e223 100644 --- a/src/collective/easyform/locales/pt_BR/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/pt_BR/LC_MESSAGES/collective.easyform.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2019-11-28 17:09+0100\n" "Last-Translator: Érico Andrei \n" "Language-Team: \n" @@ -30,7 +30,7 @@ msgstr "Tipo de ação" msgid "Actions Model" msgstr "Modelo de ação" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Adicionar nova ação" @@ -65,7 +65,7 @@ msgstr "" msgid "Choose an adapter." msgstr "" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Limpar tudo" @@ -93,11 +93,11 @@ msgstr "" msgid "EasyForm" msgstr "Formulário" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Editar ação '${fieldname}'" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Editar o XML do modelo de ação" @@ -260,6 +260,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -633,6 +638,11 @@ msgstr "Script para configuração do formulário" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/locales/uk/LC_MESSAGES/collective.easyform.po b/src/collective/easyform/locales/uk/LC_MESSAGES/collective.easyform.po index 1a855f21..ce9ebd2c 100644 --- a/src/collective/easyform/locales/uk/LC_MESSAGES/collective.easyform.po +++ b/src/collective/easyform/locales/uk/LC_MESSAGES/collective.easyform.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: collective.easyform\n" -"POT-Creation-Date: 2024-12-09 14:39+0000\n" +"POT-Creation-Date: 2024-12-13 10:36+0000\n" "PO-Revision-Date: 2015-10-13 11:16+0200\n" "Last-Translator: Zoriana Zaiats \n" "Language-Team: Ukrainian \n" @@ -33,7 +33,7 @@ msgstr "Тип дії" msgid "Actions Model" msgstr "Модель дій" -#: ./collective/easyform/browser/actions.py:292 +#: ./collective/easyform/browser/actions.py:295 msgid "Add new action" msgstr "Додати нову дію" @@ -68,7 +68,7 @@ msgstr "" msgid "Choose an adapter." msgstr "" -#: ./collective/easyform/browser/actions.py:175 +#: ./collective/easyform/browser/actions.py:176 msgid "Clear all" msgstr "Очистити все" @@ -96,11 +96,11 @@ msgstr "" msgid "EasyForm" msgstr "EasyForm" -#: ./collective/easyform/browser/actions.py:355 +#: ./collective/easyform/browser/actions.py:358 msgid "Edit Action '${fieldname}'" msgstr "Редагувати дію '${fieldname}'" -#: ./collective/easyform/browser/actions.py:360 +#: ./collective/easyform/browser/actions.py:363 msgid "Edit XML Actions Model" msgstr "Редагувати XML модель дій" @@ -263,6 +263,11 @@ msgstr "" msgid "Your E-Mail Address" msgstr "" +#. Default: "Define a batch size. Leave blank or set to 0 to disable batching in @@data view." +#: ./collective/easyform/interfaces/savedata.py:96 +msgid "batch_size_text" +msgstr "" + #. Default: "Reset" #: ./collective/easyform/interfaces/easyform.py:34 msgid "default_resetLabel" @@ -641,6 +646,11 @@ msgstr "Скрипт для налаштування форми" msgid "label_autofocus" msgstr "" +#. Default: "Batch size" +#: ./collective/easyform/interfaces/savedata.py:95 +msgid "label_batch_size" +msgstr "" + #. Default: "BCC Expression" #: ./collective/easyform/interfaces/mailer.py:497 msgid "label_bcc_override_text" diff --git a/src/collective/easyform/tests/testSaver.py b/src/collective/easyform/tests/testSaver.py index 2b9058a2..d33efd0c 100644 --- a/src/collective/easyform/tests/testSaver.py +++ b/src/collective/easyform/tests/testSaver.py @@ -6,6 +6,7 @@ from AccessControl.unauthorized import Unauthorized from collective.easyform.api import get_actions from collective.easyform.api import get_schema +from collective.easyform.api import set_actions from collective.easyform.interfaces import ISaveData from collective.easyform.tests import base from os.path import dirname @@ -652,10 +653,12 @@ def setUp(self): self.browser.addHeader( "Authorization", "Basic " + SITE_OWNER_NAME + ":" + SITE_OWNER_PASSWORD ) + # Make sure we have an email address so the mailer action works. + api.portal.set_registry_record("plone.email_from_address", "to@example.org") self.createSaver() def createSaver(self): - """Creates FormCustomScript object""" + """Creates SaveData object""" # 1. Create custom script adapter in the form folder self.portal.REQUEST["form.widgets.title"] = u"Saver" self.portal.REQUEST["form.widgets.__name__"] = u"saver" @@ -673,6 +676,12 @@ def createSaver(self): actions = get_actions(self.ff1) self.assertTrue("saver" in actions) + # Set a smaller batch size. + saver = actions["saver"] + saver.BatchSize = 3 + set_actions(self.ff1, actions) + commit() + def test_download_saveddata_view(self): self.browser.open(self.portal_url + "/test-folder/ff1/@@actions/saver/@@data") self.assertTrue("Saved Data" in self.browser.contents) @@ -742,6 +751,46 @@ def test_download_saveddata_csv_delimiter_from_form(self): self.browser.contents, "Your E-Mail Address;Subject;Comments\r\n" ) + def add_sample_data(self): + for i in range(1, 6): + self.browser.open(self.portal_url + "/test-folder/ff1") + self.browser.getControl(name="form.widgets.replyto").value = \ + "me%d@example.org" % i + self.browser.getControl(name="form.widgets.topic").value = "Subject %d" % i + self.browser.getControl(name="form.widgets.comments").value = \ + "Comments %d" % i + self.browser.getControl(name="form.buttons.submit").click() + self.assertIn("Thanks for your input.", self.browser.contents) + + def test_view_saveddata_batched(self): + self.add_sample_data() + self.browser.open( + self.portal_url + "/test-folder/ff1/@@actions/saver/@@data" + ) + with open('/tmp/test2.html', 'w') as testfile: + testfile.write(self.browser.contents) + self.assertTrue("Saved Data" in self.browser.contents) + self.assertTrue("me1@example.org" in self.browser.contents) + self.assertTrue("Subject 1" in self.browser.contents) + self.assertTrue("Comments 1" in self.browser.contents) + self.assertTrue("me2@example.org" in self.browser.contents) + self.assertTrue("me3@example.org" in self.browser.contents) + # We have a batch size of three, so the remaining two + # should not be visible. + self.assertFalse("me4@example.org" in self.browser.contents) + self.assertFalse("me5@example.org" in self.browser.contents) + + # Go to the next batch + self.browser.getLink("Next 2 items").click() + self.assertTrue("Saved Data" in self.browser.contents) + self.assertFalse("me1@example.org" in self.browser.contents) + self.assertFalse("me2@example.org" in self.browser.contents) + self.assertFalse("me3@example.org" in self.browser.contents) + self.assertTrue("me4@example.org" in self.browser.contents) + self.assertTrue("me5@example.org" in self.browser.contents) + self.assertTrue("Subject 4" in self.browser.contents) + self.assertTrue("Comments 5" in self.browser.contents) + # this test depends on internals of zope.testbrowser controls def test_download_saveddata_suggests_csv_delimiter_defines_maxlength(self): self.browser.open(