views

package
v0.0.0-...-92b599d Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TabSelectorReadme = 1 << iota
	TabSelectorShowTree
	TabSelectorShowRefs
	TabSelectorClone
	TabSelectorCommits
)

Variables

This section is empty.

Functions

func CreateRepository

func CreateRepository(ctx *RenderContext, props *CreateRepositoryProps) string

func Error

func Error(ctx *RenderContext, props *ErrorProps) string

func FormatFileSize

func FormatFileSize(s int64) string
func Head(ctx *RenderContext) string

func Index

func Index(ctx *RenderContext, props *IndexProps) string
func Navbar(ctx *RenderContext) string

func PageBegin

func PageBegin(ctx *RenderContext) string

func PageEnd

func PageEnd(ctx *RenderContext) string

func ProblemBox

func ProblemBox(problem string) string

func RepositoryTabRefsDefaultBranchSelector

func RepositoryTabRefsDefaultBranchSelector(ctx *RenderContext, props *RepositoryTabProps, message string) string

func RepositoryTabs

func RepositoryTabs(ctx *RenderContext, props *RepositoryTabProps) string

func SendPage

func SendPage(ctx *fiber.Ctx, content string) error

func ViewRepository

func ViewRepository(ctx *RenderContext, props *ViewRepositoryProps) string

Types

type CreateRepositoryProps

type CreateRepositoryProps struct {
	Problem string
}

type ErrorProps

type ErrorProps struct {
	StatusCode       int
	ExtraInformation string
}

type IndexProps

type IndexProps struct {
	AllRepos []*core.RepoOnDisk
}

type RenderContext

type RenderContext struct {
	// contains filtered or unexported fields
}

func NewRenderContext

func NewRenderContext(user *models.User) *RenderContext

NewRenderContext creates a new context for rendering pages.

User is the currently authenticated user. May be `nil` if no use is currently authenticated.

type RepositoryTabProps

type RepositoryTabProps struct {
	Repo       *core.RepoOnDisk
	CurrentTab int

	Readme struct {
		Content string
	}

	Clone struct {
		SSHUser        string
		SSHHost        string
		SSHStoragePath string
	}

	Refs struct {
		DefaultBranch plumbing.ReferenceName

		Branches []*plumbing.Reference
		Tags     []*plumbing.Reference
	}
}

type ViewRepositoryProps

type ViewRepositoryProps struct {
	Repo    *core.RepoOnDisk
	IsEmpty bool
}

Jump to

Keyboard shortcuts

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