From c4e85e6734e9a86f3c6edb3d141c44614ec64c54 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 25 May 2024 12:31:48 -0400 Subject: [PATCH] Link name to bookmarked page (#14) - Tweak CSS --- src/public/assets/style.css | 6 ++---- src/public/index.php | 11 ++++++----- src/start.php | 23 ++++++++++------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/public/assets/style.css b/src/public/assets/style.css index da1fefa..f12b9bd 100644 --- a/src/public/assets/style.css +++ b/src/public/assets/style.css @@ -97,8 +97,6 @@ article { img { max-width: 100%; object-fit: contain; - height: unset; - width: unset; } } @@ -159,13 +157,13 @@ p.back-link { &.add { background-color: lightgray; - :hover { + &:hover { background: linear-gradient(lightgreen, gray); } } &.remove { background: linear-gradient(lightgreen, green); - :hover { + &:hover { background: linear-gradient(gray, lightgreen); } } diff --git a/src/public/index.php b/src/public/index.php index ea5cca3..a1df915 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -2,7 +2,7 @@ /** * Home Page * - * Displays a list of unread feed items for the current user + * Displays a list of unread or bookmarked items for the current user */ include '../start.php'; @@ -46,17 +46,18 @@ $item = $result ? $result->fetchArray(SQLITE3_ASSOC) : false; page_head($title); ?>

  - (Refresh All Feeds) + if ($type == 'Unread'): ?>   + Refreshing… + endif; ?>


• - + fetchArray(SQLITE3_ASSOC); } } else { ?> diff --git a/src/start.php b/src/start.php index 9010241..f0fa0f0 100644 --- a/src/start.php +++ b/src/start.php @@ -64,20 +64,19 @@ function title_bar(): void { WHERE feed.user_id = :id AND item.is_bookmarked = 1) SQL); $bookQuery->bindValue(':id', $_SESSION[Key::USER_ID]); - $bookResult = $bookQuery->execute(); - $hasBookmarks = $bookResult ? $bookResult->fetchArray(SQLITE3_NUM)[0] : false; ?> - | - - | - Log Off - | execute(); + $hasBookmarks = $bookResult && $bookResult->fetchArray(SQLITE3_NUM)[0]; + echo hx_get('/feeds', 'Feeds') . ' | '; + if ($hasBookmarks) echo hx_get('/?bookmarked', 'Bookmarked') . ' | '; + echo hx_get('/docs/', 'Docs') . ' | Log Off'; + if ($_SESSION[Key::USER_EMAIL] != Security::SINGLE_USER_EMAIL) { + echo " | {$_SESSION[Key::USER_EMAIL]}"; } } finally { $db->close(); } - } else { ?> - | @@ -122,9 +121,7 @@ function page_head(string $title): void { function page_foot(): void { global $is_htmx; ?> - + if (!$is_htmx) echo ''; ?>