diff --git a/tinyweb_forum/handlers.py b/tinyweb_forum/handlers.py index c2678f9..7cb6b52 100644 --- a/tinyweb_forum/handlers.py +++ b/tinyweb_forum/handlers.py @@ -45,17 +45,18 @@ FORUM_CSS = """ .forum-form label.checkbox-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; } .forum-form label.inline-label { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; white-space: nowrap; } .forum-form small { display: block; margin-bottom: 8px; } -.forum-search { margin: 0.5rem 0; } -.forum-search form { display: block; } -.forum-search input[name=q] { - width: 100%; box-sizing: border-box; padding: 10px 12px; +.forum-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0.5rem 0; } +.forum-toolbar form { flex: 1; min-width: 160px; } +.forum-toolbar input[name=q] { + width: 100%; box-sizing: border-box; padding: 8px 12px; background: rgba(8, 18, 22, 0.8); border: 1px solid rgba(40, 70, 65, 0.4); - border-radius: 4px; color: #90b4ac; font-size: 0.95rem; + border-radius: 4px; color: #90b4ac; font-size: 0.9rem; transition: border-color 0.2s, box-shadow 0.3s; } -.forum-search input[name=q]:focus { +.forum-toolbar input[name=q]:focus { outline: none; border-color: rgba(80, 140, 110, 0.5); box-shadow: 0 0 18px rgba(100, 200, 150, 0.06); } +.forum-toolbar-actions { display: flex; flex-wrap: wrap; gap: 6px; } .forum-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0.5rem 0; } a.forum-action, a.forum-action-inline { color: #5a7880; text-decoration: none; border-bottom: none; font-size: 0.88rem; @@ -67,8 +68,11 @@ a.forum-action-inline { padding: 2px 6px; border: none; } a.forum-action-inline:hover { border: none; } p.meta { font-size: 0.85rem; color: #3a5560; } .forum-list { list-style: none; padding-left: 0; } -.forum-list li { padding: 0.6rem 0; border-bottom: 1px solid rgba(30, 55, 50, 0.2); } +.forum-list li { padding: 0.8rem 0; border-bottom: 1px solid rgba(30, 55, 50, 0.2); } .forum-list li:last-child { border-bottom: none; } +.forum-list .thread-title { margin-bottom: 0.15rem; } +.forum-list .thread-meta { font-size: 0.78rem; color: #3a5560; } +.forum-list a { border-bottom: none; } .forum-form input[type=text], .forum-form input[type=url] { font-family: inherit; } .forum .post { border-left-color: rgba(40, 70, 65, 0.3); } """ @@ -250,14 +254,17 @@ class ForumHandlers: reply_label = f"{r['reply_count']} replies" if r['reply_count'] else "no replies" items += ( f'
  • ' + f'
    ' f'{badge}{mute_badge} ' f'{esc(r["title"])}' f'{tags_html}' - f'
    ' - f'{esc(self._author_str(r["author_name"], r["author_instance"]))}' + f'
    ' + f'
    ' + f'{esc(self._author_str(r["author_name"], r["author_instance"]))}' f' · {self._time_ago(r["created_at"])}' f' · {r["score"]} upvotes' - f' · {reply_label}' + f' · {reply_label}' + f'
    ' f'
  • ' ) if not items: @@ -265,7 +272,7 @@ class ForumHandlers: new_label = f" ({new_count} new)" if new_count else "" search_form = ( f'
    ' - f'' + f'' f'
    ' ) tag_label = f' — tag: {esc(tag)}' if tag else "" @@ -273,15 +280,14 @@ class ForumHandlers: page_url = f'/forum?q={esc(search)}&tag={esc(tag)}&muted=1' if show_muted else (f'/forum?q={esc(search)}&tag={esc(tag)}' if search or tag else '/forum') return self._respond( f"

    forum{tag_label}

    " - f'' f"

    {total} threads{new_label}

    " f'' f"{self._page_nav(page, total, page_url)}"