Documentation
¶
Overview ¶
Package admin provides templ-based views for the admin interface.
Index ¶
- func APIKeyFormPage(pc *PageContext, data APIKeyFormData) templ.Component
- func APIKeyRow(pc *PageContext, key APIKeyListItem, bulkScope string) templ.Component
- func APIKeysListPage(pc *PageContext, data APIKeysListData) templ.Component
- func AdminLayout(pc *PageContext) templ.Component
- func Alert(pc *PageContext) templ.Component
- func Breadcrumbs(pc *PageContext) templ.Component
- func CacheStatsPage(pc *PageContext, data CacheStatsViewData) templ.Component
- func CategoriesListPage(pc *PageContext, data CategoriesListData) templ.Component
- func CategoryFormPage(pc *PageContext, data CategoryFormData) templ.Component
- func ConfigPage(pc *PageContext, data ConfigViewData) templ.Component
- func DashboardPage(pc *PageContext, data DashboardData) templ.Component
- func DeleteButton(deleteURL string, confirmMsg string, target string) templ.Component
- func DocsGuidePage(pc *PageContext, data DocsGuideViewData) templ.Component
- func DocsPage(pc *PageContext, data DocsViewData) templ.Component
- func DownloadButton(href string, title string) templ.Component
- func EditButton(href string, title string) templ.Component
- func EventsListPage(pc *PageContext, data EventsListData) templ.Component
- func ExportPage(pc *PageContext, data ExportViewData) templ.Component
- func FormsFormPage(pc *PageContext, data FormFormViewData) templ.Component
- func FormsListPage(pc *PageContext, data FormsListViewData) templ.Component
- func FormsSubmissionViewPage(pc *PageContext, data SubmissionViewViewData) templ.Component
- func FormsSubmissionsPage(pc *PageContext, data SubmissionsListViewData) templ.Component
- func Header(pc *PageContext) templ.Component
- func ImportPage(pc *PageContext, data ImportViewData) templ.Component
- func LanguageFormPage(pc *PageContext, data LanguageFormData) templ.Component
- func LanguageRow(pc *PageContext, lang LanguageListItem) templ.Component
- func LanguagesListPage(pc *PageContext, data LanguagesListData) templ.Component
- func LoginPage(d LoginData) templ.Component
- func MediaEditPage(pc *PageContext, data MediaEditViewData) templ.Component
- func MediaLibraryPage(pc *PageContext, data MediaLibraryViewData) templ.Component
- func MediaUploadPage(pc *PageContext, data MediaUploadViewData) templ.Component
- func MenuFormPage(pc *PageContext, data MenuFormData) templ.Component
- func MenusListPage(pc *PageContext, data MenusListData) templ.Component
- func ModulesPage(pc *PageContext, data ModulesViewData) templ.Component
- func PageFormPage(pc *PageContext, data PageFormViewData) templ.Component
- func PageHeader(title string, description string) templ.Component
- func PageVersionsPage(pc *PageContext, data PageVersionsViewData) templ.Component
- func PagesListPage(pc *PageContext, data PagesListViewData) templ.Component
- func Pagination(pc *PageContext, p PaginationData) templ.Component
- func RedirectFormPage(pc *PageContext, data RedirectFormData) templ.Component
- func RedirectRow(pc *PageContext, redirect RedirectListItem) templ.Component
- func RedirectsListPage(pc *PageContext, data RedirectsListData) templ.Component
- func SchedulerListPage(pc *PageContext, data SchedulerListViewData) templ.Component
- func SchedulerTaskFormPage(pc *PageContext, data SchedulerTaskFormViewData) templ.Component
- func SchedulerTaskRunsPage(pc *PageContext, data SchedulerTaskRunsViewData) templ.Component
- func Sidebar(pc *PageContext) templ.Component
- func SortIndicator(state string) templ.Component
- func StatCard(props StatCardProps) templ.Component
- func StatGrid() templ.Component
- func StatusBanner(props StatusBannerProps) templ.Component
- func TagFormPage(pc *PageContext, data TagFormData) templ.Component
- func TagsListPage(pc *PageContext, data TagsListData) templ.Component
- func ThemeSettingsPage(pc *PageContext, data ThemeSettingsViewData) templ.Component
- func ThemesListPage(pc *PageContext, data ThemesListData) templ.Component
- func UserFormPage(pc *PageContext, data UserFormData) templ.Component
- func UsersListPage(pc *PageContext, data UsersListData) templ.Component
- func ViewButton(href string, title string) templ.Component
- func WebhookDeliveriesPage(pc *PageContext, data WebhookDeliveriesViewData) templ.Component
- func WebhookFormPage(pc *PageContext, data WebhookFormViewData) templ.Component
- func WebhooksListPage(pc *PageContext, data WebhooksListViewData) templ.Component
- func WidgetsPage(pc *PageContext, data WidgetsViewData) templ.Component
- type APIKeyFormData
- type APIKeyInfo
- type APIKeyListItem
- type APIKeysListData
- type ActivityItem
- type Breadcrumb
- type CacheItemView
- type CacheStatsView
- type CacheStatsViewData
- type CategoriesListData
- type CategoryFormData
- type CategoryItem
- type CategoryListItem
- type CategoryTranslation
- type CommonLanguageOption
- type ConfigItemView
- type ConfigTranslationValueView
- type ConfigViewData
- type ConflictStrategyView
- type DashboardData
- type DashboardStats
- type DocsEndpointGroupView
- type DocsEndpointView
- type DocsGuideView
- type DocsGuideViewData
- type DocsSystemInfoView
- type DocsViewData
- type EventItem
- type EventsListData
- type ExportViewData
- type FormFieldView
- type FormFormViewData
- type FormListItemView
- type FormTranslationInfoView
- type FormsListViewData
- type HookHandlerViewItem
- type HookViewItem
- type ImportErrorView
- type ImportResultView
- type ImportUploadedDataView
- type ImportViewData
- type LangOption
- type LanguageFormData
- type LanguageInfo
- type LanguageListItem
- type LanguageOption
- type LanguagesListData
- type LoginData
- type MediaEditViewData
- type MediaFolderView
- type MediaItemView
- type MediaLanguageView
- type MediaLibraryViewData
- type MediaTranslationView
- type MediaUploadViewData
- type MediaVariantView
- type MenuFormData
- type MenuInfo
- type MenuListItem
- type MenuPageItem
- type MenusListData
- type ModuleViewItem
- type ModulesViewData
- type PageCategoryNodeView
- type PageCategoryView
- type PageContext
- func (pc *PageContext) HasPrefix(prefix string) bool
- func (pc *PageContext) IsActive(path string) bool
- func (pc *PageContext) IsAdmin() bool
- func (pc *PageContext) IsEditor() bool
- func (pc *PageContext) T(key string, args ...any) string
- func (pc *PageContext) TDefault(key string, defaultVal string) string
- func (pc *PageContext) UserInitial() string
- type PageFeaturedImageView
- type PageFormAliasView
- type PageFormCategoryView
- type PageFormFeaturedImageView
- type PageFormTagView
- type PageFormViewData
- type PageLanguageView
- type PageListItemView
- type PageTagView
- type PageTranslationView
- type PageVersionView
- type PageVersionsViewData
- type PagesListViewData
- type PaginationBulkAction
- type PaginationData
- func (p PaginationData) BulkScope() string
- func (p PaginationData) HasBulkAction() bool
- func (p PaginationData) HasPerPageSelector() bool
- func (p PaginationData) PageURL(page int) string
- func (p PaginationData) ShouldShow() bool
- func (p PaginationData) SortState(field string) string
- func (p PaginationData) SortURL(field, defaultDir string) string
- type PaginationPage
- type PaginationPerPageSelector
- type PermissionGroup
- type PermissionOption
- type RecentFailedDelivery
- type RecentSubmission
- type RedirectFormData
- type RedirectInfo
- type RedirectListItem
- type RedirectStatusCodeOption
- type RedirectsListData
- type SchedulerJobViewItem
- type SchedulerListViewData
- type SchedulerTaskFormViewData
- type SchedulerTaskRunView
- type SchedulerTaskRunsViewData
- type SchedulerTaskViewItem
- type SidebarModule
- type StatCardProps
- type StatusBannerProps
- type SubmissionFieldView
- type SubmissionItemView
- type SubmissionViewViewData
- type SubmissionsListViewData
- type TagFormData
- type TagItem
- type TagListItem
- type TagTranslation
- type TagsListData
- type ThemeSettingView
- type ThemeSettingsViewData
- type ThemeViewItem
- type ThemesListData
- type TranslatableConfigItemView
- type TranslationCoverage
- type UserFormData
- type UserInfo
- type UserItem
- type UserListItem
- type UsersListData
- type ValidationErrorView
- type ValidationResultView
- type WebhookDeliveriesViewData
- type WebhookDeliveryView
- type WebhookEventInfoView
- type WebhookFormViewData
- type WebhookHealthItem
- type WebhookListItemView
- type WebhooksListViewData
- type WidgetAreaView
- type WidgetItemView
- type WidgetTypeView
- type WidgetsViewData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIKeyFormPage ¶
func APIKeyFormPage(pc *PageContext, data APIKeyFormData) templ.Component
APIKeyFormPage renders the API key create/edit form or the generated key page.
func APIKeyRow ¶
func APIKeyRow(pc *PageContext, key APIKeyListItem, bulkScope string) templ.Component
APIKeyRow renders a single API key table row.
func APIKeysListPage ¶
func APIKeysListPage(pc *PageContext, data APIKeysListData) templ.Component
APIKeysListPage renders the API keys list page.
func AdminLayout ¶
func AdminLayout(pc *PageContext) templ.Component
AdminLayout renders the full admin page with sidebar, header, and content.
func Alert ¶
func Alert(pc *PageContext) templ.Component
Alert renders flash messages with auto-dismiss.
func Breadcrumbs ¶
func Breadcrumbs(pc *PageContext) templ.Component
Breadcrumbs renders navigation breadcrumbs with Schema.org markup.
func CacheStatsPage ¶
func CacheStatsPage(pc *PageContext, data CacheStatsViewData) templ.Component
CacheStatsPage renders the cache statistics page.
func CategoriesListPage ¶
func CategoriesListPage(pc *PageContext, data CategoriesListData) templ.Component
CategoriesListPage renders the categories list page.
func CategoryFormPage ¶
func CategoryFormPage(pc *PageContext, data CategoryFormData) templ.Component
CategoryFormPage renders the category create/edit form.
func ConfigPage ¶
func ConfigPage(pc *PageContext, data ConfigViewData) templ.Component
func DashboardPage ¶
func DashboardPage(pc *PageContext, data DashboardData) templ.Component
DashboardPage renders the admin dashboard.
func DeleteButton ¶ added in v0.10.0
DeleteButton renders a small icon-only destructive delete button with htmx.
func DocsGuidePage ¶
func DocsGuidePage(pc *PageContext, data DocsGuideViewData) templ.Component
DocsGuidePage renders a single documentation guide page.
func DocsPage ¶
func DocsPage(pc *PageContext, data DocsViewData) templ.Component
DocsPage renders the documentation overview page.
func DownloadButton ¶ added in v0.10.0
DownloadButton renders a small icon-only download link button.
func EditButton ¶ added in v0.10.0
EditButton renders a small icon-only edit link button.
func EventsListPage ¶
func EventsListPage(pc *PageContext, data EventsListData) templ.Component
EventsListPage renders the events list page.
func ExportPage ¶
func ExportPage(pc *PageContext, data ExportViewData) templ.Component
ExportPage renders the content export page.
func FormsFormPage ¶
func FormsFormPage(pc *PageContext, data FormFormViewData) templ.Component
============================================================================= FORM PAGE (create/edit) =============================================================================
func FormsListPage ¶
func FormsListPage(pc *PageContext, data FormsListViewData) templ.Component
============================================================================= LIST PAGE =============================================================================
func FormsSubmissionViewPage ¶
func FormsSubmissionViewPage(pc *PageContext, data SubmissionViewViewData) templ.Component
============================================================================= SUBMISSION VIEW PAGE =============================================================================
func FormsSubmissionsPage ¶
func FormsSubmissionsPage(pc *PageContext, data SubmissionsListViewData) templ.Component
============================================================================= SUBMISSIONS LIST PAGE =============================================================================
func ImportPage ¶
func ImportPage(pc *PageContext, data ImportViewData) templ.Component
ImportPage renders the content import page.
func LanguageFormPage ¶
func LanguageFormPage(pc *PageContext, data LanguageFormData) templ.Component
LanguageFormPage renders the language create/edit form.
func LanguageRow ¶
func LanguageRow(pc *PageContext, lang LanguageListItem) templ.Component
LanguageRow renders a single language table row.
func LanguagesListPage ¶
func LanguagesListPage(pc *PageContext, data LanguagesListData) templ.Component
LanguagesListPage renders the languages list page.
func MediaEditPage ¶
func MediaEditPage(pc *PageContext, data MediaEditViewData) templ.Component
============================================================================= EDIT PAGE =============================================================================
func MediaLibraryPage ¶
func MediaLibraryPage(pc *PageContext, data MediaLibraryViewData) templ.Component
============================================================================= LIBRARY PAGE =============================================================================
func MediaUploadPage ¶
func MediaUploadPage(pc *PageContext, data MediaUploadViewData) templ.Component
============================================================================= UPLOAD PAGE =============================================================================
func MenuFormPage ¶
func MenuFormPage(pc *PageContext, data MenuFormData) templ.Component
MenuFormPage renders the menu create/edit form.
func MenusListPage ¶
func MenusListPage(pc *PageContext, data MenusListData) templ.Component
MenusListPage renders the menus list page.
func ModulesPage ¶
func ModulesPage(pc *PageContext, data ModulesViewData) templ.Component
ModulesPage renders the modules list page.
func PageFormPage ¶
func PageFormPage(pc *PageContext, data PageFormViewData) templ.Component
============================================================================= PAGE FORM PAGE =============================================================================
func PageHeader ¶
PageHeader renders a page header with title, optional description, and optional action buttons.
func PageVersionsPage ¶
func PageVersionsPage(pc *PageContext, data PageVersionsViewData) templ.Component
============================================================================= PAGE VERSIONS PAGE =============================================================================
func PagesListPage ¶
func PagesListPage(pc *PageContext, data PagesListViewData) templ.Component
============================================================================= PAGES LIST PAGE =============================================================================
func Pagination ¶
func Pagination(pc *PageContext, p PaginationData) templ.Component
Pagination renders pagination controls for admin lists.
func RedirectFormPage ¶
func RedirectFormPage(pc *PageContext, data RedirectFormData) templ.Component
RedirectFormPage renders the redirect create/edit form.
func RedirectRow ¶
func RedirectRow(pc *PageContext, redirect RedirectListItem) templ.Component
RedirectRow renders a single redirect table row.
func RedirectsListPage ¶
func RedirectsListPage(pc *PageContext, data RedirectsListData) templ.Component
RedirectsListPage renders the redirects list page.
func SchedulerListPage ¶
func SchedulerListPage(pc *PageContext, data SchedulerListViewData) templ.Component
func SchedulerTaskFormPage ¶
func SchedulerTaskFormPage(pc *PageContext, data SchedulerTaskFormViewData) templ.Component
func SchedulerTaskRunsPage ¶
func SchedulerTaskRunsPage(pc *PageContext, data SchedulerTaskRunsViewData) templ.Component
func Sidebar ¶
func Sidebar(pc *PageContext) templ.Component
Sidebar renders the admin sidebar navigation.
func SortIndicator ¶ added in v0.10.0
func StatCard ¶ added in v0.10.0
func StatCard(props StatCardProps) templ.Component
StatCard renders a metric card with an icon, value, and label. Pass the icon as children.
func StatusBanner ¶ added in v0.10.0
func StatusBanner(props StatusBannerProps) templ.Component
StatusBanner renders a status banner with icon, title, and health indicator. Pass the icon as children.
func TagFormPage ¶
func TagFormPage(pc *PageContext, data TagFormData) templ.Component
TagFormPage renders the tag create/edit form.
func TagsListPage ¶
func TagsListPage(pc *PageContext, data TagsListData) templ.Component
TagsListPage renders the tags list page.
func ThemeSettingsPage ¶
func ThemeSettingsPage(pc *PageContext, data ThemeSettingsViewData) templ.Component
ThemeSettingsPage renders the theme settings page.
func ThemesListPage ¶
func ThemesListPage(pc *PageContext, data ThemesListData) templ.Component
ThemesListPage renders the themes list page.
func UserFormPage ¶
func UserFormPage(pc *PageContext, data UserFormData) templ.Component
UserFormPage renders the user create/edit form.
func UsersListPage ¶
func UsersListPage(pc *PageContext, data UsersListData) templ.Component
UsersListPage renders the users list page.
func ViewButton ¶ added in v0.10.0
ViewButton renders a small icon-only view/preview link button (opens in new tab).
func WebhookDeliveriesPage ¶
func WebhookDeliveriesPage(pc *PageContext, data WebhookDeliveriesViewData) templ.Component
func WebhookFormPage ¶
func WebhookFormPage(pc *PageContext, data WebhookFormViewData) templ.Component
func WebhooksListPage ¶
func WebhooksListPage(pc *PageContext, data WebhooksListViewData) templ.Component
func WidgetsPage ¶
func WidgetsPage(pc *PageContext, data WidgetsViewData) templ.Component
Types ¶
type APIKeyFormData ¶
type APIKeyFormData struct {
IsEdit bool
APIKey *APIKeyInfo
PermissionGroups []PermissionGroup
Errors map[string]string
FormValues map[string]string
GeneratedKey string // Only set after creation to show key once
GeneratedPerms []string // Permissions of the generated key
}
APIKeyFormData holds all data for the API key create/edit form.
type APIKeyInfo ¶
type APIKeyInfo struct {
ID int64
Name string
KeyPrefix string
Permissions string // Raw JSON string for checking contains
IsActive bool
CreatedAt string
LastUsedAt string // Empty if never used
ExpiresAt string // Date-only format for input field, empty if no expiration
HasLastUsed bool
HasExpires bool
}
APIKeyInfo holds individual API key data for the form.
type APIKeyListItem ¶
type APIKeyListItem struct {
ID int64
Name string
KeyPrefix string
Permissions []string // Pre-parsed from JSON
IsActive bool
IsExpired bool // Pre-computed: active but past expiration
LastUsedAt string // Pre-formatted date string, empty if never used
ExpiresAt string // Pre-formatted date string, empty if no expiration
}
APIKeyListItem holds data for a single API key in the list view.
type APIKeysListData ¶
type APIKeysListData struct {
APIKeys []APIKeyListItem
TotalKeys int64
Pagination PaginationData
}
APIKeysListData holds all data for the API keys list page.
type ActivityItem ¶
type ActivityItem struct {
Category string
Level string
Message string
UserName string
TimeAgo string
CreatedAt string
}
ActivityItem holds activity log data.
type Breadcrumb ¶
Breadcrumb represents a breadcrumb navigation item.
type CacheItemView ¶
type CacheItemView struct {
Name string
Kind string // "config", "sitemap", "menu", "language", "translation", "page", "general"
Items int
Hits int64
Misses int64
HitRate float64
CachedAt string // Pre-formatted, empty if not cached (sitemap)
Size int // Size in bytes (sitemap)
}
CacheItemView holds data for an individual cache entry.
type CacheStatsView ¶
CacheStatsView holds total cache statistics.
type CacheStatsViewData ¶
type CacheStatsViewData struct {
Caches []CacheItemView
TotalStats CacheStatsView
IsRedis bool
IsFallback bool
RedisURL string
HealthError string
ResetAt string // Pre-formatted reset time
}
CacheStatsViewData holds data for the cache stats page.
type CategoriesListData ¶
type CategoriesListData struct {
Categories []CategoryListItem
TotalCount int64
}
CategoriesListData holds all data for the categories list page.
type CategoryFormData ¶
type CategoryFormData struct {
IsEdit bool
Category *CategoryItem
AllCategories []CategoryListItem
AllLanguages []LanguageOption
Language *LanguageOption
Translations []CategoryTranslation
MissingLanguages []LanguageOption
FormValues map[string]string
Errors map[string]string
}
CategoryFormData holds all data for the category create/edit form.
type CategoryItem ¶
type CategoryItem struct {
ID int64
Name string
Slug string
Description string
LanguageCode string
ParentID int64
HasParent bool
Position int
}
CategoryItem holds individual category data.
type CategoryListItem ¶
type CategoryListItem struct {
ID int64
Name string
Slug string
Description string
LanguageCode string
UsageCount int64
Depth int
Children bool
}
CategoryListItem holds data for a category in the list view.
type CategoryTranslation ¶
type CategoryTranslation struct {
Category CategoryItem
Language LanguageOption
}
CategoryTranslation holds data for a category translation.
type CommonLanguageOption ¶
CommonLanguageOption represents a language option for the quick-select dropdown.
type ConfigItemView ¶
ConfigItemView represents a non-translatable config item.
type ConfigTranslationValueView ¶
ConfigTranslationValueView holds a translation value for a specific language.
type ConfigViewData ¶
type ConfigViewData struct {
Items []ConfigItemView
TranslatableItems []TranslatableConfigItemView
Errors map[string]string
HasMultipleLanguages bool
}
ConfigViewData holds all data for the config page.
type ConflictStrategyView ¶
ConflictStrategyView holds a conflict strategy option.
type DashboardData ¶
type DashboardData struct {
Stats DashboardStats
RecentSubmissions []RecentSubmission
WebhookHealth []WebhookHealthItem
RecentFailedDeliveries []RecentFailedDelivery
TranslationCoverage []TranslationCoverage
RecentActivity []ActivityItem
}
DashboardData holds the data for the dashboard page.
type DashboardStats ¶
type DashboardStats struct {
TotalPages int64
PublishedPages int64
DraftPages int64
TotalUsers int64
TotalMedia int64
TotalForms int64
UnreadSubmissions int64
ActiveLanguages int64
TotalWebhooks int64
FailedDeliveries24h int64
CacheHitRate float64
CacheItems int64
}
DashboardStats holds dashboard statistics.
type DocsEndpointGroupView ¶
type DocsEndpointGroupView struct {
Name string
Endpoints []DocsEndpointView
}
DocsEndpointGroupView groups related endpoints.
type DocsEndpointView ¶
DocsEndpointView describes a single API/route endpoint.
type DocsGuideView ¶
DocsGuideView represents a documentation guide link.
type DocsGuideViewData ¶
type DocsGuideViewData struct {
Title string
Content string // Trusted HTML content from local markdown files
}
DocsGuideViewData holds data for a single guide page.
type DocsSystemInfoView ¶
type DocsSystemInfoView struct {
Version string
GitCommit string
BuildTime string
GoVersion string
Environment string
ServerPort int
DBPath string
ActiveTheme string
CacheType string
EnabledModules int
TotalModules int
Uptime string
}
DocsSystemInfoView holds system-level information for display.
type DocsViewData ¶
type DocsViewData struct {
System DocsSystemInfoView
Endpoints []DocsEndpointGroupView
Guides []DocsGuideView
}
DocsViewData holds all data for the docs overview page.
type EventItem ¶
type EventItem struct {
ID int64
Level string // "info", "warning", "error"
Category string
Message string
Details string // Formatted metadata
DetailsLong bool // True if details > 80 chars
IPAddress string // Masked in demo mode (for display)
RawIPAddress string // Unmasked (for ban button data-ip)
IsOwnIP bool
IsBanned bool // Pre-computed sentinel state
IsWhitelisted bool // Pre-computed sentinel state
RequestURL string
CreatedAt string
UserName string
}
EventItem holds data for a single event row.
type EventsListData ¶
type EventsListData struct {
Events []EventItem
TotalEvents int64
Level string // Current level filter
Category string // Current category filter
Levels []string
Categories []string
SentinelActive bool
Pagination PaginationData
}
EventsListData holds all data for the events list page.
type FormFieldView ¶
type FormFieldView struct {
ID int64 `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Label string `json:"label"`
Placeholder string `json:"placeholder"`
HelpText string `json:"help_text"`
Options string `json:"options"`
Validation string `json:"validation"`
IsRequired bool `json:"is_required"`
}
FormFieldView represents a form field for JSON serialization.
type FormFormViewData ¶
type FormFormViewData struct {
IsEdit bool
FormID int64
FormName string
FormSlug string
FormTitle string
FormDescription string
SuccessMessage string
EmailTo string
IsActive bool
LanguageCode string
Fields []FormFieldView
FieldTypes []string
Errors map[string]string
FormValues map[string]string
// Language/Translation
HasMultipleLanguages bool
AllLanguages []LanguageOption
Language *LanguageOption
Translations []FormTranslationInfoView
MissingLanguages []LanguageOption
HcaptchaEnabled bool
FieldsJSON string
FieldTypesJSON string
IsDemoMode bool
}
FormFormViewData holds data for the form create/edit page.
type FormListItemView ¶
type FormListItemView struct {
ID int64
Name string
Title string
Slug string
LanguageCode string
IsActive bool
SubmissionCount int64
UnreadCount int64
}
FormListItemView represents a form in the list.
type FormTranslationInfoView ¶
type FormTranslationInfoView struct {
LanguageCode string
LanguageName string
FormID int64
FormName string
}
FormTranslationInfoView holds info about a form translation.
type FormsListViewData ¶
type FormsListViewData struct {
Forms []FormListItemView
}
FormsListViewData holds data for the forms list page.
type HookHandlerViewItem ¶
HookHandlerViewItem holds data for a hook handler.
type HookViewItem ¶
type HookViewItem struct {
Name string
Handlers []HookHandlerViewItem
}
HookViewItem holds data for a hook in the list view.
type ImportErrorView ¶
ImportErrorView holds a single import error.
type ImportResultView ¶
type ImportResultView struct {
Success bool
DryRun bool
TotalCreated int
TotalUpdated int
TotalSkipped int
Created map[string]int
Updated map[string]int
Skipped map[string]int
Errors []ImportErrorView
}
ImportResultView holds the result of an import operation.
type ImportUploadedDataView ¶
type ImportUploadedDataView struct {
HasPages bool
HasCategories bool
HasTags bool
HasMedia bool
HasMenus bool
HasForms bool
HasUsers bool
HasLanguages bool
HasConfig bool
}
ImportUploadedDataView holds flags for what data is in the uploaded file.
type ImportViewData ¶
type ImportViewData struct {
ConflictStrategies []ConflictStrategyView
ValidationResult *ValidationResultView
ImportResult *ImportResultView
UploadedData *ImportUploadedDataView
IsZipFile bool
HasMediaFiles bool
}
ImportViewData holds data for the import page.
type LangOption ¶
LangOption represents a language option for the admin UI language switcher.
type LanguageFormData ¶
type LanguageFormData struct {
IsEdit bool
Language *LanguageInfo
CommonLanguages []CommonLanguageOption
Errors map[string]string
FormValues map[string]string
}
LanguageFormData holds all data for the language create/edit form.
type LanguageInfo ¶
type LanguageInfo struct {
ID int64
Code string
Name string
NativeName string
Direction string
IsDefault bool
IsActive bool
Position int64
CreatedAt time.Time
UpdatedAt time.Time
}
LanguageInfo holds individual language data for the form.
type LanguageListItem ¶
type LanguageListItem struct {
ID int64
Code string
Name string
NativeName string
Direction string
IsDefault bool
IsActive bool
Position int64
}
LanguageListItem holds data for a language in the list view.
type LanguageOption ¶
LanguageOption holds language selector option data.
type LanguagesListData ¶
type LanguagesListData struct {
Languages []LanguageListItem
TotalLanguages int64
}
LanguagesListData holds all data for the languages list page.
type LoginData ¶
type LoginData struct {
Title string
AdminLang string
Flash string
FlashType string
LangOptions []LangOption
HcaptchaEnabled bool
HcaptchaWidget string
}
LoginData holds data for the login page.
type MediaEditViewData ¶
type MediaEditViewData struct {
Media MediaItemView
Variants []MediaVariantView
Folders []MediaFolderView
CurrentFolderID int64
HasCurrentFolder bool
Languages []MediaLanguageView
Translations map[string]MediaTranslationView
Errors map[string]string
FormValues map[string]string
}
MediaEditViewData holds data for the media edit page.
type MediaFolderView ¶
MediaFolderView represents a media folder.
type MediaItemView ¶
type MediaItemView struct {
ID int64
Filename string
Alt string
ThumbnailURL string
OriginalURL string
IsImage bool
TypeIcon string // "video", "file-text", "file"
Size string // formatted bytes
MimeType string
Width int64
Height int64
HasDimensions bool
CreatedAt string
UUID string
FolderID int64
HasFolderID bool
}
MediaItemView represents a media item with computed fields.
type MediaLanguageView ¶
MediaLanguageView represents a language for media translations.
type MediaLibraryViewData ¶
type MediaLibraryViewData struct {
Media []MediaItemView
Folders []MediaFolderView
TotalCount int64
Filter string
FolderID *int64
Search string
Pagination PaginationData
}
MediaLibraryViewData holds data for the media library page.
type MediaTranslationView ¶
MediaTranslationView holds translation data for display.
type MediaUploadViewData ¶
type MediaUploadViewData struct {
Folders []MediaFolderView
MaxSize int64
MaxSizeFormatted string
AllowedExt string
FormatsHint string
}
MediaUploadViewData holds data for the media upload page.
type MediaVariantView ¶
type MediaVariantView struct {
Type string
TypeLabel string
Width int64
Height int64
Size string // formatted bytes
}
MediaVariantView represents an image variant.
type MenuFormData ¶
type MenuFormData struct {
IsEdit bool
Menu *MenuInfo
ItemsJSON string // Pre-serialized JSON for Alpine.js data-items attribute
Pages []MenuPageItem
Targets []string
Languages []LanguageOption
Errors map[string]string
FormValues map[string]string
}
MenuFormData holds all data for the menu create/edit form.
type MenuListItem ¶
type MenuListItem struct {
ID int64
Name string
Slug string
LanguageCode string
UpdatedAt time.Time
IsProtected bool // true when slug == "main" || slug == "footer"
}
MenuListItem holds data for a menu in the list view.
type MenuPageItem ¶
MenuPageItem holds page data for the add-pages section.
type MenusListData ¶
type MenusListData struct {
Menus []MenuListItem
}
MenusListData holds all data for the menus list page.
type ModuleViewItem ¶
type ModuleViewItem struct {
Name string
Version string
Description string
AdminURL string
Active bool
ShowInSidebar bool
HasMigrations bool
MigrationsApplied int
MigrationCount int
MigrationsPending int
IsEmbedded bool
}
ModuleViewItem holds data for a module in the list view.
type ModulesViewData ¶
type ModulesViewData struct {
Modules []ModuleViewItem
Hooks []HookViewItem
}
ModulesViewData holds all data for the modules list page.
type PageCategoryNodeView ¶
PageCategoryNodeView represents a category with depth for tree display.
type PageCategoryView ¶
type PageCategoryView struct {
Name string
}
PageCategoryView represents a category in the pages list.
type PageContext ¶
type PageContext struct {
Title string
User UserInfo
Flash string
FlashType string
SiteName string
CurrentPath string
AdminLang string
LangOptions []LangOption
Breadcrumbs []Breadcrumb
SidebarModules []SidebarModule
}
PageContext carries shared data for all admin templ views.
func (*PageContext) HasPrefix ¶
func (pc *PageContext) HasPrefix(prefix string) bool
HasPrefix returns true if the current path starts with the given prefix.
func (*PageContext) IsActive ¶
func (pc *PageContext) IsActive(path string) bool
IsActive returns true if the given path matches the current path.
func (*PageContext) IsAdmin ¶
func (pc *PageContext) IsAdmin() bool
IsAdmin returns true if the user has admin role.
func (*PageContext) IsEditor ¶
func (pc *PageContext) IsEditor() bool
IsEditor returns true if the user has at least editor role.
func (*PageContext) T ¶
func (pc *PageContext) T(key string, args ...any) string
T translates a key using the admin language.
func (*PageContext) TDefault ¶
func (pc *PageContext) TDefault(key string, defaultVal string) string
TDefault translates a key, falling back to defaultVal if the key is not found.
func (*PageContext) UserInitial ¶
func (pc *PageContext) UserInitial() string
UserInitial returns the first character of the user's name for avatar.
type PageFeaturedImageView ¶
type PageFeaturedImageView struct {
Thumbnail string
}
PageFeaturedImageView holds featured image data for display.
type PageFormAliasView ¶
PageFormAliasView holds alias data for the form.
type PageFormCategoryView ¶
type PageFormCategoryView struct {
ID int64 `json:"id"`
}
PageFormCategoryView holds category data for the form category selector.
type PageFormFeaturedImageView ¶
type PageFormFeaturedImageView struct {
ID int64 `json:"id"`
Filename string `json:"filename"`
Filepath string `json:"filepath"`
Thumbnail string `json:"thumbnail"`
Mimetype string `json:"mimetype"`
}
PageFormFeaturedImageView holds featured image data for the form.
type PageFormTagView ¶
type PageFormTagView struct {
ID int64 `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
}
PageFormTagView holds tag data for the form tag selector.
type PageFormViewData ¶
type PageFormViewData struct {
IsEdit bool
PageID int64
PageTitle string
PageSlug string
PageBody string
PageStatus string
PageType string
Statuses []string
PageTypes []string
AllCategories []PageCategoryNodeView
Tags []PageFormTagView
Categories []PageFormCategoryView
FeaturedImage *PageFormFeaturedImageView
Aliases []PageFormAliasView
Errors map[string]string
FormValues map[string]string
// Language/Translation
HasMultipleLanguages bool
AllLanguages []LanguageOption
Language *LanguageOption
Translations []PageTranslationView
MissingLanguages []LanguageOption
// SEO
MetaTitle string
MetaDescription string
MetaKeywords string
OgImageID string
CanonicalURL string
NoIndex bool
NoFollow bool
// Scheduling
ScheduledAt string
HasScheduledAt bool
ScheduledAtFmt string
// Checkboxes
HideFeaturedImage bool
ExcludeFromLists bool
IsDemoMode bool
}
PageFormViewData holds data for the page form page.
type PageLanguageView ¶
PageLanguageView represents a language badge.
type PageListItemView ¶
type PageListItemView struct {
ID int64
Title string
Slug string
Status string
IsScheduled bool
ScheduledAtTitle string
UpdatedAt string
FeaturedImage *PageFeaturedImageView
Tags []PageTagView
Categories []PageCategoryView
Language *PageLanguageView
IsDemoPublished bool // true if demo mode AND status=published
}
PageListItemView represents a page in the list.
type PageTagView ¶
type PageTagView struct {
Name string
}
PageTagView represents a tag in the pages list.
type PageTranslationView ¶
type PageTranslationView struct {
Language LanguageOption
PageID int64
Title string
Status string
}
PageTranslationView holds translation info for the form.
type PageVersionView ¶
type PageVersionView struct {
ID int64
Title string
Body string
ChangedByName string
CreatedAt string
}
PageVersionView represents a version in the list.
type PageVersionsViewData ¶
type PageVersionsViewData struct {
PageID int64
PageTitle string
TotalCount int64
Versions []PageVersionView
Pagination PaginationData
}
PageVersionsViewData holds data for the versions page.
type PagesListViewData ¶
type PagesListViewData struct {
Pages []PageListItemView
TotalCount int64
StatusFilter string
CategoryFilter int64
LanguageFilter string
SearchFilter string
AllCategories []PageCategoryNodeView
AllLanguages []LanguageOption
Statuses []string
Pagination PaginationData
IsDemoMode bool
}
PagesListViewData holds data for the pages list page.
type PaginationBulkAction ¶ added in v0.10.0
PaginationBulkAction configures optional bulk actions for list pages.
type PaginationData ¶
type PaginationData struct {
CurrentPage int
TotalPages int
TotalItems int64
BaseURL string
QueryString string
SortField string
SortDir string
HasFirst bool
HasPrev bool
HasNext bool
HasLast bool
FirstURL string
PrevURL string
NextURL string
LastURL string
Pages []PaginationPage
BulkAction *PaginationBulkAction
PerPageSelector *PaginationPerPageSelector
}
PaginationData holds pagination state for admin list views. This is a view-layer type to avoid circular imports with the handler package.
func (PaginationData) BulkScope ¶ added in v0.10.0
func (p PaginationData) BulkScope() string
BulkScope returns the configured bulk scope or empty string.
func (PaginationData) HasBulkAction ¶ added in v0.10.0
func (p PaginationData) HasBulkAction() bool
HasBulkAction returns true if pager bulk actions are enabled.
func (PaginationData) HasPerPageSelector ¶ added in v0.10.0
func (p PaginationData) HasPerPageSelector() bool
HasPerPageSelector returns true if the items-per-page selector should be shown.
func (PaginationData) PageURL ¶ added in v0.10.0
func (p PaginationData) PageURL(page int) string
PageURL returns the URL for a specific page number.
func (PaginationData) ShouldShow ¶
func (p PaginationData) ShouldShow() bool
ShouldShow returns true if pagination should be displayed.
func (PaginationData) SortState ¶ added in v0.10.0
func (p PaginationData) SortState(field string) string
SortState returns "asc", "desc", or "none" for the given sortable field.
func (PaginationData) SortURL ¶ added in v0.10.0
func (p PaginationData) SortURL(field, defaultDir string) string
SortURL returns a URL for sorting by the given field. Clicking the active field toggles direction; changing field uses defaultDir. Sort changes always reset page=1.
type PaginationPage ¶
PaginationPage represents a single page link.
type PaginationPerPageSelector ¶ added in v0.10.0
PaginationPerPageSelector configures an optional items-per-page selector.
type PermissionGroup ¶
type PermissionGroup struct {
TitleKey string // i18n key for the group title
Permissions []PermissionOption
}
PermissionGroup represents a group of related permissions.
type PermissionOption ¶
type PermissionOption struct {
Value string
DescKey string // i18n key for the description
Checked bool
}
PermissionOption represents a single permission checkbox.
type RecentFailedDelivery ¶
type RecentFailedDelivery struct {
WebhookID int64
WebhookName string
Event string
Status string
CreatedAt string
}
RecentFailedDelivery holds failed delivery data.
type RecentSubmission ¶
RecentSubmission holds form submission data.
type RedirectFormData ¶
type RedirectFormData struct {
IsEdit bool
Redirect *RedirectInfo
StatusCodes []RedirectStatusCodeOption
TargetTypes []string
Errors map[string]string
FormValues map[string]string
}
RedirectFormData holds all data for the redirect create/edit form.
type RedirectInfo ¶
type RedirectInfo struct {
ID int64
SourcePath string
TargetURL string
StatusCode int64
IsWildcard bool
TargetType string
Enabled bool
CreatedAt time.Time
UpdatedAt time.Time
}
RedirectInfo holds individual redirect data for the form.
type RedirectListItem ¶
type RedirectListItem struct {
ID int64
SourcePath string
TargetURL string
StatusCode int64
IsWildcard bool
TargetType string
Enabled bool
}
RedirectListItem holds data for a redirect in the list view.
type RedirectStatusCodeOption ¶
RedirectStatusCodeOption represents a status code option for the form select.
type RedirectsListData ¶
type RedirectsListData struct {
Redirects []RedirectListItem
TotalCount int64
}
RedirectsListData holds all data for the redirects list page.
type SchedulerJobViewItem ¶
type SchedulerJobViewItem struct {
Source string
Name string
Description string
DefaultSchedule string
Schedule string
IsOverridden bool
LastRun string
NextRun string
CanTrigger bool
}
SchedulerJobViewItem represents a system job in the scheduler list.
type SchedulerListViewData ¶
type SchedulerListViewData struct {
Jobs []SchedulerJobViewItem
Tasks []SchedulerTaskViewItem
IsDemoMode bool
}
SchedulerListViewData holds all data for the scheduler list page.
type SchedulerTaskFormViewData ¶
type SchedulerTaskFormViewData struct {
TaskID int64
Name string
URL string
Schedule string
TimeoutSeconds int64
IsEdit bool
IsDemoMode bool
}
SchedulerTaskFormViewData holds data for the task form page.
type SchedulerTaskRunView ¶
type SchedulerTaskRunView struct {
Status string
StatusCode int64
HasStatusCode bool
DurationMs int64
HasDuration bool
StartedAt string
ErrorMessage string
HasErrorMessage bool
}
SchedulerTaskRunView represents a single task run.
type SchedulerTaskRunsViewData ¶
type SchedulerTaskRunsViewData struct {
TaskID int64
TaskName string
TaskURL string
TaskSchedule string
TaskTimeout int64
TaskIsActive bool
TotalCount int64
Runs []SchedulerTaskRunView
Pagination PaginationData
IsDemoMode bool
}
SchedulerTaskRunsViewData holds data for the task runs page.
type SchedulerTaskViewItem ¶
type SchedulerTaskViewItem struct {
ID int64
Name string
URL string
Schedule string
IsActive bool
LastRun string
}
SchedulerTaskViewItem represents a custom task in the scheduler list.
type SidebarModule ¶
SidebarModule represents a module sidebar entry.
type StatCardProps ¶ added in v0.10.0
type StatCardProps struct {
Href string // optional link wrapper
Label string
Value string
IconClass string // icon container bg/text color classes
Highlight bool // warning border variant
}
StatCardProps configures a stat card with icon, value, and label.
type StatusBannerProps ¶ added in v0.10.0
type StatusBannerProps struct {
Title string // e.g. "In-Memory Cache", "Redis Cache"
Healthy bool // green or red status dot
StatusText string // e.g. "Healthy" or error message
Detail string // optional detail line (e.g. Redis URL)
Class string // optional wrapper class
}
StatusBannerProps configures a service/backend status banner.
type SubmissionFieldView ¶
SubmissionFieldView represents a field in the submission view.
type SubmissionItemView ¶
type SubmissionItemView struct {
ID int64
Preview string
CreatedAt string
IPAddress string
IsRead bool
}
SubmissionItemView represents a submission in the list.
type SubmissionViewViewData ¶
type SubmissionViewViewData struct {
FormID int64
FormName string
SubmissionID int64
CreatedAt string
IPAddress string
UserAgent string
Fields []SubmissionFieldView
RawJSON string
}
SubmissionViewViewData holds data for viewing a single submission.
type SubmissionsListViewData ¶
type SubmissionsListViewData struct {
FormID int64
FormName string
FormSlug string
TotalCount int64
UnreadCount int64
Submissions []SubmissionItemView
Pagination PaginationData
IsDemoMode bool
}
SubmissionsListViewData holds data for the submissions list page.
type TagFormData ¶
type TagFormData struct {
IsEdit bool
Tag *TagItem
AllLanguages []LanguageOption
Language *LanguageOption
Translations []TagTranslation
MissingLanguages []LanguageOption
FormValues map[string]string
Errors map[string]string
}
TagFormData holds all data for the tag create/edit form.
type TagListItem ¶
type TagListItem struct {
ID int64
Name string
Slug string
LanguageCode string
UsageCount int64
CreatedAt time.Time
}
TagListItem holds data for a tag in the list view.
type TagTranslation ¶
type TagTranslation struct {
Tag TagItem
Language LanguageOption
}
TagTranslation holds data for a tag translation.
type TagsListData ¶
type TagsListData struct {
Tags []TagListItem
TotalCount int64
Pagination PaginationData
LanguageFilter string
SearchFilter string
AllLanguages []LanguageOption
}
TagsListData holds all data for the tags list page.
type ThemeSettingView ¶
type ThemeSettingView struct {
Key string
Label string
Type string
Default string
Options []string
Value string
Error string
}
ThemeSettingView holds data for a single theme setting in the settings form.
type ThemeSettingsViewData ¶
type ThemeSettingsViewData struct {
ThemeName string
ThemeConfigName string
IsActive bool
Settings []ThemeSettingView
IsDemoMode bool
}
ThemeSettingsViewData holds all data for the theme settings page.
type ThemeViewItem ¶
type ThemeViewItem struct {
Name string
ConfigName string
ConfigVersion string
ConfigAuthor string
ConfigDescription string
ConfigScreenshot string
IsActive bool
IsEmbedded bool
HasSettings bool
SettingsURL string
}
ThemeViewItem holds data for a single theme in the list view.
type ThemesListData ¶
type ThemesListData struct {
Themes []ThemeViewItem
}
ThemesListData holds all data for the themes list page.
type TranslatableConfigItemView ¶
type TranslatableConfigItemView struct {
Key string
Label string
Description string
Type string
Translations []ConfigTranslationValueView
}
TranslatableConfigItemView holds a translatable config item with translations.
type TranslationCoverage ¶
TranslationCoverage holds translation coverage data.
type UserFormData ¶
type UserFormData struct {
IsEdit bool
User *UserItem
Roles []string
FormValues map[string]string
Errors map[string]string
}
UserFormData holds all data for the user create/edit form.
type UserListItem ¶
type UserListItem struct {
ID int64
Name string
Email string
Role string
CreatedAt time.Time
LastLoginAt *time.Time
IsCurrentUser bool
}
UserListItem holds data for a user in the list view.
type UsersListData ¶
type UsersListData struct {
Users []UserListItem
TotalCount int64
Pagination PaginationData
}
UsersListData holds all data for the users list page.
type ValidationErrorView ¶
ValidationErrorView holds a single validation error.
type ValidationResultView ¶
type ValidationResultView struct {
Valid bool
Entities map[string]int
Conflicts map[string][]string
Errors []ValidationErrorView
}
ValidationResultView holds the result of import file validation.
type WebhookDeliveriesViewData ¶
type WebhookDeliveriesViewData struct {
WebhookID int64
WebhookName string
Deliveries []WebhookDeliveryView
TotalCount int64
Pagination PaginationData
}
WebhookDeliveriesViewData holds data for the deliveries page.
type WebhookDeliveryView ¶
type WebhookDeliveryView struct {
ID int64
Event string
Status string
Attempts int64
ResponseCode int64
HasResponseCode bool
ErrorMessage string
HasErrorMessage bool
Payload string
ResponseBody string
HasResponseBody bool
CreatedAt string
DeliveredAt string
HasDeliveredAt bool
NextRetryAt string
HasNextRetryAt bool
UpdatedAt string
CanRetry bool
}
WebhookDeliveryView represents a single delivery.
type WebhookEventInfoView ¶
WebhookEventInfoView represents a webhook event type for the form.
type WebhookFormViewData ¶
type WebhookFormViewData struct {
WebhookID int64
IsEdit bool
Events []WebhookEventInfoView
Errors map[string]string
FormValues map[string]string
FormEvents []string
FormHeaders map[string]string
CreatedAt string
UpdatedAt string
}
WebhookFormViewData holds data for the webhook form page.
type WebhookHealthItem ¶
WebhookHealthItem holds webhook health data.
type WebhookListItemView ¶
type WebhookListItemView struct {
ID int64
Name string
URL string
Events []string
IsActive bool
TotalDelivered int64
TotalPending int64
TotalDead int64
SuccessRate float64
HealthStatus string
LastSuccessfulAt string
HasLastSuccessfulAt bool
}
WebhookListItemView represents a webhook in the list.
type WebhooksListViewData ¶
type WebhooksListViewData struct {
Webhooks []WebhookListItemView
TotalWebhooks int64
}
WebhooksListViewData holds data for the webhooks list page.
type WidgetAreaView ¶
type WidgetAreaView struct {
AreaID string
AreaName string
AreaDescription string
Widgets []WidgetItemView
}
WidgetAreaView represents a widget area with its widgets.
type WidgetItemView ¶
WidgetItemView represents a single widget in a widget area.
type WidgetTypeView ¶
WidgetTypeView represents a widget type option.
type WidgetsViewData ¶
type WidgetsViewData struct {
ThemeName string
WidgetAreas []WidgetAreaView
WidgetTypes []WidgetTypeView
}
WidgetsViewData holds all data for the widgets list page.
Source Files
¶
- actions_templ.go
- api_keys_templ.go
- cache_templ.go
- categories_templ.go
- config_templ.go
- context.go
- dashboard_templ.go
- docs_templ.go
- events_templ.go
- forms_templ.go
- header_templ.go
- icons_templ.go
- importexport_templ.go
- languages_templ.go
- layout_templ.go
- login_templ.go
- media_templ.go
- menus_templ.go
- modules_templ.go
- pages_templ.go
- pagination_templ.go
- redirects_templ.go
- scheduler_templ.go
- sidebar_templ.go
- statcard_templ.go
- statusbanner_templ.go
- tags_templ.go
- themes_templ.go
- users_templ.go
- webhooks_templ.go
- widgets_templ.go