page

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path = "assets/templates"

Path defines the root at which to look for templates.

Functions

func RenderToString

func RenderToString(data DataBlock, group string, names ...string) (string, error)

RenderToString attempts to render a template (assets/templates/<name>.html.tmpl) to a string

Types

type AdminData

type AdminData struct {
	Section string
	AppUser struct {
		Email           string
		ProfileImageURL string
	}
}

AdminData is a block of data that is common to admin pages

type CommonData

type CommonData struct {
	Stage      string
	StaticPath string
}

CommonData is a block of data that is common to any page

type DataBlock

type DataBlock interface{}

DataBlock defines a block of data that can be loaded into a page template. Included for making code easier to read.

type SurveyData

type SurveyData struct {
	CommonData
	SurveyJS template.JS
	Survey   survey.Survey
}

SurveyData is a block of data to be interpolated into a survey page

type SurveyListData

type SurveyListData struct {
	CommonData
	AdminData
	Surveys []*survey.Survey
}

SurveyListData is a block of data to be interpolated into a page listing a set of surveys

Jump to

Keyboard shortcuts

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