Documentation
¶
Overview ¶
Package roles holds the role model and the visual decorations it produces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoSVGTag = errors.New("roles: icon has no <svg tag")
Functions ¶
func ColorizeIcon ¶
ColorizeIcon injects a colour rule after the opening <svg> and percent encodes the result for a data: URI. The style element is spliced in without its final > because the join below supplies one.
Types ¶
type IconLoader ¶
IconLoader reads a role icon, given the path stored in the icon column relative to the media root.
func FileIcons ¶
func FileIcons(root string) IconLoader
FileIcons reads role icons out of the media root. The icon column holds a path chosen in the admin, so it goes through Resolve rather than a plain join.
type InlineVisualMode ¶
type InlineVisualMode string
const ( InlineHidden InlineVisualMode = "hidden" InlineBadge InlineVisualMode = "badge" InlineIcon InlineVisualMode = "icon" )
type ProfileVisualMode ¶
type ProfileVisualMode string
const ( ProfileHidden ProfileVisualMode = "hidden" ProfileBadge ProfileVisualMode = "badge" ProfileStatus ProfileVisualMode = "status" )
type Role ¶
type Showcase ¶
func ShowcaseOf ¶
ShowcaseOf is the profile page's half of NameTails, and it reads a different column. Only one role per category reaches it, whatever mode each is in.