Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Form::textarea to blade component #16075

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions resources/views/blade/input/textarea.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@props([
'value' => '',
'cols' => 50,
'rows' => 10,
])

<textarea
{{ $attributes->merge(['class' => 'form-control']) }}
cols="{{ $cols }}"
rows="{{ $rows }}"
>{{ $value }}</textarea>
8 changes: 7 additions & 1 deletion resources/views/custom_fields/fields/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@
{{ trans('admin/custom_fields/general.field_values') }}
</label>
<div class="col-md-8 required">
{!! Form::textarea('field_values', old('name', $field->field_values), ['style' => 'width: 100%', 'rows' => 4, 'class' => 'form-control', 'aria-label'=>'field_values']) !!}
<x-input.textarea
name="field_values"
:value="old('field_values', $field->field_values)"
style="width: 100%"
rows="4"
aria-label="field_values"
/>
{!! $errors->first('field_values', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block">{{ trans('admin/custom_fields/general.field_values_help') }}</p>
</div>
Expand Down
7 changes: 6 additions & 1 deletion resources/views/livewire/category-edit-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<div class="form-group {{ $errors->has('eula_text') ? 'error' : '' }}">
<label for="eula_text" class="col-md-3 control-label">{{ trans('admin/categories/general.eula_text') }}</label>
<div class="col-md-7">
{{ Form::textarea('eula_text', null, ['wire:model.live' => 'eulaText', 'class' => 'form-control', 'aria-label'=>'eula_text', 'disabled' => $this->eulaTextDisabled]) }}
<x-input.textarea
name="eula_text"
wire:model.live="eulaText"
aria-label="eula_text"
:disabled="$this->eulaTextDisabled"
/>
<p class="help-block">{!! trans('admin/categories/general.eula_text_help') !!} </p>
<p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!} </p>
{!! $errors->first('eula_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
Expand Down
8 changes: 7 additions & 1 deletion resources/views/modals/upload-file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
</div>

<div class="col-md-12">
{{ Form::textarea('notes', old('notes', old('notes')), ['class' => 'form-control','placeholder' => 'Notes (Optional)', 'rows'=>3, 'aria-label' => 'file']) }}
<x-input.textarea
name="notes"
:value="old('notes')"
placeholder="Notes (Optional)"
rows="3"
aria-label="file"
/>
</div>
</div>

Expand Down
30 changes: 26 additions & 4 deletions resources/views/settings/branding.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,22 @@
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
{{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => 'Add your custom CSS','disabled'=>'disabled', 'aria-label'=>'custom_css')) }}
<x-input.textarea
name="custom_css"
:value="old('custom_css', $setting->custom_css)"
placeholder="Add your custom CSS"
aria-label="custom_css"
disabled
/>
{!! $errors->first('custom_css', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
@else
{{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => 'Add your custom CSS', 'aria-label'=>'custom_css')) }}
<x-input.textarea
name="custom_css"
:value="old('custom_css', $setting->custom_css)"
placeholder="Add your custom CSS"
aria-label="custom_css"
/>
{!! $errors->first('custom_css', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@endif
<p class="help-block">{!! trans('admin/settings/general.custom_css_help') !!}</p>
Expand Down Expand Up @@ -289,10 +300,21 @@
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
{{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control', 'rows' => '4', 'placeholder' => 'Optional footer text','disabled'=>'disabled')) }}
<x-input.textarea
name="footer_text"
:value="old('footer_text', $setting->footer_text)"
rows="4"
placeholder="Optional footer text"
disabled
/>
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
@else
{{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control','rows' => '4','placeholder' => 'Optional footer text')) }}
<x-input.textarea
name="footer_text"
:value="old('footer_text', $setting->footer_text)"
rows="4"
placeholder="Optional footer text"
/>
@endif
<p class="help-block">{!! trans('admin/settings/general.footer_text_help') !!}</p>
{!! $errors->first('footer_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
Expand Down
6 changes: 5 additions & 1 deletion resources/views/settings/general.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@
{{ Form::label('default_eula_text', trans('admin/settings/general.default_eula_text')) }}
</div>
<div class="col-md-9">
{{ Form::textarea('default_eula_text', old('default_eula_text', $setting->default_eula_text), array('class' => 'form-control','placeholder' => 'Add your default EULA text')) }}
<x-input.textarea
name="default_eula_text"
:value="old('default_eula_text', $setting->default_eula_text)"
placeholder="Add your default EULA text"
/>
{!! $errors->first('default_eula_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.default_eula_help_text') }}</p>
<p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!}</p>
Expand Down
12 changes: 10 additions & 2 deletions resources/views/settings/ldap.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@
{{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }}
</div>
<div class="col-md-8">
{{ Form::textarea('ldap_client_tls_key', old('ldap_client_tls_key', $setting->ldap_client_tls_key), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN RSA PRIVATE KEY-----'."\r\n1234567890\r\n-----END RSA PRIVATE KEY-----"]) }}
<x-input.textarea
name="ldap_client_tls_key"
value="{{ old('ldap_client_tls_key', $setting->ldap_client_tls_key) }}"
:placeholder="sprintf('%s-----BEGIN RSA PRIVATE KEY-----%s1234567890%s-----END RSA PRIVATE KEY-----', trans('general.example'), PHP_EOL, PHP_EOL)"
/>
@error('ldap_client_tls_key')
<span class="alert-msg">
<x-icon type="x" />
Expand All @@ -197,7 +201,11 @@
{{ Form::label('ldap_client_tls_cert', trans('admin/settings/general.ldap_client_tls_cert')) }}
</div>
<div class="col-md-8">
{{ Form::textarea('ldap_client_tls_cert', old('ldap_client_tls_cert', $setting->ldap_client_tls_cert), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN CERTIFICATE-----'."\r\n1234567890\r\n-----END CERTIFICATE-----"]) }}
<x-input.textarea
name="ldap_client_tls_cert"
value="{{ old('ldap_client_tls_cert', $setting->ldap_client_tls_cert) }}"
:placeholder="sprintf('%s-----BEGIN CERTIFICATE-----%s1234567890%s-----END CERTIFICATE-----', trans('general.example'), PHP_EOL, PHP_EOL)"
/>
<p class="help-block">{{ trans('admin/settings/general.ldap_client_tls_cert_help') }}</p>
@error('ldap_client_tls_cert')
<span class="alert-msg">
Expand Down
21 changes: 18 additions & 3 deletions resources/views/settings/saml.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@
<!-- SAML SP Certificate -->
@if (!empty($setting->saml_sp_x509cert))
{{ Form::label('saml_sp_x509cert', trans('admin/settings/general.saml_sp_x509cert')) }}
{{ Form::textarea('saml_sp_x509cert', $setting->saml_sp_x509cert, ['class' => 'form-control', 'wrap' => 'off', 'readonly']) }}
<x-input.textarea
name="saml_sp_x509cert"
:value="$setting->saml_sp_x509cert"
wrap="off"
readonly
/>
<br>
@endif
<!-- SAML SP Metadata URL -->
Expand All @@ -106,7 +111,12 @@
{{ Form::label('saml_idp_metadata', trans('admin/settings/general.saml_idp_metadata')) }}
</div>
<div class="col-md-9">
{{ Form::textarea('saml_idp_metadata', old('saml_idp_metadata', $setting->saml_idp_metadata), ['class' => 'form-control','placeholder' => 'https://example.com/idp/metadata', 'wrap' => 'off', $setting->demoMode]) }}
<x-input.textarea
name="saml_idp_metadata"
:value="old('saml_idp_metadata', $setting->saml_idp_metadata)"
placeholder="https://example.com/idp/metadata"
wrap="off"
/>
{!! $errors->first('saml_idp_metadata', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}<br>
<button type="button" class="btn btn-default" id="saml_idp_metadata_upload_btn" {{ $setting->demoMode }}>{{ trans('button.select_file') }}</button>
<input type="file" class="js-uploadFile" id="saml_idp_metadata_upload"
Expand Down Expand Up @@ -166,7 +176,12 @@
{{ Form::label('saml_custom_settings', trans('admin/settings/general.saml_custom_settings')) }}
</div>
<div class="col-md-9">
{{ Form::textarea('saml_custom_settings', old('saml_custom_settings', $setting->saml_custom_settings), ['class' => 'form-control','placeholder' => 'example.option=false&#13;&#10;sp_x509cert=file:///...&#13;&#10;sp_private_key=file:///', 'wrap' => 'off', $setting->demoMode]) }}
<x-input.textarea
name="saml_custom_settings"
:value="old('saml_custom_settings', $setting->saml_custom_settings)"
placeholder="example.option=false&#13;&#10;sp_x509cert=file:///...&#13;&#10;sp_private_key=file:///"
wrap="off"
/>
<p class="help-block">{{ trans('admin/settings/general.saml_custom_settings_help') }}</p>
{!! $errors->first('saml_custom_settings', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
Expand Down
Loading