component

package
v0.0.0-...-c858694 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 8 Imported by: 3

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source

RedLogo controls whether the logo is displayed in red, rather than its normal color.

Functions

func RepositoryTabNav

func RepositoryTabNav(selected RepositoryTab, repoPath string, packages int, openIssues, openChanges uint64) htmlg.Component

Types

type BlankSlate

type BlankSlate struct {
	Content htmlg.Component
}

BlankSlate is a blank slate.

func (BlankSlate) Render

func (bs BlankSlate) Render() []*html.Node

type EllipsisButton

type EllipsisButton struct {
	// OnClick is the value that the onclick handler gets set to.
	OnClick string
}

EllipsisButton is a button with a horizontal ellipsis. It can be used to expand/collapse additional details.

func (EllipsisButton) Render

func (b EllipsisButton) Render() []*html.Node

type Flash

type Flash struct {
	Content htmlg.Component
}

Flash is a flash message.

func (Flash) Render

func (f Flash) Render() []*html.Node
type Header struct {
	CurrentUser       users.User
	NotificationCount uint64 // Only needed if CurrentUser.ID != 0.
	ReturnURL         string
}

Header is a header component that displays current user and notifications.

func (Header) Render

func (h Header) Render() []*html.Node

Render implements htmlg.Component.

type Logo struct{}

Logo is a logo component. It links to "/".

func (Logo) Render

func (Logo) Render() []*html.Node

Render implements htmlg.Component.

type Notifications

type Notifications struct {
	// Count is the number of unread notifications the user has.
	Count uint64
}

Notifications is an icon for displaying if user has unread notifications. It links to "/notifications".

func (Notifications) Render

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

Render implements htmlg.Component.

type PostButton

type PostButton struct {
	Action    string
	Text      string
	ReturnURL string
}

PostButton is a button that performs a POST action.

func (PostButton) Render

func (b PostButton) Render() []*html.Node

type RepositoryTab

type RepositoryTab uint8
const (
	NoTab RepositoryTab = iota
	PackagesTab
	HistoryTab
	IssuesTab
	ChangesTab
)

type Tab

type Tab struct {
	Content  htmlg.Component
	URL      string
	OnClick  string
	Selected bool
}

Tab is a single tab entry within a TabNav.

func (Tab) Render

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

type TabNav

type TabNav struct {
	Tabs []Tab
}

TabNav is a left-aligned horizontal row of tabs Primer CSS component.

http://primercss.io/nav/#tabnav

func (TabNav) Render

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

Jump to

Keyboard shortcuts

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