From 8db7934a30104a55aef1f8dcabab4963acfc5db3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 07:33:30 +0200 Subject: [PATCH 1/3] add option 'require' for textarea form elements --- doc/smarty3-templates.md | 1 + view/templates/field_textarea.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/smarty3-templates.md b/doc/smarty3-templates.md index 599e3597e7..f174f21642 100644 --- a/doc/smarty3-templates.md +++ b/doc/smarty3-templates.md @@ -177,6 +177,7 @@ Field parameter: 1. Label for the input box, 2. Current text for the box, 3. Help text for the input box. +4. if set to "required" modern browser will check that this input box is filled when submitting the form, ### field_yesno.tpl diff --git a/view/templates/field_textarea.tpl b/view/templates/field_textarea.tpl index eadcbe56c7..17b07266a9 100644 --- a/view/templates/field_textarea.tpl +++ b/view/templates/field_textarea.tpl @@ -1,7 +1,7 @@
- + {{if $field.3}} {{$field.3 nofilter}} {{/if}} From 9a0201e674e7cc091a0bb669377e2b7003479eef Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 07:39:42 +0200 Subject: [PATCH 2/3] require a note to the admin when register policy is set to needs approval --- src/Module/Register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Register.php b/src/Module/Register.php index 217581b160..d02a34a0b5 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -114,7 +114,7 @@ class Register extends BaseModule $o = Renderer::replaceMacros($tpl, [ '$invitations' => Config::get('system', 'invitation_only'), '$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE, - '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')], + '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), "required"], '$invite_desc' => L10n::t('Membership on this site is by invitation only.'), '$invite_label' => L10n::t('Your invitation code: '), '$invite_id' => $invite_id, From 92ee30959189a375ea32bccea674578b90ffe44d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 2 Oct 2019 08:28:12 +0200 Subject: [PATCH 3/3] quotes --- src/Module/Register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Register.php b/src/Module/Register.php index d02a34a0b5..1637e0d8b6 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -114,7 +114,7 @@ class Register extends BaseModule $o = Renderer::replaceMacros($tpl, [ '$invitations' => Config::get('system', 'invitation_only'), '$permonly' => intval(Config::get('config', 'register_policy')) === self::APPROVE, - '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), "required"], + '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), 'required'], '$invite_desc' => L10n::t('Membership on this site is by invitation only.'), '$invite_label' => L10n::t('Your invitation code: '), '$invite_id' => $invite_id,