From b5a0f58afd49d30025e4fa2e61503a21d6ff2938 Mon Sep 17 00:00:00 2001 From: Dominic Ferrando Date: Thu, 24 Apr 2025 19:14:27 -0400 Subject: [PATCH] Lock and pin icons --- web/static/index.css | 30 ++++++++++++++++++++++++++++++ web/static/media/icons/lock.svg | 2 ++ web/static/media/icons/pin.svg | 7 +++++++ web/views/board.templ | 20 ++++++++++++-------- web/views/thread.templ | 8 ++++++++ 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 web/static/media/icons/lock.svg create mode 100644 web/static/media/icons/pin.svg diff --git a/web/static/index.css b/web/static/index.css index be70867..4570100 100644 --- a/web/static/index.css +++ b/web/static/index.css @@ -201,6 +201,26 @@ body { margin: 2rem; } +.thread-title { + position: relative; + display: inline-block; + font-size: 14px; + font-weight: bold; +} + +.thread-icons { + position: absolute; + right: 100%; + margin-right: 6px; + top: 50%; + transform: translateY(-50%); + display: flex; +} + +.thread-icons .icon { + margin-left: 2px; +} + .thread-subject { font-weight: bold; color: var(--link-primary); @@ -409,6 +429,16 @@ body { color: var(--danger); } +.icon { + width: 12px; + height: 12px; + vertical-align: middle; +} + +.icon:not(:last-child) { + margin-right: 2px; +} + hr { border: none; border-top: 1px solid var(--border-light); diff --git a/web/static/media/icons/lock.svg b/web/static/media/icons/lock.svg new file mode 100644 index 0000000..4dcbe6a --- /dev/null +++ b/web/static/media/icons/lock.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/web/static/media/icons/pin.svg b/web/static/media/icons/pin.svg new file mode 100644 index 0000000..c17635f --- /dev/null +++ b/web/static/media/icons/pin.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/web/views/board.templ b/web/views/board.templ index 7b46e54..c983552 100644 --- a/web/views/board.templ +++ b/web/views/board.templ @@ -95,14 +95,18 @@ templ ThreadsCatalog(previews []CatalogThreadPreview, catalogContext CatalogCont } -

- { preview.Subject } - if preview.Locked { - Locked - } - if preview.Pinned { - Pinned - } +

+ + if preview.Locked { + Locked + } + if preview.Pinned { + Pinned + } + + + { preview.Subject } +

@templ.Raw(util.EnrichPost(preview.Body)) diff --git a/web/views/thread.templ b/web/views/thread.templ index 4927a60..831629d 100644 --- a/web/views/thread.templ +++ b/web/views/thread.templ @@ -93,6 +93,14 @@ templ PostOriginal(post database.Post, thread database.Thread) { />

+ + if thread.Locked { + Locked + } + if thread.Pinned { + Pinned + } +

{ thread.Subject } -