Merge pull request #7692 from tobiasd/20191002-issue7688

add option 'require' for textarea form elements
Este commit está contenido en:
Philipp 2019-10-02 08:40:03 +02:00 cometido por GitHub
commit 2a2c9a97dc
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 3 ficheros con 3 adiciones y 2 borrados

Ver fichero

@ -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

Ver fichero

@ -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,

Ver fichero

@ -1,7 +1,7 @@
<div class="field textarea">
<label for="id_{{$field.0}}">{{$field.1}}</label>
<textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
<textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip"{{if $field.4 eq 'required'}} required{{/if}}>{{$field.2}}</textarea>
{{if $field.3}}
<span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
{{/if}}