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'),
|
'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')
|
@extends('layouts.default')
|
||||||
@section('title', 'bookmarks')
|
@section('title', 'bookmarks')
|
||||||
@section('description', 'This is the personal homepage of floppydisk.')
|
@section('description', 'This is the personal homepage of floppydisk.')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@php
|
||||||
|
$categories = DB::select('
|
||||||
|
SELECT id, name
|
||||||
|
FROM bookmark_categories
|
||||||
|
ORDER BY priority ASC
|
||||||
|
');
|
||||||
|
@endphp
|
||||||
|
|
||||||
@foreach ($categories as $category)
|
@foreach ($categories as $category)
|
||||||
<h1>{{ $category['name'] }}</h1>
|
<h1>{{ $category->name }}</h1>
|
||||||
<ul>
|
@php
|
||||||
@foreach ($category['bookmarks'] as $bookmark)
|
$sites = DB::select('
|
||||||
<li><a href="{{ $bookmark['url'] }}">{{ $bookmark['name'] }}</a> - {{ $bookmark['description'] }}</li>
|
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
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
Loading…
Reference in a new issue