Merge pull request #6146 from beganovich/v5-2806-client-portal

(v5) Client portal changes
This commit is contained in:
Benjamin Beganović 2021-06-28 12:50:10 +02:00 committed by GitHub
commit fcffa72568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 11 deletions

View File

@ -27,17 +27,23 @@ class RegisterRequest extends FormRequest
*/ */
public function rules() public function rules()
{ {
return [ $rules = [
'first_name' => ['required', 'string', 'max:255'], 'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'], 'last_name' => ['required', 'string', 'max:255'],
'phone' => ['required', 'string', 'max:255'], 'phone' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email:rfc,dns', 'max:255'], 'email' => ['required', 'string', 'email:rfc,dns', 'max:255'],
'password' => ['required', 'string', 'min:6', 'confirmed'], '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() public function company()
{ {
//this should be all we need, the rest SHOULD be redundant because of our Middleware //this should be all we need, the rest SHOULD be redundant because of our Middleware
if ($this->key) if ($this->key)
@ -59,7 +65,7 @@ class RegisterRequest extends FormRequest
if (Ninja::isHosted()) { if (Ninja::isHosted()) {
$subdomain = explode('.', $this->getHost())[0]; $subdomain = explode('.', $this->getHost())[0];
$query = [ $query = [
'subdomain' => $subdomain, 'subdomain' => $subdomain,
'portal_mode' => 'subdomain', 'portal_mode' => 'subdomain',
@ -67,7 +73,7 @@ class RegisterRequest extends FormRequest
if($company = MultiDB::findAndSetDbByDomain($query)) if($company = MultiDB::findAndSetDbByDomain($query))
return $company; return $company;
$query = [ $query = [
'portal_domain' => $this->getSchemeAndHttpHost(), 'portal_domain' => $this->getSchemeAndHttpHost(),
'portal_mode' => 'domain', 'portal_mode' => 'domain',

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"/js/app.js": "/js/app.js?id=696e8203d5e8e7cf5ff5", "/js/app.js": "/js/app.js?id=696e8203d5e8e7cf5ff5",
"/css/app.css": "/css/app.css?id=d9b987796d537e68bee7", "/css/app.css": "/css/app.css?id=9d6698418e6cdd571d49",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4", "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1",
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=0dc8c34010d09195d2f7", "/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=0dc8c34010d09195d2f7",

View File

@ -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> <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"> <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">
@ -20,11 +21,11 @@
{{ $title }} {{ $title }}
</h3> </h3>
<div class="mt-2"> <div class="mt-2">
<p class="text-sm leading-5 text-gray-500"> <p class="text-sm leading-5 text-gray-500 h-64 overflow-y-scroll">
{{ $content }} {{ $content }}
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -28,11 +28,15 @@
<input type="checkbox" name="terms" class="form-checkbox mr-2 cursor-pointer" checked> <input type="checkbox" name="terms" class="form-checkbox mr-2 cursor-pointer" checked>
<span class="text-sm text-gray-800"> <span class="text-sm text-gray-800">
{{ ctrans('texts.i_agree') }} {{ ctrans('texts.i_agree_to_the') }}
@endif @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_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]) @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>
</span> </span>

View File

@ -9,7 +9,7 @@
<h3 class="text-xl leading-6 font-medium text-gray-900"> <h3 class="text-xl leading-6 font-medium text-gray-900">
{{ ctrans('texts.terms') }} {{ ctrans('texts.terms') }}
</h3> </h3>
<div class="mt-4"> <div class="mt-4 h-64 overflow-y-scroll">
@foreach($entities as $entity) @foreach($entities as $entity)
<div class="mb-4"> <div class="mb-4">
<p class="text-sm leading-6 font-medium text-gray-500">{{ $entity_type }} {{ $entity->number }}:</p> <p class="text-sm leading-6 font-medium text-gray-500">{{ $entity_type }} {{ $entity->number }}:</p>