Update settings sidebar

This commit is contained in:
Daniel Supernault 2024-01-11 02:34:43 -07:00
parent 319a20b473
commit 5f6ed85770
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
3 changed files with 262 additions and 288 deletions

View file

@ -173,7 +173,8 @@ trait HomeSettings
$user->email = $email;
if ($validate) {
$user->email_verified_at = null;
// auto verify admin email addresses
$user->email_verified_at = $user->is_admin == true ? now() : null;
// Prevent old verifications from working
EmailVerification::whereUserId($user->id)->delete();
}
@ -195,7 +196,7 @@ trait HomeSettings
$user->save();
$profile->save();
return redirect('/settings/home')->with('status', 'Email successfully updated!');
return redirect('/settings/email')->with('status', 'Email successfully updated!');
} else {
return redirect('/settings/email');
}
@ -206,5 +207,4 @@ trait HomeSettings
{
return view('settings.avatar');
}
}

View file

@ -1,33 +1,14 @@
@extends('layouts.app')
@extends('settings.template')
@section('content')
@if (session('status'))
<div class="alert alert-primary px-3 h6 text-center">
{{ session('status') }}
</div>
@endif
@if ($errors->any())
<div class="alert alert-danger px-3 h6 text-center">
@foreach($errors->all() as $error)
<p class="font-weight-bold mb-1">{{ $error }}</p>
@endforeach
</div>
@endif
@if (session('error'))
<div class="alert alert-danger px-3 h6 text-center">
{{ session('error') }}
</div>
@endif
@section('section')
<div class="container">
<div class="col-12">
<div class="card shadow-none border mt-5">
<div class="card-body">
<div class="row">
<div class="col-12 p-3 p-md-5">
<div class="title">
<h3 class="font-weight-bold">Email Settings</h3>
<div class="d-flex justify-content-between align-items-center">
<div class="title d-flex align-items-center" style="gap: 1rem;">
<p class="mb-0"><a href="/settings/home"><i class="far fa-chevron-left fa-lg"></i></a></p>
<h3 class="font-weight-bold mb-0">Email Settings</h3>
</div>
</div>
<hr>
<form method="post" action="{{route('settings.email')}}">
@csrf
@ -52,12 +33,4 @@
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View file

@ -9,11 +9,11 @@
<li class="nav-item pl-3 {{request()->is('settings/email')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.email')}}">Email</a>
</li>
@if(config('pixelfed.user_invites.enabled'))
{{-- @if(config('pixelfed.user_invites.enabled'))
<li class="nav-item pl-3 {{request()->is('settings/invites*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.invites')}}">Invites</a>
</li>
@endif
@endif --}}
<li class="nav-item pl-3 {{request()->is('settings/media*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.media')}}">Media</a>
</li>
@ -38,17 +38,8 @@
<li class="nav-item">
<hr>
</li>
<li class="nav-item pl-3 {{request()->is('*import*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.import')}}">Import</a>
</li>
<li class="nav-item pl-3 {{request()->is('settings/data-export')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Export</a>
</li>
@if(config_cache('pixelfed.oauth_enabled') == true)
<li class="nav-item">
<hr>
</li>
<li class="nav-item pl-3 {{request()->is('settings/applications')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.applications')}}">Applications</a>
</li>
@ -57,12 +48,22 @@
</li>
@endif
<li class="nav-item">
<hr>
<li class="nav-item pl-3 {{request()->is('*import*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.import')}}">Import</a>
</li>
<li class="nav-item pl-3 {{request()->is('settings/data-export')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.dataexport')}}">Export</a>
</li>
<li class="nav-item pl-3 {{request()->is('settings/labs*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.labs')}}">Labs</a>
</li>
@if(config('instance.parental_controls.enabled'))
<li class="nav-item pl-3 {{request()->is('settings/parental-controls*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.parental-controls')}}">Parental Controls</a>
</li>
@endif
</ul>
</div>