component

package
v0.0.0-...-80666a8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 12 Imported by: 6

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.
}

Avatar is an avatar component.

func (Avatar) Render

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

type ClosedIssuesTab

type ClosedIssuesTab struct {
	Count uint64 // Count of closed issues.
}

ClosedIssuesTab is a "Closed Issues Tab" component.

func (ClosedIssuesTab) Render

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

type Event

type Event struct {
	Event issues.Event
}

Event is an event component.

func (Event) Render

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

type IssueBadge

type IssueBadge struct {
	State issues.State
}

IssueBadge is an issue badge, displaying the issue's state.

func (IssueBadge) Render

func (ib IssueBadge) Render() []*html.Node

type IssueEntry

type IssueEntry struct {
	Issue  issues.Issue
	Unread bool // Unread indicates whether the issue contains unread notifications for authenticated user.

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

IssueEntry is an entry within the list of issues.

func (IssueEntry) Render

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

type IssueIcon

type IssueIcon struct {
	State issues.State
}

IssueIcon is an issue icon, displaying the issue's state.

func (IssueIcon) Render

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

type IssueStateBadge

type IssueStateBadge struct {
	Issue issues.Issue
}

IssueStateBadge is a component that displays the state of an issue with a badge, who opened it, and when it was opened.

func (IssueStateBadge) Render

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

type Issues

type Issues struct {
	IssuesNav IssuesNav
	Filter    issues.StateFilter
	Entries   []IssueEntry
}

Issues is a component that displays a page of issues, with a navigation bar on top.

func (Issues) Render

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

type IssuesNav

type IssuesNav struct {
	OpenCount     uint64     // Open issues count.
	ClosedCount   uint64     // Closed issues 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 issue state filter. Constant, but provided externally.
}

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

func (IssuesNav) Render

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

type Label

type Label struct {
	Label issues.Label
}

Label is a label component.

func (Label) Render

func (l Label) Render() []*html.Node

type OpenIssuesTab

type OpenIssuesTab struct {
	Count uint64 // Count of open issues.
}

OpenIssuesTab is an "Open Issues Tab" component.

func (OpenIssuesTab) Render

func (t OpenIssuesTab) 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