component

package
Version: v0.0.0-...-e22f40b Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Overview

Package component contains individual components that can render themselves as HTML.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avatar

type Avatar struct {
	User users.User
	Size int // In pixels, e.g., 48.
	// contains filtered or unexported fields
}

Avatar is an avatar component.

func (Avatar) Render

func (a Avatar) Render() []*html.Node

type ChangeBadge

type ChangeBadge struct {
	State change.State
}

ChangeBadge is a change badge, displaying the change's state.

func (ChangeBadge) Render

func (cb ChangeBadge) Render() []*html.Node

type ChangeEntry

type ChangeEntry struct {
	Change change.Change
	Unread bool // Unread indicates whether the change contains unread notifications for authenticated user.

	// TODO, THINK: This is router details, can it be factored out or cleaned up?
	BaseURI string
}

ChangeEntry is an entry within the list of changes.

func (ChangeEntry) Render

func (i ChangeEntry) Render() []*html.Node

type ChangeIcon

type ChangeIcon struct {
	State change.State
}

ChangeIcon is a change icon, displaying the change's state.

func (ChangeIcon) Render

func (ii ChangeIcon) Render() []*html.Node

type ChangeStateBadge

type ChangeStateBadge struct {
	Change change.Change
}

ChangeStateBadge is a component that displays the state of a change with a badge, who opened it, and when it was opened.

func (ChangeStateBadge) Render

func (i ChangeStateBadge) Render() []*html.Node

type Changes

type Changes struct {
	ChangesNav ChangesNav
	Filter     change.StateFilter
	Entries    []ChangeEntry
}

Changes is a component that displays a page of changes, with a navigation bar on top.

func (Changes) Render

func (i Changes) Render() []*html.Node

type ChangesNav

type ChangesNav struct {
	OpenCount     uint64     // Open changes count.
	ClosedCount   uint64     // Closed changes count.
	Path          string     // URL path of current page (needed to generate correct links).
	Query         url.Values // URL query of current page (needed to generate correct links).
	StateQueryKey string     // Name of query key for controlling change state filter. Constant, but provided externally.
}

ChangesNav is a navigation component for displaying a header for a list of changes. It contains tabs to switch between viewing open and closed changes.

func (ChangesNav) Render

func (n ChangesNav) Render() []*html.Node

type ClosedChangesTab

type ClosedChangesTab struct {
	Count uint64 // Count of closed changes.
}

ClosedChangesTab is a "Closed Changes Tab" component.

func (ClosedChangesTab) Render

func (t ClosedChangesTab) Render() []*html.Node

type Event

type Event struct {
	Event change.TimelineItem

	// State must have BaseURI and ChangeID fields populated.
	// They are used while rendering change.CommitEvent events.
	State common.State
}

Event is an event component.

func (Event) Render

func (e Event) Render() []*html.Node

type OpenChangesTab

type OpenChangesTab struct {
	Count uint64 // Count of open changes.
}

OpenChangesTab is an "Open Changes Tab" component.

func (OpenChangesTab) Render

func (t OpenChangesTab) Render() []*html.Node

type Time

type Time struct {
	Time time.Time
}

Time component that displays human friendly relative time (e.g., "2 hours ago", "yesterday"), but also contains a tooltip with the full absolute time (e.g., "Jan 2, 2006, 3:04 PM MST").

TODO: Factor out, it's the same as in notificationsapp.

func (Time) Render

func (t Time) Render() []*html.Node

type User

type User struct {
	User users.User
}

User is a user component.

func (User) Render

func (u User) Render() []*html.Node

Jump to

Keyboard shortcuts

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