Tweak admin alert on blog post delete
This commit is contained in:
parent
7a4d7aa7ca
commit
60b4cdd8e9
@ -14,8 +14,8 @@
|
||||
@markdown($post->body)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="col align-self-center text-muted">
|
||||
<div class="row align-items-center">
|
||||
<span class="col-6 text-muted">
|
||||
Created: {{ $post->created_at }}
|
||||
@if ($post->created_at->diffInSeconds($post->updated_at) > 1)
|
||||
| Last updated: {{ $post->updated_at }}
|
||||
@ -23,7 +23,7 @@
|
||||
</span>
|
||||
|
||||
@can('delete', $post)
|
||||
<span class="col align-self-center text-right">
|
||||
<span class="col-6 text-right">
|
||||
<form action="{{ route('posts.delete', $post->id) }}" method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
@ -36,9 +36,13 @@
|
||||
|
||||
@auth
|
||||
@if (Auth::admin() && Auth::id() !== $user->id)
|
||||
<!-- TODO: Fix design -->
|
||||
<div class="col alert alert-danger">
|
||||
<i class="fas fa-exclamation-triangle fa-fw"></i> Be careful! You have permissions to delete all blog posts, so keep that in mind before clicking on buttons.
|
||||
<div class="row">
|
||||
<span class="col align-self-end">
|
||||
<div class="alert alert-danger">
|
||||
<i class="fas fa-exclamation-triangle fa-fw"></i>
|
||||
Warning! This blog post belongs to <strong>{{ $user->name }}</strong>.
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
|
@ -4,7 +4,26 @@
|
||||
<div class="container">
|
||||
<div class="text-center">
|
||||
<h1>Welcome to the {{ env('APP_NAME', 'Hovedprosjekt') }} homepage!</h1>
|
||||
<img src="/media/finsrud.png" alt="GASP">
|
||||
<img src="/media/finsrud.png" title="Øyvind Finsrud - Circa 2010">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<h2 class="text-center">Check out our users and their blog posts!</h2>
|
||||
<div class="list-group">
|
||||
@foreach (App\User::all() as $user)
|
||||
@if ($user->posts->isEmpty())
|
||||
@continue
|
||||
@endif
|
||||
|
||||
<div class="list-group-item">
|
||||
<i class="fas fa-user fa-fw"></i>
|
||||
<a href="{{ route('posts.index', $user->username) }}">
|
||||
{{ $user->name }} ({{$user->username}})
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user