Documentation ¶
Index ¶
- func AddContent(page *onthefly.Page, contentTitle, contentHTML string) (*onthefly.Tag, error)
- func AddFooter(page *onthefly.Page, footerText, footerTextColor, footerColor string, ...) (*onthefly.Tag, error)
- func AddIfNotAdded(url string, filteredMenuEntries *MenuEntries, menuEntry *MenuEntry)
- func AddMenuBox(page *onthefly.Page, darkBackgroundTexture string, customSansSerif string) (*onthefly.Tag, error)
- func AddSearchBox(tag *onthefly.Tag, actionURL, buttonText string, roundedLook bool) *onthefly.Tag
- func AddTitleBox(tag *onthefly.Tag, title, subtitle string, cs *ColorScheme) *onthefly.Tag
- func AddTopBox(page *onthefly.Page, ...) (*onthefly.Tag, error)
- func ConfirmationEmail(domain, link, username, email string) error
- func GenerateHTMLwithTemplate(page *onthefly.Page, tvg webhandle.TemplateValueGenerator) func(http.ResponseWriter, *http.Request)
- func GenerateMenuCSS(state pinterface.IUserState, stretchBackground bool, cs *ColorScheme) func(http.ResponseWriter, *http.Request)
- func HasEntry(checkEntry *MenuEntry, menuEntries MenuEntries) bool
- func MenuSnippet(menuEntries MenuEntries) *onthefly.Page
- func PublishCPs(r *mux.Router, userState pinterface.IUserState, pc PageCollection, ...)
- func RenderPage(page *onthefly.Page, templateContents map[string]string) (string, string)
- func ServeSite(r *mux.Router, basecp BaseCP, userState pinterface.IUserState, ...)
- func TemplateValueGeneratorCombinator(tvg1, tvg2 webhandle.TemplateValueGenerator) webhandle.TemplateValueGenerator
- type BaseCP
- type CPgen
- type ColorScheme
- type ContentPage
- func (cp *ContentPage) Pub(r *mux.Router, userState pinterface.IUserState, url, cssurl string, ...)
- func (cp *ContentPage) Surround(s string, templateContents map[string]string) (string, string)
- func (cp *ContentPage) WrapSimpleContextHandle(r *mux.Router, sch func(w http.ResponseWriter, req *http.Request) string, ...) func(w http.ResponseWriter, req *http.Request)
- func (cp *ContentPage) WrapWebHandle(r *mux.Router, wh func(string) string, tvg webhandle.TemplateValueGenerator) func(string, http.ResponseWriter, *http.Request)
- type MenuEntries
- type MenuEntry
- type PageCollection
- type TemplateValueGeneratorFactory
- type UserInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContent ¶
func AddFooter ¶
func AddFooter(page *onthefly.Page, footerText, footerTextColor, footerColor string, elapsed time.Duration) (*onthefly.Tag, error)
TODO: Place at the bottom of the content instead of at the bottom of the window
func AddIfNotAdded ¶
func AddIfNotAdded(url string, filteredMenuEntries *MenuEntries, menuEntry *MenuEntry)
func AddMenuBox ¶
func AddMenuBox(page *onthefly.Page, darkBackgroundTexture string, customSansSerif string) (*onthefly.Tag, error)
Takes a page and a colon-separated string slice of text:url, hiddenlinks is just a list of the url part
func AddSearchBox ¶
Add a search box to the page, actionURL is the url to use as a get action, buttonText is the text on the search button
func AddTitleBox ¶
func ConfirmationEmail ¶
func GenerateHTMLwithTemplate ¶
func GenerateHTMLwithTemplate(page *onthefly.Page, tvg webhandle.TemplateValueGenerator) func(http.ResponseWriter, *http.Request)
Create a web.go compatible function that returns a string that is the HTML for this page
func GenerateMenuCSS ¶
func GenerateMenuCSS(state pinterface.IUserState, stretchBackground bool, cs *ColorScheme) func(http.ResponseWriter, *http.Request)
CSS for the menu, and a bit more
func HasEntry ¶
func HasEntry(checkEntry *MenuEntry, menuEntries MenuEntries) bool
Checks if a *MenuEntry exists in a []*MenuEntry (MenuEntries)
func MenuSnippet ¶
func MenuSnippet(menuEntries MenuEntries) *onthefly.Page
Generate tags for the menu based on a list of "MenuDescription:/menu/url"
func PublishCPs ¶
func PublishCPs(r *mux.Router, userState pinterface.IUserState, pc PageCollection, cs *ColorScheme, tvgf TemplateValueGeneratorFactory, cssurl string)
Publish a list of ContentPages, a colorscheme and template content
func RenderPage ¶
Render a page by inserting data at the {{{placeholders}}} for both html and css
func ServeSite ¶
func ServeSite(r *mux.Router, basecp BaseCP, userState pinterface.IUserState, cps PageCollection, tvgf TemplateValueGeneratorFactory, jquerypath string)
Some Engines like Admin must be served separately jquerypath is ie "/js/jquery.2.0.0.js", will then serve the file at static/js/jquery.2.0.0.js
func TemplateValueGeneratorCombinator ¶
func TemplateValueGeneratorCombinator(tvg1, tvg2 webhandle.TemplateValueGenerator) webhandle.TemplateValueGenerator
Combines two TemplateValueGenerators into one TemplateValueGenerator by adding the strings per key
Types ¶
type ColorScheme ¶
type ContentPage ¶
type ContentPage struct { GeneratedCSSurl string ExtraCSSurls []string JqueryJSurl string Faviconurl string BgImageURL string StretchBackground bool Title string Subtitle string ContentTitle string ContentHTML string HeaderJS string ContentJS string SearchButtonText string SearchURL string BackgroundTextureURL string DarkBackgroundTextureURL string UserState pinterface.IUserState RoundedLook bool Url string ColorScheme *ColorScheme SearchBox bool GoogleFonts []string CustomSansSerif string CustomSerif string }
The main structure, defining the look and feel of the page
func DefaultCP ¶
func DefaultCP(userState pinterface.IUserState) *ContentPage
The default settings Do not publish this page directly, but use it as a basis for the other pages
func (*ContentPage) Pub ¶
func (cp *ContentPage) Pub(r *mux.Router, userState pinterface.IUserState, url, cssurl string, cs *ColorScheme, tvg webhandle.TemplateValueGenerator)
Make an html and css page available
func (*ContentPage) WrapSimpleContextHandle ¶
func (cp *ContentPage) WrapSimpleContextHandle(r *mux.Router, sch func(w http.ResponseWriter, req *http.Request) string, tvg webhandle.TemplateValueGenerator) func(w http.ResponseWriter, req *http.Request)
Uses a given SimpleContextHandle as the contents for the the ContentPage contents
func (*ContentPage) WrapWebHandle ¶
func (cp *ContentPage) WrapWebHandle(r *mux.Router, wh func(string) string, tvg webhandle.TemplateValueGenerator) func(string, http.ResponseWriter, *http.Request)
Uses a given WebHandle as the contents for the the ContentPage contents
type MenuEntries ¶
type MenuEntries []*MenuEntry
func Links2menuEntries ¶
func Links2menuEntries(links []string) MenuEntries
type MenuEntry ¶
type MenuEntry struct {
// contains filtered or unexported fields
}
func NewMenuEntry ¶
Takes something like "Admin:/admin" and returns a *MenuEntry
type TemplateValueGeneratorFactory ¶
type TemplateValueGeneratorFactory func(pinterface.IUserState) webhandle.TemplateValueGenerator
func DynamicMenuFactoryGenerator ¶
func DynamicMenuFactoryGenerator(menuEntries MenuEntries) TemplateValueGeneratorFactory
- Functions that generate functions that generate content that can be used in templates.
- type TemplateValues map[string]string
- type TemplateValueGenerator func(*web.Context) TemplateValues
- type TemplateValueGeneratorFactory func(*UserState) TemplateValueGenerator
TODO: Take the same parameters as the old menu generating code TODO: Put one if these in each engine then combine them somehow TODO: Check for the menyEntry.url first, then check the rights, not the other way around TODO: Fix and refactor this one TODO: Check the user status _once_, and the admin status _once_, then generate the menu TODO: Some way of marking menu entries as user, admin or other rights. Add a group system?