feat: move bookmarks to database (#9)
* Move bookmarks to SQL DB * Increment version
This commit is contained in:
parent
e627033600
commit
fb045348cf
2 changed files with 20 additions and 6 deletions
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'diskfloppy.me'),
|
||||
'version' => '5.4.5',
|
||||
'version' => '5.4.6',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -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>
|
||||
<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 ($category['bookmarks'] as $bookmark)
|
||||
<li><a href="{{ $bookmark['url'] }}">{{ $bookmark['name'] }}</a> - {{ $bookmark['description'] }}</li>
|
||||
@foreach ($sites as $site)
|
||||
<li><a href="{{ $site->url }}">{{ $site->name }}</a> - {{ $site->description }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endforeach
|
||||
|
|
Loading…
Reference in a new issue