pages

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package pages provides gomponent-based page templates for the CMS dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFieldPage

func AddFieldPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	allContentTypes []*core.ContentTypeSummaryDTO,
	err string,
) g.Node

AddFieldPage renders the add field form.

func Badge

func Badge(text, colorClass string) g.Node

Badge creates a status badge with custom color classes.

func Breadcrumbs(items ...BreadcrumbItem) g.Node

Breadcrumbs creates a breadcrumb navigation.

func CMSOverviewDynamic added in v0.0.15

func CMSOverviewDynamic(currentApp *app.App, basePath string) g.Node

CMSOverviewDynamic renders a dynamic CMS overview using bridge functions for client-side data fetching.

func CMSOverviewPage

func CMSOverviewPage(
	currentApp *app.App,
	basePath string,
	contentTypes []*core.ContentTypeSummaryDTO,
	stats *core.CMSStatsDTO,
) g.Node

CMSOverviewPage renders the CMS overview page with content types list (SSR version).

func Card

func Card(children ...g.Node) g.Node

Card creates a basic card container.

func CardWithHeader

func CardWithHeader(headerTitle string, headerActions []g.Node, body ...g.Node) g.Node

CardWithHeader creates a card with a header section.

func ComponentSchemaSelector

func ComponentSchemaSelector(components []*core.ComponentSchemaSummaryDTO, selectedName string) g.Node

ComponentSchemaSelector renders a select dropdown for choosing a component schema.

func ComponentSchemasPage

func ComponentSchemasPage(
	currentApp *app.App,
	basePath string,
	components []*core.ComponentSchemaSummaryDTO,
	page, pageSize, totalItems int,
	searchQuery string,
) g.Node

ComponentSchemasPage renders the component schemas list page.

func ConfirmButton

func ConfirmButton(formAction, method, text, confirmMessage, colorClass string, icon g.Node) g.Node

ConfirmButton creates a button that requires confirmation.

func ContentTypeDetailPage

func ContentTypeDetailPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	stats *core.ContentTypeStatsDTO,
	environmentID string,
	allContentTypes []*core.ContentTypeSummaryDTO,
	allComponentSchemas []*core.ComponentSchemaSummaryDTO,
) g.Node

ContentTypeDetailPage renders the content type detail/edit page.

func ContentTypesListDynamic added in v0.0.15

func ContentTypesListDynamic(currentApp *app.App, basePath string) g.Node

ContentTypesListDynamic renders a dynamic content types list using bridge functions This demonstrates how to use the CMS bridge functions from the frontend.

func ContentTypesListPage

func ContentTypesListPage(
	currentApp *app.App,
	basePath string,
	contentTypes []*core.ContentTypeSummaryDTO,
	page, pageSize, totalItems int,
	searchQuery string,
) g.Node

ContentTypesListPage renders the content types as a table.

func CreateComponentSchemaPage

func CreateComponentSchemaPage(
	currentApp *app.App,
	basePath string,
	errorMsg string,
) g.Node

CreateComponentSchemaPage renders the create component schema form.

func CreateContentTypePage

func CreateContentTypePage(
	currentApp *app.App,
	basePath string,
	err string,
) g.Node

CreateContentTypePage renders the create content type form.

func CreateEntryPage

func CreateEntryPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	err string,
) g.Node

CreateEntryPage renders the create entry form.

func DangerButton

func DangerButton(href, text string, icon g.Node) g.Node

DangerButton creates a danger/delete action button.

func DataTable

func DataTable(headers []string, rows []g.Node) g.Node

DataTable renders a data table.

func EditComponentSchemaPage

func EditComponentSchemaPage(
	currentApp *app.App,
	basePath string,
	component *core.ComponentSchemaDTO,
	errorMsg string,
) g.Node

EditComponentSchemaPage renders the edit component schema form.

func EditEntryPage

func EditEntryPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	entry *core.ContentEntryDTO,
	err string,
) g.Node

EditEntryPage renders the edit entry form.

func EditFieldPage

func EditFieldPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	allContentTypes []*core.ContentTypeSummaryDTO,
	field *core.ContentFieldDTO,
	err string,
) g.Node

EditFieldPage renders the edit field form.

func EmptyState

func EmptyState(icon g.Node, title, description, actionText, actionHref string) g.Node

EmptyState creates an empty state message.

func EntriesListDynamic added in v0.0.15

func EntriesListDynamic(currentApp *app.App, basePath string, typeName string) g.Node

EntriesListDynamic renders a dynamic entries list using bridge functions.

func EntriesListPage

func EntriesListPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	entries []*core.ContentEntryDTO,
	stats *core.ContentTypeStatsDTO,
	page, pageSize, totalItems int,
	searchQuery, statusFilter string,
) g.Node

EntriesListPage renders the entries list page for a content type.

func EntryDetailPage

func EntryDetailPage(
	currentApp *app.App,
	basePath string,
	contentType *core.ContentTypeDTO,
	entry *core.ContentEntryDTO,
	revisions []*core.ContentRevisionDTO,
) g.Node

EntryDetailPage renders the entry detail/view page.

func FormatTime

func FormatTime(t time.Time) string

FormatTime formats a time for display.

func FormatTimeAgo

func FormatTimeAgo(t time.Time) string

FormatTimeAgo formats a time as relative time.

func IconButton

func IconButton(href string, icon g.Node, title, colorClass string) g.Node

IconButton creates a small icon button.

func PageHeader(title, description string, actions ...g.Node) g.Node

PageHeader renders a standard page header with title, description, and optional actions.

func Pagination

func Pagination(currentPage, totalPages int, baseURL string) g.Node

Pagination renders pagination controls.

func PrimaryButton

func PrimaryButton(href, text string, icon g.Node) g.Node

PrimaryButton creates a primary action button.

func SearchInput

func SearchInput(placeholder, value, formAction string) g.Node

SearchInput creates a search input field.

func SecondaryButton

func SecondaryButton(href, text string, icon g.Node) g.Node

SecondaryButton creates a secondary action button.

func StatCard

func StatCard(title, value string, icon g.Node, colorClass string) g.Node

StatCard creates a statistics card.

func StatusBadge

func StatusBadge(status string) g.Node

StatusBadge creates a status-specific badge.

func TableCell

func TableCell(content g.Node) g.Node

TableCell creates a table cell.

func TableCellActions

func TableCellActions(actions ...g.Node) g.Node

TableCellActions creates a table cell with action buttons.

func TableCellSecondary

func TableCellSecondary(content g.Node) g.Node

TableCellSecondary creates a secondary table cell with muted text.

func TableRow

func TableRow(cells ...g.Node) g.Node

TableRow creates a table row.

Types

type BreadcrumbItem struct {
	Label string
	Href  string
}

BreadcrumbItem represents a breadcrumb item.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL