Documentation
¶
Index ¶
- Constants
- func AboutPage() []g.Node
- func AccountPictureDisplaySection(d UserProfileData) g.Node
- func AccountPictureEditSection(d UserProfileData, errMsg string) g.Node
- func Ad(d AdDetail, userID int, csrfToken string) []g.Node
- func AdFlyerPage(d AdFlyerData) g.Node
- func AdGridNode(userID, adID, imageCount, nextPage int, ...) g.Node
- func AdImageSrc(adID, index int, size string) string
- func AdNodes(cards []AdCard, userID, page int, csrfToken string, pagination bool) []g.Node
- func AdRemoveModal(adID int, csrfToken string) g.Node
- func AdShareModal(path, flyerHref string) g.Node
- func AdUnavailable() []g.Node
- func AdminContent(activeTab string) g.Node
- func AdminContentWithClicks(activeTab string, clicks ClickAdminData) g.Node
- func AdminContentWithEmbeddings(activeTab string, emb EmbeddingAdminData) g.Node
- func AdminContentWithQueue(activeTab string, queueStats QueueStats, queueEntries []SMSQueueEntry) g.Node
- func AdminDashboardContainer(activeTab string) g.Node
- func AdminDashboardContainerWithClicks(activeTab string, clicks ClickAdminData) g.Node
- func AdminDashboardContainerWithEmbeddings(activeTab string, emb EmbeddingAdminData) g.Node
- func AdminDashboardContainerWithQueue(activeTab string, queueStats QueueStats, queueEntries []SMSQueueEntry) g.Node
- func AdminDashboardPage(stats QueueStats, entries []SMSQueueEntry) []g.Node
- func AdminSettingsTab() g.Node
- func AdminTabs(activeTab string) g.Node
- func AdsContent(adNodes []g.Node) g.Node
- func Autofocus() g.Node
- func BookmarkButton(adID int, bookmarked bool, csrfToken string) g.Node
- func CategoryItem(currentCategoryID, categoryID int, name, imageFile, returnParam string) g.Node
- func CategorySelect(selected CategoryOption, categories []CategoryOption, returnParam string) g.Node
- func ChangePhoneRequestForm() g.Node
- func ChangePhoneSection() g.Node
- func ChangePhoneSuccess(userName, phoneE64 string) g.Node
- func ChangePhoneVerifySection(phoneE64 string) g.Node
- func ClicksTab(d ClickAdminData) g.Node
- func CloseEventMessage(d CloseEventData, attrs ...g.Node) g.Node
- func CloseFlagThrowModalsOOB() []g.Node
- func ConversationContentInput(conversationID int, attrs ...g.Node) g.Node
- func ConversationContentInputClearSwapOOB(conversationID int) g.Node
- func ConversationEmptyMessageDeleteSwapOOB(conversationID int) g.Node
- func ConversationForm(conversationID, adID int, csrfToken string, canPost bool, ...) g.Node
- func ConversationFormSwapOOB(conversationID, adID int, csrfToken string, canPost bool) g.Node
- func ConversationListItem(d ConversationListItemData) g.Node
- func ConversationListItemSwapOOB(conversationID int, conversationItemNode g.Node) g.Node
- func ConversationListSSESink() g.Node
- func ConversationMessageActionsBanner(d ConversationModalData, extraAttrs ...g.Node) g.Node
- func ConversationMessageActionsSwapOOB(d ConversationModalData) g.Node
- func ConversationMessageAppendOOB(conversationID int) g.Node
- func ConversationMessagesAppendSwapForTest() string
- func ConversationMessagesArea(conversationID int, canPost bool, messageNodes []g.Node, extraAttrs ...g.Node) g.Node
- func ConversationMessagesPanel(d ConversationModalData) g.Node
- func ConversationMessagesSelector(conversationID int) string
- func ConversationModalSwapOOB(d ConversationModalData) g.Node
- func ConversationModalWithFlag(d ConversationModalData) g.Node
- func ConversationSSESink(conversationID int) g.Node
- func CopyButton(path string) g.Node
- func CopyButtonCopied(path string) g.Node
- func DeleteAccountConfirmModal(csrfToken string) g.Node
- func DonatePage() []g.Node
- func EditAd(category CategoryOption, cfg uiads.AdFormConfig, fields g.Node) []g.Node
- func EmbeddingActivityRows(id string, rows []EmbeddingActivityRow) g.Node
- func EmbeddingsTab(d EmbeddingAdminData) g.Node
- func ErrorDiv(errMsg string) g.Node
- func ErrorDivWithID(id, errMsg string) g.Node
- func ErrorPageContent(code int, message string) []g.Node
- func FAQPage(expandedSection string) []g.Node
- func FAQSectionIDs() []string
- func FilterToggle(expanded bool) g.Node
- func FlagCountBadge(flagCount int) g.Node
- func FlagEventMessage(d FlagEventData, attrs ...g.Node) g.Node
- func FlagIcons(adID int, flagCount int) g.Node
- func FlagOpinionLink(conversationID int) g.Node
- func FlagOpinionModal(d FlagOpinionModalData) g.Node
- func FlagThrowConfirmModal(d FlagThrowConfirmData) g.Node
- func FlagThrowLink(d ConversationModalData) g.Node
- func FlagThrowPreviewModal(d FlagThrowPreviewData) g.Node
- func FunStatsPage(d FunStatsData) []g.Node
- func GenerateSVG(adID, imageID int, size, class string) g.Node
- func HomePage(userID int, q string, filtersExpanded bool, filterFacets []facet.Def, ...) []g.Node
- func ImageFullScreen(adID, current, count int, size string) g.Node
- func ImageFullScreenUpdate(adID, current, count int, size string) g.Node
- func ImageNode(adID, count, current int, size, heightClass string, clickable bool) g.Node
- func ImageNodeWithThumbnails(adID, count, current int, size, heightClass string, clickable bool) g.Node
- func ImageThumbnails(adID, current, count int, size, heightClass string, clickable bool) g.Node
- func LoginForm(returnPath string) g.Node
- func LoginPage(returnPath string) []g.Node
- func MessageItem(d MessageItemData, attrs ...g.Node) g.Node
- func MessageTimeline(messages []MessageItemData, flags []FlagEventData, closes []CloseEventData) []g.Node
- func MessagesPage(items []ConversationListItemData) []g.Node
- func MyAdsContainer(activeTab string, adNodes []g.Node) g.Node
- func MyAdsPage(activeTab string, adNodes []g.Node) []g.Node
- func MyAdsTabs(activeTab string) g.Node
- func NewAd(category CategoryOption, categories []CategoryOption, fields g.Node) []g.Node
- func NoInAreaMatchesMessage(within int, unit, location string) g.Node
- func NotificationsSSESink() g.Node
- func NotificationsSection(smsOptedOut bool) g.Node
- func NotificationsSectionSwapOOB(smsOptedOut bool) g.Node
- func OutsideAreaHeading() g.Node
- func Page(userID int, hasUnread bool, userName, title, currentPath, csrfToken string, ...) g.Node
- func PasswordField(view PasswordFieldView) g.Node
- func PrivacyPolicyPage() []g.Node
- func RecoverExpiredPanel() g.Node
- func RecoverFailedPanel(message string) g.Node
- func RecoverPage(code, twilioFrom string, expiresAt time.Time) []g.Node
- func RecoverResetForm(username string) g.Node
- func RecoverUnavailablePage() []g.Node
- func RecoverWaitingPanel(code, twilioFrom string, expiresAt time.Time) g.Node
- func RegisterForm(username string) g.Node
- func RegisterPage(username string) []g.Node
- func RegisterPassword(username, phoneE64 string) g.Node
- func RegisterVerify(username, phoneE64 string) g.Node
- func RemoveIntroBanner() g.Node
- func RemoveModal(name string) []g.Node
- func SMSQueueFilters() g.Node
- func SMSQueueRow(entry SMSQueueEntry) g.Node
- func SMSQueueRows(entries []SMSQueueEntry) g.Node
- func SMSQueueStats(stats QueueStats) g.Node
- func SMSQueueTab(stats QueueStats, entries []SMSQueueEntry) g.Node
- func SMSQueueTableHeader() g.Node
- func SMSQueueTableWithEntries(entries []SMSQueueEntry) g.Node
- func SSEEventConversation(conversationID int) string
- func SearchArea(q string, expanded bool, filterFacets []facet.Def, filters uiads.SearchFilters) g.Node
- func SearchAreaOOB(q string, expanded bool, filterFacets []facet.Def, filters uiads.SearchFilters) g.Node
- func SearchContainer(userID int, q string, filtersExpanded bool, filterFacets []facet.Def, ...) g.Node
- func SearchLocationModal(f uiads.SearchFilters) g.Node
- func SearchResults(results []g.Node) g.Node
- func SearchResultsEmptyMessage() g.Node
- func SearchResultsOOB(results []g.Node) g.Node
- func SearchResultsResponse(page int, results []g.Node) g.Node
- func SearchView(filters uiads.SearchFilters, results []g.Node) g.Node
- func SearchWidget(userID int, q string, filtersExpanded bool, filterFacets []facet.Def, ...) g.Node
- func SetAdImageURLFunc(f func(adID, index int, size string) string)
- func SetUserAccountPictureURLFunc(f func(userID int) string)
- func SettingsPage(name, phoneE64 string, smsOptedOut bool) []g.Node
- func SiteFooter() g.Node
- func StaticFlagIcons(flagCount int) g.Node
- func TermsOfServicePage() []g.Node
- func TurnstileWidget() g.Node
- func UnreadIndicatorSwapOOB(hasUnread bool) g.Node
- func UnreadSSESink() g.Node
- func UserAccountPictureArea(d UserProfileData, editing bool, errMsg string) g.Node
- func UserAccountPictureSrc(userID int) string
- func UserFlagIcons(userID int, flagCount int) g.Node
- func UserMenu(userName, memberSince string, userID int, isAdmin bool, hasUnread bool, ...) g.Node
- func UserNameLink(userID int, userName string, extra ...g.Node) g.Node
- func UserProfileAds(adNodes []g.Node) g.Node
- func UserProfilePage(d UserProfileData, adNodes []g.Node) []g.Node
- func UserShareModal(path string) g.Node
- func UserSummaryFragment(d UserProfileData) g.Node
- func ValidFAQSection(id string) bool
- func WelcomePage(flagCount int) []g.Node
- type AdCard
- type AdDetail
- type AdFlyerData
- type AdHistoryEntry
- type CategoryOption
- type ClickAdRow
- type ClickAdminData
- type ClickImageRow
- type CloseEventData
- type ConversationListItemData
- type ConversationModalData
- type EmbeddingActivityRow
- type EmbeddingAdminData
- type EmbeddingCachePanel
- type FlagEventData
- type FlagEventKind
- type FlagOpinionModalData
- type FlagThrowConfirmData
- type FlagThrowPreviewData
- type FunStatsData
- type FunStatsMonth
- type MessageItemData
- type MissingEmbeddingRow
- type PasswordFieldView
- type QueueStats
- type SMSQueueEntry
- type SMSQueueEntryInput
- type UserOption
- type UserProfileData
Constants ¶
const ( SSEEventUnread = "unread" SSEEventConversationList = "conversation-list" SSEEventNotifications = "notifications" )
Named SSE events — listeners exist only when the matching UI is mounted, so missing-target OOB errors are avoided on other pages.
const ( SettingsChangePasswordErrorID = "change-password-error" SettingsChangePhoneErrorID = "change-phone-error" SettingsDeleteAccountErrorID = "delete-account-error" SettingsAccountPictureErrorID = "account-picture-error" )
const RecoverPasswordErrorID = "recover-password-error"
Variables ¶
This section is empty.
Functions ¶
func AccountPictureDisplaySection ¶ added in v0.0.22
func AccountPictureDisplaySection(d UserProfileData) g.Node
AccountPictureDisplaySection is the owner-facing picture with an overlay edit control. Empty state is a dotted placeholder frame.
func AccountPictureEditSection ¶ added in v0.0.22
func AccountPictureEditSection(d UserProfileData, errMsg string) g.Node
AccountPictureEditSection is the owner edit form for upload/URL/remove. Picture and link changes save silently (no Done / Save buttons).
func AdFlyerPage ¶
func AdFlyerPage(d AdFlyerData) g.Node
func AdGridNode ¶
func AdImageSrc ¶
AdImageSrc returns a reused PresignGet URL, or "" when the object is missing.
func AdShareModal ¶
func AdUnavailable ¶
func AdminContent ¶
func AdminContentWithClicks ¶
func AdminContentWithClicks(activeTab string, clicks ClickAdminData) g.Node
func AdminContentWithEmbeddings ¶
func AdminContentWithEmbeddings(activeTab string, emb EmbeddingAdminData) g.Node
func AdminContentWithQueue ¶
func AdminContentWithQueue(activeTab string, queueStats QueueStats, queueEntries []SMSQueueEntry) g.Node
func AdminDashboardContainer ¶
func AdminDashboardContainerWithClicks ¶
func AdminDashboardContainerWithClicks(activeTab string, clicks ClickAdminData) g.Node
func AdminDashboardContainerWithEmbeddings ¶
func AdminDashboardContainerWithEmbeddings(activeTab string, emb EmbeddingAdminData) g.Node
func AdminDashboardContainerWithQueue ¶
func AdminDashboardContainerWithQueue(activeTab string, queueStats QueueStats, queueEntries []SMSQueueEntry) g.Node
func AdminDashboardPage ¶
func AdminDashboardPage(stats QueueStats, entries []SMSQueueEntry) []g.Node
func AdminSettingsTab ¶
func CategoryItem ¶
func CategorySelect ¶
func CategorySelect(selected CategoryOption, categories []CategoryOption, returnParam string) g.Node
func ChangePhoneRequestForm ¶
func ChangePhoneSection ¶
func ChangePhoneSuccess ¶
func ClicksTab ¶
func ClicksTab(d ClickAdminData) g.Node
func CloseEventMessage ¶
func CloseEventMessage(d CloseEventData, attrs ...g.Node) g.Node
CloseEventMessage renders a journal entry for ad/account deletion.
func CloseFlagThrowModalsOOB ¶ added in v0.0.21
CloseFlagThrowModalsOOB removes confirm/preview modals after a successful throw.
func ConversationContentInputClearSwapOOB ¶
ConversationContentInputClearSwapOOB replaces the message input with an empty field after send.
func ConversationEmptyMessageDeleteSwapOOB ¶
ConversationEmptyMessageDeleteSwapOOB removes the empty-state placeholder when the first message is appended.
func ConversationForm ¶
func ConversationFormSwapOOB ¶
func ConversationListItem ¶
func ConversationListItem(d ConversationListItemData) g.Node
func ConversationListSSESink ¶
func ConversationMessageActionsBanner ¶
func ConversationMessageActionsBanner(d ConversationModalData, extraAttrs ...g.Node) g.Node
func ConversationMessageActionsSwapOOB ¶
func ConversationMessageActionsSwapOOB(d ConversationModalData) g.Node
func ConversationMessagesAppendSwapForTest ¶
func ConversationMessagesAppendSwapForTest() string
ConversationMessagesAppendSwapForTest exposes the append swap spec for tests.
func ConversationMessagesPanel ¶
func ConversationMessagesPanel(d ConversationModalData) g.Node
func ConversationModalSwapOOB ¶
func ConversationModalSwapOOB(d ConversationModalData) g.Node
ConversationModalSwapOOB returns the modal div with hx-swap-oob="outerHTML". Used when the first message creates a conversation.
func ConversationModalWithFlag ¶ added in v0.0.21
func ConversationModalWithFlag(d ConversationModalData) g.Node
func ConversationSSESink ¶
func CopyButton ¶
func CopyButtonCopied ¶
func DonatePage ¶
func EditAd ¶
func EditAd(category CategoryOption, cfg uiads.AdFormConfig, fields g.Node) []g.Node
func EmbeddingActivityRows ¶
func EmbeddingActivityRows(id string, rows []EmbeddingActivityRow) g.Node
func EmbeddingsTab ¶
func EmbeddingsTab(d EmbeddingAdminData) g.Node
func ErrorDivWithID ¶
func ErrorPageContent ¶
ErrorPageContent returns the content for error pages
func FAQSectionIDs ¶
func FAQSectionIDs() []string
func FilterToggle ¶
func FlagCountBadge ¶ added in v0.0.21
FlagCountBadge shows user's remaining flags
func FlagEventMessage ¶ added in v0.0.21
func FlagEventMessage(d FlagEventData, attrs ...g.Node) g.Node
FlagEventMessage renders a journal entry for a flag throw or lower.
func FlagIcons ¶ added in v0.0.21
FlagIcons renders clickable flag icons for an ad Each icon links to a flag by ordinal position Only shows flags bound to the ad (when inquirer throws)
func FlagOpinionLink ¶ added in v0.0.21
FlagOpinionLink renders a link for participants to view the assessment.
func FlagOpinionModal ¶ added in v0.0.21
func FlagOpinionModal(d FlagOpinionModalData) g.Node
FlagOpinionModal renders the cached or generated dispute assessment.
func FlagThrowConfirmModal ¶ added in v0.0.21
func FlagThrowConfirmModal(d FlagThrowConfirmData) g.Node
FlagThrowConfirmModal is a single scrollable confirm before raising a flag.
func FlagThrowLink ¶ added in v0.0.21
func FlagThrowLink(d ConversationModalData) g.Node
FlagThrowLink renders a button to throw/lower a flag in the conversation modal
func FlagThrowPreviewModal ¶ added in v0.0.21
func FlagThrowPreviewModal(d FlagThrowPreviewData) g.Node
FlagThrowPreviewModal is a stacked modal for pre-throw dispute assessment.
func FunStatsPage ¶
func FunStatsPage(d FunStatsData) []g.Node
func GenerateSVG ¶
GenerateSVG is a missing-image placeholder sized like an <img> via class.
func ImageFullScreenUpdate ¶
func ImageNodeWithThumbnails ¶
func ImageThumbnails ¶
func MessageItem ¶
func MessageItem(d MessageItemData, attrs ...g.Node) g.Node
func MessageTimeline ¶
func MessageTimeline(messages []MessageItemData, flags []FlagEventData, closes []CloseEventData) []g.Node
MessageTimeline renders chat messages with flag and close journal entries inserted chronologically. Timestamps must already be in the viewer's timezone.
func MessagesPage ¶
func MessagesPage(items []ConversationListItemData) []g.Node
func NewAd ¶
func NewAd(category CategoryOption, categories []CategoryOption, fields g.Node) []g.Node
func NoInAreaMatchesMessage ¶
NoInAreaMatchesMessage is shown when geo search has no matches in the within area.
func NotificationsSSESink ¶
func NotificationsSection ¶
func OutsideAreaHeading ¶
OutsideAreaHeading separates in-area from out-of-area search results.
func PasswordField ¶
func PasswordField(view PasswordFieldView) g.Node
PasswordField renders a password input with an HTMX visibility toggle.
func PrivacyPolicyPage ¶
func RecoverExpiredPanel ¶
func RecoverFailedPanel ¶
func RecoverResetForm ¶
func RecoverUnavailablePage ¶
func RecoverWaitingPanel ¶
func RegisterForm ¶
func RegisterPage ¶
func RegisterPassword ¶
func RegisterVerify ¶
func RemoveIntroBanner ¶
func RemoveModal ¶
RemoveModal returns swap-oob delete elements to remove a modal and its backdrop
func SMSQueueFilters ¶
func SMSQueueRow ¶
func SMSQueueRow(entry SMSQueueEntry) g.Node
func SMSQueueRows ¶
func SMSQueueRows(entries []SMSQueueEntry) g.Node
func SMSQueueStats ¶
func SMSQueueStats(stats QueueStats) g.Node
func SMSQueueTab ¶
func SMSQueueTab(stats QueueStats, entries []SMSQueueEntry) g.Node
func SMSQueueTableHeader ¶
func SMSQueueTableWithEntries ¶
func SMSQueueTableWithEntries(entries []SMSQueueEntry) g.Node
func SSEEventConversation ¶
func SearchArea ¶
func SearchArea(q string, expanded bool, filterFacets []facet.Def, filters uiads.SearchFilters) g.Node
SearchArea renders the search box, filter toggle, and optional expanded facets.
func SearchAreaOOB ¶
func SearchAreaOOB(q string, expanded bool, filterFacets []facet.Def, filters uiads.SearchFilters) g.Node
SearchAreaOOB swaps #search-area when the filter panel is shown or hidden.
func SearchContainer ¶
func SearchLocationModal ¶
func SearchLocationModal(f uiads.SearchFilters) g.Node
SearchLocationModal renders the modal to edit location and within distance.
func SearchResultsEmptyMessage ¶
SearchResultsEmptyMessage is the standard no-results copy for search grids.
func SearchResultsOOB ¶
SearchResultsOOB swaps #search-results out-of-band (show/hide filters).
func SearchResultsResponse ¶
SearchResultsResponse is the HTMX body for /api/search/. Page 1: #search-results with sorry message or first page of ads. Page 2+: ad nodes only (replaces the scroll sentinel).
func SearchView ¶
func SearchWidget ¶
func SetAdImageURLFunc ¶
SetAdImageURLFunc registers the resolver used by image templates.
func SetUserAccountPictureURLFunc ¶
SetUserAccountPictureURLFunc registers the resolver for account pictures.
func SiteFooter ¶
func StaticFlagIcons ¶ added in v0.0.21
func TermsOfServicePage ¶
func TurnstileWidget ¶
TurnstileWidget renders Cloudflare Turnstile when keys are configured and enforcement is required (not under ALLOW_TEST_REGISTRATION).
func UnreadIndicatorSwapOOB ¶
func UnreadSSESink ¶
func UserAccountPictureArea ¶ added in v0.0.22
func UserAccountPictureArea(d UserProfileData, editing bool, errMsg string) g.Node
UserAccountPictureArea renders the profile picture block. For other users it is display-only (nil when no picture). For the owner it includes Edit.
func UserAccountPictureSrc ¶
UserAccountPictureSrc returns a PresignGet URL, or "" when missing.
func UserFlagIcons ¶ added in v0.0.21
UserFlagIcons renders clickable flag icons for a user Each icon links to a flag by ordinal position Shows flags bound to the user (when owner throws)
func UserNameLink ¶
UserNameLink renders a link to the user's profile with a hover popup summary
func UserProfileAds ¶
UserProfileAds is the active-ads section on a profile page.
func UserProfilePage ¶
func UserProfilePage(d UserProfileData, adNodes []g.Node) []g.Node
UserProfilePage renders the user profile page body
func UserShareModal ¶
func UserSummaryFragment ¶
func UserSummaryFragment(d UserProfileData) g.Node
UserSummaryFragment is the popup content loaded on hover
func ValidFAQSection ¶
func WelcomePage ¶
Types ¶
type AdCard ¶
type AdCard struct {
ID int
PriceDisplay string
HasPrice bool
Title string
Location string
CreatedAt time.Time
ImageCount int
Active bool
Bookmarked bool
FlagCount int
FacetLabel string
}
AdCard holds presentation fields for a listing card.
type AdDetail ¶
type AdDetail struct {
ID int
OwnerID int
ImageCount int
PriceDisplay string
HasPrice bool
Title string
Location string
DescriptionOriginal string
DescriptionHistory []AdHistoryEntry
// ShowLoginForDetails is true when edit history exists but is hidden
// until the viewer logs in.
ShowLoginForDetails bool
CreatedAt time.Time
ExpiresAt time.Time
Bookmarked bool
Active bool
Inactive bool
Deleted bool
IsTest bool
Reachable bool
FlagCount int
FacetLabel string
FacetDetails []string // formal facets not shown in title or price row
Tags []string
}
AdDetail holds presentation fields for a single ad page.
type AdFlyerData ¶
type AdFlyerData struct {
ID int
ImageCount int
PriceDisplay string
HasPrice bool
Title string
Location string
Description string
FacetLabel string
FacetDetails []string
Tags []string
AdURL string
}
AdFlyerData holds presentation fields for the print-only ad flyer.
type AdHistoryEntry ¶
AdHistoryEntry holds one edit-history block on the ad detail page.
type CategoryOption ¶
CategoryOption holds presentation fields for a category picker item.
type ClickAdRow ¶
type ClickAdRow struct {
AdID int
Title string
CategoryName string
UserCount int
AdViews int
ImageClicks int
LastActivity string
}
ClickAdRow is one row in the top-ads table.
type ClickAdminData ¶
type ClickAdminData struct {
UsersWithClicks int
AdsClicked int
AdDetailViews int
ActiveLast7Days int
TopAds []ClickAdRow
TopImages []ClickImageRow
}
ClickAdminData holds presentation fields for the clicks admin tab.
type ClickImageRow ¶
type ClickImageRow struct {
AdID int
Title string
ImageIndex int
UserCount int
Clicks int
LastClick string
}
ClickImageRow is one row in the top-images table.
type CloseEventData ¶
CloseEventData holds presentation fields for an ad/account close journal entry. EventAt is in the viewer's timezone.
type ConversationListItemData ¶
type ConversationListItemData struct {
ConversationID int
AdID int
OwnerID int
InquirerID int
CurrentUserID int
AdTitle string
LastMessageContent string
OtherUserName string
LastMessageAt *time.Time
UpdatedAt time.Time
HasUnread bool
FlagCount int
OtherUserFlagCount int
OtherUserDeleted bool
}
ConversationListItemData holds presentation fields for a messages list row. LastMessageAt and UpdatedAt are in the viewer's timezone when set.
type ConversationModalData ¶
type ConversationModalData struct {
ConversationID int
AdID int
OwnerID int
InquirerID int
CurrentUserID int
InquirerFlagCount int
OwnerFlagCount int
AdTitle string
OwnerName string
InquirerName string
OwnerDeleted bool
InquirerDeleted bool
CSRFToken string
CanPost bool
HasRaisedFlag bool
CanRaiseFlag bool
MessageNodes []g.Node
FlagRaiserID *int
TargetModalID string
// DisabledInputPlaceholder overrides the closed send-field placeholder.
DisabledInputPlaceholder string
}
ConversationModalData holds presentation fields for a conversation modal.
type EmbeddingActivityRow ¶
type EmbeddingActivityRow struct {
AdID int
AdTitle string
ActivityType string
Weight float32
Timestamp string
}
EmbeddingActivityRow holds one weighted activity used to build an embedding.
type EmbeddingAdminData ¶
type EmbeddingAdminData struct {
EmbedderProvider string
EmbedderModel string
EmbeddedCount int
MissingCount int
QueueDepth int
Caches []EmbeddingCachePanel
MissingAds []MissingEmbeddingRow
CategoryID int
SiteCategoryID int
Categories []CategoryOption
UserID int
Users []UserOption
UserActivities []EmbeddingActivityRow
SiteActivities []EmbeddingActivityRow
}
EmbeddingAdminData holds presentation fields for the embeddings admin tab.
type EmbeddingCachePanel ¶
type EmbeddingCachePanel struct {
Name string
Hits int64
Misses int64
HitRatePct float64
ItemCount int64
MemoryKB float64
}
EmbeddingCachePanel holds cache metrics for one embedding cache tier.
type FlagEventData ¶ added in v0.0.21
type FlagEventData struct {
ConversationID int
ThrowerID int
CurrentUserID int
Kind FlagEventKind
EventAt time.Time
OwnerID int
InquirerID int
OwnerName string
InquirerName string
Reason string
ShowAssessmentHint bool
}
FlagEventData holds presentation fields for a flag journal timeline entry. EventAt is in the viewer's timezone.
type FlagEventKind ¶ added in v0.0.21
type FlagEventKind int
FlagEventKind identifies a flag journal entry type.
const ( FlagEventThrown FlagEventKind = iota FlagEventLowern )
type FlagOpinionModalData ¶ added in v0.0.21
type FlagOpinionModalData struct {
ConversationID int
AdID int
AdTitle string
Summary string
AssessmentScore int
AssessmentDetail string
Resolution string
Reasoning string
AdFacts []string
GeneratedAt *time.Time
}
FlagOpinionModalData holds presentation fields for a dispute assessment modal. Party identities are never shown; roles are Owner / Inquirer only.
type FlagThrowConfirmData ¶ added in v0.0.21
type FlagThrowConfirmData struct {
ConversationID int
AdID int
CSRFToken string
Remaining int
ThrowLabel string
// AtAd is true when the inquirer is throwing at the listing.
AtAd bool
// OtherUserID / OtherName are the counterparty (ad owner when AtAd, else inquirer).
OtherUserID int
OtherName string
}
FlagThrowConfirmData drives the pre-throw confirmation modal.
type FlagThrowPreviewData ¶ added in v0.0.21
type FlagThrowPreviewData struct {
Summary string
AssessmentScore int
AssessmentDetail string
Resolution string
Reasoning string
}
FlagThrowPreviewData is the inline assessment preview inside the confirm modal.
type FunStatsData ¶
type FunStatsData struct {
Months []FunStatsMonth
}
FunStatsData holds presentation fields for /funstats.
type FunStatsMonth ¶
FunStatsMonth is one month on the public fun stats graphs.
type MessageItemData ¶
MessageItemData holds presentation fields for a single chat message. CreatedAt is in the viewer's timezone.
type MissingEmbeddingRow ¶
MissingEmbeddingRow holds one ad awaiting vector indexing.
type PasswordFieldView ¶
type PasswordFieldView struct {
Name string
ID string // DOM id stem; defaults to Name when empty
Autocomplete string
Value string
Visible bool
Autofocus bool
// PreventAutofill uses readonly-until-focus so password managers
// don't fill the field on page load (e.g. change-password forms
// that also include a username for the save prompt).
PreventAutofill bool
}
PasswordFieldView holds state for a password input with visibility toggle.
type QueueStats ¶
QueueStats holds SMS queue counts for the admin dashboard.
type SMSQueueEntry ¶
type SMSQueueEntry struct {
ID int
AdTitle string
Status string
CreatedAt string
ProcessedAt *string
}
SMSQueueEntry represents a queue entry for UI rendering
func SMSQueueEntriesFrom ¶
func SMSQueueEntriesFrom(entries []SMSQueueEntryInput) []SMSQueueEntry
type SMSQueueEntryInput ¶
type SMSQueueEntryInput struct {
ID int
AdTitle string
Status string
CreatedAt time.Time
ProcessedAt *time.Time
}
SMSQueueEntryInput holds raw queue entry fields for UI formatting.
type UserOption ¶
UserOption holds presentation fields for an admin user picker item.
Source Files
¶
- ad.go
- ad_cards.go
- admin.go
- admin_clicks.go
- admin_embeddings.go
- category.go
- components.go
- donate.go
- error.go
- faq.go
- flag.go
- flag_confirm.go
- flag_opinion.go
- flyer.go
- funstats.go
- home.go
- image.go
- image_url.go
- legal.go
- login.go
- message.go
- page.go
- qr.go
- recover.go
- register.go
- search_location.go
- sse.go
- turnstile.go
- types.go
- user.go
- welcome.go