Forum: asking about one's own chart, forecast or comparison
- "Kérdezek róla a fórumon" on the chart, yearly forecast and comparison pages: after a window that says what goes out, a share link made for the forum (never birth data, names or a title) and a new thread in "Égbolt és képletek" with it attached. - The question shows a card (Sun, Moon, Ascendant with sign, degree and house, the summary's title, a link to the shared page) to logged-in members only; visitors and search engines see only that there is one. The author can take it off, and deleting the question ends the link. - The shared page (/s/...) now shows comparisons (one wheel, the aspects, no names) and yearly forecasts (keys, timeline, transits, the detailed text; without the birthday's place); the backend shares forecasts. - The privacy notice (HU, EN) covers attached charts and muted members. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -687,3 +687,17 @@ a.fh-online-item:hover { color: var(--gold); }
|
||||
.fh-archived summary { min-height: 44px; display: flex; align-items: center; color: var(--ink-2); font-size: 15px; cursor: pointer; }
|
||||
.fh-archived .fh-links { list-style: none; margin: 0; padding: 0; }
|
||||
.fh-archived li + li .fh-link { border-top: 1px solid var(--line); }
|
||||
|
||||
/* --- a chart shared with a question --- */
|
||||
.fshare {
|
||||
display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; padding: 14px 16px;
|
||||
border: 1px solid var(--line-2); border-radius: 14px; background: var(--f-tint);
|
||||
}
|
||||
.fshare-quiet { background: none; border-style: dashed; }
|
||||
.fshare-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
|
||||
.fshare-title { font-size: 16px; }
|
||||
.fshare-summary { font-family: var(--font-display); font-size: 19px; color: var(--ink-2); }
|
||||
.fshare-points { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
|
||||
.fshare-open { margin-top: 4px; }
|
||||
.fnew-share { display: flex; flex-direction: column; gap: 8px; }
|
||||
.fnew-share .fshare { margin-top: 0; }
|
||||
|
||||
@@ -6,12 +6,23 @@ import { useState } from "react";
|
||||
|
||||
import { api, errorText } from "@/lib/api";
|
||||
import { convertEmoticons, withEmoji } from "@/lib/emoticons";
|
||||
import { type ForumTopic, threadHref } from "@/lib/forum";
|
||||
import { ShareCard } from "@/components/forum/ShareCard";
|
||||
import { type ForumTopic, type ShareCardData, threadHref } from "@/lib/forum";
|
||||
|
||||
type Intent = "listen" | "advice" | "";
|
||||
|
||||
export function NewThreadForm({ topics, initialTopic }: { topics: ForumTopic[]; initialTopic: string }) {
|
||||
export function NewThreadForm({
|
||||
topics,
|
||||
initialTopic,
|
||||
share: initialShare,
|
||||
}: {
|
||||
topics: ForumTopic[];
|
||||
initialTopic: string;
|
||||
/** A chart, forecast or synastry shared for the question (from its page). */
|
||||
share?: { slug: string; card: ShareCardData } | null;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [share, setShare] = useState(initialShare ?? null);
|
||||
const [topic, setTopic] = useState(initialTopic);
|
||||
const listening = topics.find((t) => t.slug === topic)?.listening ?? false;
|
||||
const [intent, setIntent] = useState<Intent>(listening ? "listen" : "");
|
||||
@@ -37,6 +48,7 @@ export function NewThreadForm({ topics, initialTopic }: { topics: ForumTopic[];
|
||||
title: convertEmoticons(title, title.length, true).text,
|
||||
body: convertEmoticons(body, body.length, true).text,
|
||||
intent: intent || null,
|
||||
share: share?.slug ?? null,
|
||||
},
|
||||
});
|
||||
router.push(threadHref(created));
|
||||
@@ -49,6 +61,15 @@ export function NewThreadForm({ topics, initialTopic }: { topics: ForumTopic[];
|
||||
|
||||
return (
|
||||
<form className="fnew" onSubmit={submit}>
|
||||
{share && (
|
||||
<div className="fnew-share">
|
||||
<ShareCard share={share.card} onRemove={() => setShare(null)} />
|
||||
<span className="hint">
|
||||
A belépett tagok látják a hozzászólásod alatt. Írd le, mire vagy kíváncsi: minél konkrétabb a kérdés, annál
|
||||
jobb válaszokat kapsz.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<fieldset className="fnew-set">
|
||||
<legend>Téma</legend>
|
||||
<div className="fnew-topics">
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import type { ForumTopic, ForumViewer } from "@/lib/forum";
|
||||
import type { ForumTopic, ForumViewer, ShareCardData } from "@/lib/forum";
|
||||
import { forumGet } from "@/lib/forumServer";
|
||||
|
||||
import { NewThreadForm } from "./NewThreadForm";
|
||||
|
||||
export const metadata = { title: "Új szál", robots: { index: false } };
|
||||
|
||||
type Props = { searchParams: Promise<{ tema?: string }> };
|
||||
type Props = { searchParams: Promise<{ tema?: string; kepletkartya?: string }> };
|
||||
|
||||
/** Starting a thread: a nickname first, then topic, wish, title and text. */
|
||||
export default async function NewThreadPage({ searchParams }: Props) {
|
||||
const { tema } = await searchParams;
|
||||
const back = `/forum/uj${tema ? `?tema=${encodeURIComponent(tema)}` : ""}`;
|
||||
const { tema, kepletkartya } = await searchParams;
|
||||
const query = new URLSearchParams();
|
||||
if (tema) query.set("tema", tema);
|
||||
if (kepletkartya) query.set("kepletkartya", kepletkartya);
|
||||
const back = `/forum/uj${query.size ? `?${query}` : ""}`;
|
||||
const res = await forumGet<{ topics: ForumTopic[] }>("/v1/forum/topics");
|
||||
const nav = await forumGet<{ viewer: ForumViewer }>("/v1/forum/nav");
|
||||
const viewer = nav.ok ? nav.data.viewer : null;
|
||||
@@ -20,13 +23,21 @@ export default async function NewThreadPage({ searchParams }: Props) {
|
||||
if (viewer.needs_nickname) redirect(`/forum/beallitasok?vissza=${encodeURIComponent(back)}`);
|
||||
const topics = res.ok ? res.data.topics.filter((t) => t.readable && !t.archived) : [];
|
||||
const initial = topics.find((t) => t.slug === tema)?.slug ?? topics[0]?.slug ?? "";
|
||||
// A question about one's chart: the share made for it on the chart page.
|
||||
const card = kepletkartya
|
||||
? await forumGet<ShareCardData>(`/v1/forum/share-card/${encodeURIComponent(kepletkartya)}`).catch(() => null)
|
||||
: null;
|
||||
return (
|
||||
<div className="fh">
|
||||
<h1 className="fpage-title">Új szál</h1>
|
||||
{viewer.member?.banned ? (
|
||||
<p className="fh-banner fh-banner-warn">Most nem írhatsz a fórumba.</p>
|
||||
) : (
|
||||
<NewThreadForm topics={topics} initialTopic={initial} />
|
||||
<NewThreadForm
|
||||
topics={topics}
|
||||
initialTopic={initial}
|
||||
share={card?.ok && kepletkartya ? { slug: kepletkartya, card: card.data } : null}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user