diskfloppy.me/resources/views/pages/bookmarks.blade.php

53 lines
1.3 KiB
PHP
Raw Normal View History

2023-06-13 22:50:07 +00:00
@extends('layouts.default')
2023-07-25 23:08:58 +00:00
@section('title', 'Bookmarks')
2023-06-13 22:50:07 +00:00
@section('description', 'This is the personal homepage of floppydisk.')
@section('content')
2023-07-25 23:08:58 +00:00
@php
$db_alive = true;
try {
DB::connection()->getPdo();
} catch (Exception $e) {
$db_alive = false;
}
@endphp
@if (!$db_alive)
@include('components.errors.db-error')
@else
@php
$categories = DB::select('
SELECT id, name
2023-07-19 00:58:32 +00:00
FROM bookmark__categories
ORDER BY priority ASC
');
2023-07-25 23:08:58 +00:00
@endphp
2023-07-25 23:08:58 +00:00
@foreach ($categories as $category)
2023-10-15 19:52:32 +00:00
<table class="info-table" role="presentation">
2023-07-25 23:08:58 +00:00
2023-08-14 23:13:53 +00:00
<caption>
2023-10-15 19:52:32 +00:00
<h2>{{ $category->name }}</h2>
2023-08-14 23:13:53 +00:00
<hr>
</caption>
2023-07-25 23:08:58 +00:00
@php
$sites = DB::select(
'
SELECT name, url, description
2023-07-19 00:58:32 +00:00
FROM bookmark__sites
WHERE category_id = ? ORDER BY priority ASC
2023-07-25 23:08:58 +00:00
',
[$category->id],
);
@endphp
@foreach ($sites as $site)
<tr>
<td><a href="{{ $site->url }}">{{ $site->name }}</a>
- {{ $site->description }}</td>
</tr>
@endforeach
</table>
<br>
2023-06-13 22:50:07 +00:00
@endforeach
@endif
2023-06-13 22:50:07 +00:00
@stop