Abstimmung Ja/Nein statt Links/Rechts
Modus-Werte yes/no statt left/right in DB, API und Statistik; Knöpfe "Ja"/"Nein". Bestehende Stimmen müssen per SQL migriert werden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TiXsPUqw7oeomZ8wZrQW5q
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3d2447fe35
commit
b6cf8c7fa0
@@ -47,7 +47,7 @@ export function Votes({ pid }: { pid: number }) {
|
||||
let counts = "– / –";
|
||||
if (vote.isError) counts = errMsg(vote.error, "Fehler");
|
||||
else if (tally.isError) counts = errMsg(tally.error, "Fehler");
|
||||
else if (t) counts = `${t.left} / ${t.right}`;
|
||||
else if (t) counts = `${t.yes} / ${t.no}`;
|
||||
|
||||
const button = (mode: VoteMode, label: string) => (
|
||||
<button
|
||||
@@ -61,9 +61,9 @@ export function Votes({ pid }: { pid: number }) {
|
||||
|
||||
return (
|
||||
<div className="row">
|
||||
{button("left", "Links")}
|
||||
{button("yes", "Ja")}
|
||||
<span className="muted">{counts}</span>
|
||||
{button("right", "Rechts")}
|
||||
{button("no", "Nein")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ export function StatsPage() {
|
||||
<NumCard value={s.entries} label="Beiträge" />
|
||||
<NumCard value={s.toplevel} label="davon Threads" />
|
||||
<NumCard value={s.replies} label="davon Antworten" />
|
||||
<NumCard value={s.votes.left} label="Stimmen Links" />
|
||||
<NumCard value={s.votes.right} label="Stimmen Rechts" />
|
||||
<NumCard value={s.votes.yes} label="Stimmen Ja" />
|
||||
<NumCard value={s.votes.no} label="Stimmen Nein" />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -26,12 +26,12 @@ export interface Thread {
|
||||
replies: Entry[];
|
||||
}
|
||||
|
||||
export type VoteMode = "left" | "right";
|
||||
export type VoteMode = "yes" | "no";
|
||||
|
||||
export interface VoteTally {
|
||||
pid: number;
|
||||
left: number;
|
||||
right: number;
|
||||
yes: number;
|
||||
no: number;
|
||||
selected: VoteMode | "none";
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export interface StatsDetail {
|
||||
entries: number;
|
||||
toplevel: number;
|
||||
replies: number;
|
||||
votes: { left: number; right: number };
|
||||
votes: { yes: number; no: number };
|
||||
impressions_total: number;
|
||||
visitors_total: number;
|
||||
daily: { day: string; impressions: number; visitors: number }[];
|
||||
|
||||
Reference in New Issue
Block a user