osb/resources/views/theme/backend/adminlte/user/settings.blade.php
Deon George b1067e1378
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m14s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Added Passkey login, fixed password reset as a result of updating laravel
2024-07-23 00:13:54 +10:00

126 lines
4.2 KiB
PHP

@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ ($o??$user)->role }} Settings
@endsection
@section('page_title')
{{ ($o??$user)->name_full }}
@endsection
@section('contentheader_title')
{{ ($o??$user)->name_full }}
@endsection
@section('contentheader_description')
{{ ($o??$user)->role }}
@endsection
@use(App\Models\Country)
<!-- ($o??$user)=User::class -->
@section('main-content')
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<div class="card-title">Update Settings</div>
@session('success')<x-leenooks::success class="float-right">{{ $value }}</x-leenooks::success>@endsession
</div>
<form method="POST" action="{{ url(request()->path(),[($o??$user)->id]) }}">
@csrf
<div class="card-body">
<div class="row">
<div class="col-12 col-sm-6">
<div class="row">
<div class="col">
<x-leenooks::form.email id="email" name="email" icon="fa-at" label="Email" :value="($o??$user)->email ?? ''"/>
</div>
</div>
<div class="row">
<div class="col">
<x-leenooks::form.password id="password" name="password" icon="fa-lock" label="Password"/>
</div>
</div>
<div class="row">
<div class="col">
<x-leenooks::form.password id="password_confirm" name="password_confirmation" icon="fa-lock" label="Password Confirm"/>
</div>
</div>
<div class="row">
<div class="col pb-3">
<button type="reset" id="passkey" name="passkey" @class(['btn','btn-success'=>$x=($o??$user)->passkey,'btn-outline-secondary'=>! $x])><i class="fas fa-fw fa-key"></i> Passkey</button>
</div>
</div>
</div>
<div class="col-12 col-sm-6">
<div class="row">
<div class="col-12 col-md-6">
<x-leenooks::form.text name="firstname" icon="fa-headset" label="First Name" :value="($o??$user)->firstname ?? ''"/>
</div>
<div class="col-12 col-md-6">
<x-leenooks::form.text name="lastname" icon="fa-signature" label="Last Name" :value="($o??$user)->lastname ?? ''"/>
</div>
</div>
<div class="row">
<div class="col">
<x-leenooks::form.text name="address1" icon="fa-map" label="Address" :value="($o??$user)->address1 ?? ''"/>
</div>
</div>
<div class="row">
<div class="col">
<x-leenooks::form.text name="address2" :value="($o??$user)->address2 ?? ''"/>
</div>
</div>
<div class="row">
<div class="col-12 col-md-4">
<x-leenooks::form.text name="city" label="City" :value="($o??$user)->city ?? ''"/>
</div>
<div class="col-12 col-md-4">
<x-leenooks::form.text name="state" label="State" :value="($o??$user)->state ?? ''"/>
</div>
<div class="col-12 col-md-4">
<x-leenooks::form.text name="postcode" label="Post Code" :value="($o??$user)->postcode ?? ''"/>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<x-leenooks::form.select id="country" name="country_id" icon="fa-globe" label="Country" :value="($o??$user)->country_id ?? ''" :options="Country::select(['id','name'])->active()->get()->map(function($item) { $item->value = $item->name; return $item; })->toArray()"/>
</div>
</div>
</div>
</div>
<div class="row pt-3">
<div class="col">
<button type="reset" name="cancel" class="btn btn-danger">Cancel</button>
<button type="submit" name="submit" class="btn btn-success float-right">Save</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('page-scripts')
<!-- Passkeys -->
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
<script type="text/javascript">
$(document).ready(function() {
$('#passkey').on('click',function(item) {
return passkey_create($(this),'{{ csrf_token() }}','fa-key','{{ ($o??$user)->passkey ? 'btn-success' : 'btn-outline-secondary' }}','btn-success','{{ ($o??$user)->passkey ? 'btn-secondary' : 'btn-outline-secondary' }}');
});
});
</script>
@append