Show register link on the login page

This commit is contained in:
Benjamin Beganović 2021-06-01 14:06:47 +02:00
parent 64830df3da
commit 23e23918b4
2 changed files with 28 additions and 13 deletions

View File

@ -15,6 +15,7 @@ use App\Events\Contact\ContactLoggedIn;
use App\Http\Controllers\Controller;
use App\Models\Account;
use App\Models\ClientContact;
use App\Models\Company;
use App\Utils\Ninja;
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
@ -34,11 +35,19 @@ class ContactLoginController extends Controller
public function showLoginForm(Request $request)
{
if ($request->subdomain) {
$company = Company::where('subdomain', $request->subdomain)->first();
} elseif (Ninja::isSelfHost()) {
$company = Account::first()->default_company;
} else {
$company = null;
}
$account_id = $request->get('account_id');
$account = Account::find($account_id);
return $this->render('auth.login', ['account' => $account]);
return $this->render('auth.login', ['account' => $account, 'company' => $company]);
}
public function login(Request $request)

View File

@ -9,20 +9,21 @@
@section('body')
<div class="grid lg:grid-cols-3">
@if($account && !$account->isPaid())
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="{{ asset('images/client-portal-new-image.jpg') }}"
class="w-full h-screen object-cover"
alt="Background image">
</div>
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="{{ asset('images/client-portal-new-image.jpg') }}"
class="w-full h-screen object-cover"
alt="Background image">
</div>
@endif
<div class="col-span-2 h-screen flex">
<div class="m-auto md:w-1/2 lg:w-1/4">
@if($account && !$account->isPaid())
<div>
<img src="{{ asset('images/invoiceninja-black-logo-2.png') }}" class="border-b border-gray-100 h-18 pb-4" alt="Invoice Ninja logo">
</div>
@endif
@if($account && !$account->isPaid())
<div>
<img src="{{ asset('images/invoiceninja-black-logo-2.png') }}"
class="border-b border-gray-100 h-18 pb-4" alt="Invoice Ninja logo">
</div>
@endif
<div class="flex flex-col">
<h1 class="text-center text-3xl">{{ ctrans('texts.client_portal') }}</h1>
@ -61,9 +62,14 @@
</button>
</div>
</form>
@if(!is_null($company) && $company->client_can_register)
<div class="mt-5 text-center">
<a class="button-link text-sm" href="{{ route('client.register') }}">{{ ctrans('texts.register_label') }}</a>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection