mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:14:28 -04:00
Make terms/privacy policy checkbox required if fields are present
This commit is contained in:
parent
003d1fb143
commit
77513de2a5
@ -27,13 +27,19 @@ class RegisterRequest extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
$rules = [
|
||||
'first_name' => ['required', 'string', 'max:255'],
|
||||
'last_name' => ['required', 'string', 'max:255'],
|
||||
'phone' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email:rfc,dns', 'max:255'],
|
||||
'password' => ['required', 'string', 'min:6', 'confirmed'],
|
||||
];
|
||||
|
||||
if ($this->company()->settings->client_portal_terms || $this->company()->settings->client_portal_privacy_policy) {
|
||||
$rules['terms'] = ['required'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function company()
|
||||
|
@ -1,4 +1,5 @@
|
||||
<a class="button-link" x-on:click="{{ $property }} = true" href="#">{{ ctrans("texts.$property") }}</a>
|
||||
<a class="button-link underline" x-on:click="{{ $property }} = true" href="#">{{ ctrans("texts.$property") }}</a>
|
||||
|
||||
<span class="text-gray-300">/</span>
|
||||
|
||||
<div x-show="{{ $property }}" class="fixed bottom-0 inset-x-0 px-4 pb-4 sm:inset-0 sm:flex sm:items-center sm:justify-center">
|
||||
|
@ -28,11 +28,15 @@
|
||||
<input type="checkbox" name="terms" class="form-checkbox mr-2 cursor-pointer" checked>
|
||||
<span class="text-sm text-gray-800">
|
||||
|
||||
{{ ctrans('texts.i_agree') }}
|
||||
{{ ctrans('texts.i_agree_to_the') }}
|
||||
@endif
|
||||
|
||||
@includeWhen(!empty($company->settings->client_portal_terms), 'portal.ninja2020.auth.includes.register.popup', ['property' => 'terms_of_service', 'title' => ctrans('texts.terms_of_service'), 'content' => $company->settings->client_portal_terms])
|
||||
@includeWhen(!empty($company->settings->client_portal_privacy_policy), 'portal.ninja2020.auth.includes.register.popup', ['property' => 'privacy_policy', 'title' => ctrans('texts.privacy_policy'), 'content' => $company->settings->client_portal_privacy_policy])
|
||||
|
||||
@error('terms')
|
||||
<p class="text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user