mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Only show required fields
This commit is contained in:
parent
8b6060a899
commit
83a1f5c54b
@ -15,69 +15,13 @@
|
||||
|
||||
<div class="grid grid-cols-12 gap-4 mt-10">
|
||||
@foreach($company->client_registration_fields as $field)
|
||||
<div class="col-span-12 md:col-span-6">
|
||||
<section class="flex items-center">
|
||||
<label
|
||||
for="{{ $field['key'] }}"
|
||||
class="input-label">
|
||||
{{ ctrans("texts.{$field['key']}") }}
|
||||
</label>
|
||||
|
||||
@if($field['required'])
|
||||
<section class="text-red-400 ml-1 text-sm">*</section>
|
||||
@endif
|
||||
</section>
|
||||
|
||||
@if($field['key'] === 'email')
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
type="email"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@elseif($field['key'] === 'password')
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
type="password"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@elseif($field['key'] === 'country_id')
|
||||
<select
|
||||
id="shipping_country"
|
||||
class="input w-full form-select"
|
||||
name="shipping_country">
|
||||
<option value="none"></option>
|
||||
@foreach(App\Utils\TranslationHelper::getCountries() as $country)
|
||||
<option
|
||||
{{ $country == isset(auth()->user()->client->shipping_country->id) ? 'selected' : null }} value="{{ $country->id }}">
|
||||
{{ $country->iso_3166_2 }}
|
||||
({{ $country->name }})
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@endif
|
||||
|
||||
@error($field['key'])
|
||||
<div class="validation validation-fail">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if($field['key'] === 'password')
|
||||
@if($field['required'])
|
||||
<div class="col-span-12 md:col-span-6">
|
||||
<section class="flex items-center">
|
||||
<label
|
||||
for="password_confirmation"
|
||||
for="{{ $field['key'] }}"
|
||||
class="input-label">
|
||||
{{ ctrans('texts.password_confirmation') }}
|
||||
{{ ctrans("texts.{$field['key']}") }}
|
||||
</label>
|
||||
|
||||
@if($field['required'])
|
||||
@ -85,13 +29,71 @@
|
||||
@endif
|
||||
</section>
|
||||
|
||||
<input
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
class="input w-full"
|
||||
name="password_confirmation"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@if($field['key'] === 'email')
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
type="email"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@elseif($field['key'] === 'password')
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
type="password"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@elseif($field['key'] === 'country_id')
|
||||
<select
|
||||
id="shipping_country"
|
||||
class="input w-full form-select"
|
||||
name="shipping_country">
|
||||
<option value="none"></option>
|
||||
@foreach(App\Utils\TranslationHelper::getCountries() as $country)
|
||||
<option
|
||||
{{ $country == isset(auth()->user()->client->shipping_country->id) ? 'selected' : null }} value="{{ $country->id }}">
|
||||
{{ $country->iso_3166_2 }}
|
||||
({{ $country->name }})
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input
|
||||
id="{{ $field['key'] }}"
|
||||
class="input w-full"
|
||||
name="{{ $field['key'] }}"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
@endif
|
||||
|
||||
@error($field['key'])
|
||||
<div class="validation validation-fail">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if($field['key'] === 'password')
|
||||
<div class="col-span-12 md:col-span-6">
|
||||
<section class="flex items-center">
|
||||
<label
|
||||
for="password_confirmation"
|
||||
class="input-label">
|
||||
{{ ctrans('texts.password_confirmation') }}
|
||||
</label>
|
||||
|
||||
@if($field['required'])
|
||||
<section class="text-red-400 ml-1 text-sm">*</section>
|
||||
@endif
|
||||
</section>
|
||||
|
||||
<input
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
class="input w-full"
|
||||
name="password_confirmation"
|
||||
{{ $field['required'] ? 'required' : '' }} />
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user