From 2d121048757106aca833f6e8a8775cb54612d68e Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Tue, 24 Feb 2026 15:54:56 -0800 Subject: [PATCH] fix: ensure we are loading events properly during fsdb scan fix: various styling issues on smaller screens fix: map z-index --- public/api/events/index.ts | 13 ++++++-- public/base.css | 4 ++- public/js/app.js | 7 ++++ public/signup_login_wall.html | 28 ++++++++++++++-- public/tabs/chat/chat.css | 58 +++++++++++++++++----------------- public/tabs/essays/essays.html | 11 ++++++- public/tabs/forum/forum.html | 34 ++++++++++++++++++++ public/tabs/map/map.html | 1 + public/tabs/tabs.html | 3 +- utils/prechecks.ts | 5 ++- 10 files changed, 126 insertions(+), 38 deletions(-) diff --git a/public/api/events/index.ts b/public/api/events/index.ts index ca2fe45..2bf633b 100644 --- a/public/api/events/index.ts +++ b/public/api/events/index.ts @@ -1,5 +1,5 @@ import lurid from '@andyburke/lurid'; -import { get_session, get_user, PRECHECK_TABLE, require_user, user_has_write_permission_for_event } from '../../../utils/prechecks.ts'; +import { get_session, get_user, PRECHECK_TABLE, require_user, user_has_create_permission_for_event } from '../../../utils/prechecks.ts'; import * as CANNED_RESPONSES from '../../../utils/canned_responses.ts'; import { EVENT, EVENTS, VALIDATE_EVENT } from '../../../models/event.ts'; import parse_body from '../../../utils/bodyparser.ts'; @@ -39,7 +39,14 @@ export async function GET(request: Request, meta: Record): Promise< const { event_type, event_id - } = /^.*\/events\/(?.*?)\/.*\/(?[A-Za-z-]+)\.json$/.exec(entry.path)?.groups ?? {}; + } = /^.*\/events\/.*\/(?.*?)\:(?[A-Za-z-]+)\.json$/.exec(entry.path)?.groups ?? {}; + + console.dir({ + entry, + event_type, + event_id, + query: meta.query + }); if (meta.query.after_id && event_id <= meta.query.after_id) { return false; @@ -210,7 +217,7 @@ export async function POST(req: Request, meta: Record): Promise${context.essay_datetime.short} +
${context.essay.data.title}
${htmlify(md_to_html(context.essay.data.essay))}
-
diff --git a/public/tabs/forum/forum.html b/public/tabs/forum/forum.html index 84f2c60..c560d92 100644 --- a/public/tabs/forum/forum.html +++ b/public/tabs/forum/forum.html @@ -11,6 +11,7 @@ grid-template-areas: "expander preview info" "expander preview subject" + ". . reactions" ". . content" ". . newpost" ". . replies"; @@ -111,6 +112,10 @@ margin-top: 2rem; } + .post-container .reactions-container { + grid-area: reactions; + } + .post-container button[commandfor="eventactionspopover"] { position: absolute; bottom: 0.25rem; @@ -125,6 +130,35 @@ .post-container .replies-container { grid-area: replies; } + + @media screen and (max-width: 480px) { + .post-container { + grid-template-rows: 120px auto auto auto 1fr; + grid-template-columns: auto 1fr; + grid-template-areas: + ". preview" + "expander info" + "expander subject" + ". reactions" + ". content" + ". newpost" + ". replies"; + + max-height: 16rem; + } + + .post-container .media-preview-container { + overflow: hidden; + display: grid; + align-content: center; + width: 100%; + height: 7rem; + } + + .post-container .media-preview-container img { + object-fit: cover; + } + } { + console.log( 'loaded' ); const tab_switchers = document.querySelectorAll(".tabswitch"); for (const tab_switch of tab_switchers) { tab_switch.addEventListener("input", (event) => { @@ -15,7 +16,7 @@ const view = tab_selector.dataset.view; if (view) { - window.location.hash = `/${view}${ document.body.dataset.channel ? `/channel/${ document.body.dataset.channel }` : '' }`; + window.location.hash = `/${view}`; } }); } diff --git a/utils/prechecks.ts b/utils/prechecks.ts index 1aecdc9..001a46a 100644 --- a/utils/prechecks.ts +++ b/utils/prechecks.ts @@ -44,6 +44,9 @@ export function require_user( } } -export function user_has_write_permission_for_event(user: USER, event: EVENT) { +export function user_has_create_permission_for_event(user: USER, event: EVENT) { return user.permissions.includes('events.create.' + event.type) || (Deno.env.get('DENO_ENV') === 'test' && event.type === 'test'); } +export function user_has_write_permission_for_event(user: USER, event: EVENT) { + return user.permissions.includes('events.write.' + event.type) || (Deno.env.get('DENO_ENV') === 'test' && event.type === 'test'); +}