diff --git a/package-lock.json b/package-lock.json index 195d541..792b524 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "siteforge", - "version": "2.22.0", + "version": "2.22.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "siteforge", - "version": "2.22.0", + "version": "2.22.1", "dependencies": { "@aws-sdk/client-s3": "^3.1135.0", "@dnd-kit/core": "^6.3.1", diff --git a/package.json b/package.json index 3da809f..5e1c8f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "2.22.0", + "version": "2.22.1", "type": "module", "scripts": { "dev": "vite", diff --git a/server/routes/questions.js b/server/routes/questions.js index 83b880e..e5bb149 100644 --- a/server/routes/questions.js +++ b/server/routes/questions.js @@ -76,10 +76,12 @@ export function register(app) { const publicQuestions = sourceQuestions .filter(q => q.isApproved === true && q.answer && q.answer.trim().length > 0) .sort((a, b) => { - // Pinned questions always float to top + // Pinned first (they are also the ones featured on the home page), then newest answer first if (a.pinned && !b.pinned) return -1 if (!a.pinned && b.pinned) return 1 - return 0 + const at = new Date(a.answeredAt ?? a.submittedAt ?? 0).getTime() || 0 + const bt = new Date(b.answeredAt ?? b.submittedAt ?? 0).getTime() || 0 + return bt - at }) res.json({ questions: publicQuestions.map(toPublicQuestion) }) }) diff --git a/src/App.css b/src/App.css index a172a29..6f715db 100644 --- a/src/App.css +++ b/src/App.css @@ -1349,6 +1349,17 @@ margin: 0; } +.qa-callout-more { + margin-top: auto; + font-size: 0.85rem; + color: var(--brand-gold); + text-decoration: none; +} + +.qa-callout-more:hover { + text-decoration: underline; +} + /* ── Home Jump Section ── */ /* ── Truth For Life Widget ── */ .section-tfl { diff --git a/src/App.tsx b/src/App.tsx index 99ed6c5..defb311 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1260,6 +1260,7 @@ function HomepageQACallout() {

"{q.question}"

{q.answer.length > 220 ? q.answer.slice(0, 220).trimEnd() + '…' : q.answer}

{q.firstName &&

— {q.firstName}

} + Read the full answer → ))} diff --git a/src/components/QuestionsAdmin.tsx b/src/components/QuestionsAdmin.tsx index ac614db..cd02648 100644 --- a/src/components/QuestionsAdmin.tsx +++ b/src/components/QuestionsAdmin.tsx @@ -195,7 +195,7 @@ export function QuestionsAdmin({ questions, onChange }: Props) {

Bible Questions & Answers

-

Work through questions from the top: write an answer, set a topic, and publish. Published answers appear on the public Q&A page right away.

+

Work through questions from the top: write an answer, set a topic, and publish. Published answers appear on the public Q&A page right away. Pinned questions show first there and are featured on the home page.

@@ -350,7 +350,7 @@ export function QuestionsAdmin({ questions, onChange }: Props) { )} - + {dirty && Unsaved changes}