pageadmin

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package pageadmin is the Pages section of the admin: the page tree, where editors add, move and publish pages and place modules on them, and the editor of each page, built with package editor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	tree *pages.Service,
	provider locales.Provider,
	accounts *auth.Service,
	site *frontend.Frontend,
	modules func() []Module,
	check *links.Check,
) admin.Section

New returns the Pages section of the admin: the page tree with an editor per page. accounts names the authors in the history, site links to previews, modules lists the module instances a page may show, and check knows the links to pages: the editor of a published page lists the content that links to it and offers redirects (see links.Check), and the report "admin.pages.links" lists the links that lead nowhere.

Types

type BrokenRow

type BrokenRow struct {
	Address string
	// Reason says why nothing answers there; it is a translation key.
	Reason string
	// Page is the page with the address that is not published, or is in
	// the trash, linked to its editor or to the trash; nil when no page has
	// the address.
	Page *editor.NoticeItem
	// Sources are the content that links to the address, linked to its
	// editor.
	Sources []editor.NoticeItem
	// Redirect redirects the address to a page; nil without a module that
	// redirects.
	Redirect *form.RenderModel
}

BrokenRow is an address that published content links to and that the website does not answer, with the content that links there.

type LinksView

type LinksView struct {
	Title   string
	BackURL string
	Rows    []BrokenRow
	// Redirects is set when the site has a module that redirects old
	// addresses and the user may add redirects to it.
	Redirects bool
	// Hint tells, without Redirects, what redirecting an address here
	// needs: the Redirects module, or the right to create redirects; it is
	// a translation key.
	Hint string
}

LinksView is the report of the broken links: the addresses that links in published content lead to and that the website does not answer.

type Module

type Module struct {
	Key   string
	Title string
}

Module is a module instance that can be placed on a page.

type Move

type Move = admin.Move

Move is a button that moves a page among its siblings with a POST to URL. URL is empty at the first or last place, where the button is disabled. It is the admin's shared arrow, shown with the "admin-moves" template.

type TreeRow

type TreeRow struct {
	Title string
	URL   string
	// Path is the page's path in the shown language, empty while a slug on
	// the way is missing.
	Path string
	// Status is the publication state, as the other editors' overviews
	// name it (see editor.Status): Draft, In review, Published, Changes not
	// published or Scheduled.
	Status string
	// Module is the title of the module the page shows, if any.
	Module  string
	Home    bool
	Missing bool
	// Moves are the up and down buttons: for every page except Home, for
	// editors with the right to edit.
	Moves []Move
	// ID and ParentID let the browser tell where a dragged page lands.
	ID       string
	ParentID string
	// DragURL is where dragging the page posts its new place (see moveTo),
	// set with the up and down buttons.
	DragURL string
	// Leaf marks a module page, which cannot have child pages.
	Leaf bool
	// Match marks a page found by the search; the tree also shows the
	// pages above a match, without Match.
	Match    bool
	Children []TreeRow
}

TreeRow is one page in the overview, with the pages below it.

type TreeView

type TreeView struct {
	Title    string
	NewURL   string
	NewLabel string
	// TrashURL shows the deleted pages in the admin's trash.
	TrashURL string
	// LinksURL is the report of the links that lead nowhere.
	LinksURL string
	Tabs     []admin.LocaleTab
	// Pages holds Home with the tree below it, followed by pages whose
	// parent no longer exists.
	Pages []TreeRow
}

TreeView is the pages overview: the page tree in menu order.

Jump to

Keyboard shortcuts

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