From 7c16dc53b55aa50d6c9ac0bdea2f51fbbf2b20b0 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Sun, 16 Jul 2023 21:02:51 +0100 Subject: feat: site admin (#8) --- .../pages/admin/guestbook-del-confirm.blade.php | 33 ++++++++++++++++++++++ resources/views/pages/admin/guestbook.blade.php | 27 ++++++++++++++++++ resources/views/pages/admin/index.blade.php | 9 ++++++ 3 files changed, 69 insertions(+) create mode 100644 resources/views/pages/admin/guestbook-del-confirm.blade.php create mode 100644 resources/views/pages/admin/guestbook.blade.php create mode 100644 resources/views/pages/admin/index.blade.php (limited to 'resources/views/pages') diff --git a/resources/views/pages/admin/guestbook-del-confirm.blade.php b/resources/views/pages/admin/guestbook-del-confirm.blade.php new file mode 100644 index 0000000..99d2a4c --- /dev/null +++ b/resources/views/pages/admin/guestbook-del-confirm.blade.php @@ -0,0 +1,33 @@ +@extends('layouts.minimal') +@section('title', 'Delete confirm') +@section('content') +

Delete Confirmation

+
+

Are you sure you want to delete this entry?

+ +

Entry Details:

+ + + + + + + + + + + + + + + + + +
ID:{{ $entry->id }}
Name:{{ $entry->name }}
Date:{{ gmdate("H:i:s - Y-m-d", $entry->timestamp) }}
Message:{{ $entry->message }}
+ +
+ @csrf + + +
+@stop diff --git a/resources/views/pages/admin/guestbook.blade.php b/resources/views/pages/admin/guestbook.blade.php new file mode 100644 index 0000000..56323ef --- /dev/null +++ b/resources/views/pages/admin/guestbook.blade.php @@ -0,0 +1,27 @@ +@extends('layouts.default-admin') +@section('title', 'guestbook') +@section('content') + @php + $entries = DB::select('SELECT id, name, timestamp, message FROM guestbook_entries ORDER BY id DESC'); + @endphp +

Entries ({{ count($entries) }} total)

+ @foreach ($entries as $entry) + + + + + + + +
+ Name: {{ $entry->name }}
+ Date: {{ gmdate("H:i:s - Y-m-d", $entry->timestamp) }} +
+ del +
+
+ {{ htmlspecialchars($entry->message) }} +
+ @endforeach +@stop + diff --git a/resources/views/pages/admin/index.blade.php b/resources/views/pages/admin/index.blade.php new file mode 100644 index 0000000..fd34313 --- /dev/null +++ b/resources/views/pages/admin/index.blade.php @@ -0,0 +1,9 @@ +@extends('layouts.default-admin') +@section('title', 'Page Title') +@section('description', 'Page description goes here') +@php + $user = auth()->user(); +@endphp +@section('content') +

You are logged in as {{ $user->name }} ({{ $user->email }})

+@stop -- cgit v1.2.3-54-g00ecf