aboutsummaryrefslogtreecommitdiff
path: root/resources/views/pages/bookmarks.blade.php
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2023-07-19 01:50:07 +0100
committerGitHub <noreply@github.com>2023-07-19 01:50:07 +0100
commitfb045348cf4c72a2f523b6a0ce360b40d4d60ff3 (patch)
tree81c8c5353e6e5d11de13a04a5dfc3cd7ca3d718f /resources/views/pages/bookmarks.blade.php
parente627033600a5f6222c076d4e4265646b0f070877 (diff)
feat: move bookmarks to database (#9)
* Move bookmarks to SQL DB * Increment version
Diffstat (limited to 'resources/views/pages/bookmarks.blade.php')
-rw-r--r--resources/views/pages/bookmarks.blade.php24
1 files changed, 19 insertions, 5 deletions
diff --git a/resources/views/pages/bookmarks.blade.php b/resources/views/pages/bookmarks.blade.php
index 331d9fb..16d07cc 100644
--- a/resources/views/pages/bookmarks.blade.php
+++ b/resources/views/pages/bookmarks.blade.php
@@ -1,13 +1,27 @@
-<?php $categories = app('config')->get('bookmarks'); ?>
@extends('layouts.default')
@section('title', 'bookmarks')
@section('description', 'This is the personal homepage of floppydisk.')
@section('content')
+@php
+ $categories = DB::select('
+ SELECT id, name
+ FROM bookmark_categories
+ ORDER BY priority ASC
+ ');
+@endphp
+
@foreach ($categories as $category)
- <h1>{{ $category['name'] }}</h1>
- <ul>
- @foreach ($category['bookmarks'] as $bookmark)
- <li><a href="{{ $bookmark['url'] }}">{{ $bookmark['name'] }}</a> - {{ $bookmark['description'] }}</li>
+ <h1>{{ $category->name }}</h1>
+ @php
+ $sites = DB::select('
+ SELECT name, url, description
+ FROM bookmark_sites
+ WHERE category_id = ? ORDER BY priority ASC
+ ', array($category->id));
+ @endphp
+ <ul>
+ @foreach ($sites as $site)
+ <li><a href="{{ $site->url }}">{{ $site->name }}</a> - {{ $site->description }}</li>
@endforeach
</ul>
@endforeach