gitea: code.gitea.io/gitea/modules/templates Index | Files

package templates

import "code.gitea.io/gitea/modules/templates"

Index

Package Files

dynamic.go helper.go templates.go

func ActionContent2Commits Uses

func ActionContent2Commits(act Actioner) *models.PushCommits

ActionContent2Commits converts action content to push commits

func ActionIcon Uses

func ActionIcon(opType models.ActionType) string

ActionIcon accepts an action operation type and returns an icon class name.

func DiffLineTypeToStr Uses

func DiffLineTypeToStr(diffType int) string

DiffLineTypeToStr returns diff line type name

func DiffTypeToStr Uses

func DiffTypeToStr(diffType int) string

DiffTypeToStr returns diff type name

func Escape Uses

func Escape(raw string) string

Escape escapes a HTML string

func HTMLRenderer Uses

func HTMLRenderer() macaron.Handler

HTMLRenderer implements the macaron handler for serving HTML templates.

func IsMultilineCommitMessage Uses

func IsMultilineCommitMessage(msg string) bool

IsMultilineCommitMessage checks to see if a commit message contains multiple lines.

func JSONRenderer Uses

func JSONRenderer() macaron.Handler

JSONRenderer implements the macaron handler for serving JSON templates.

func JSRenderer Uses

func JSRenderer() macaron.Handler

JSRenderer implements the macaron handler for serving JS templates.

func List Uses

func List(l *list.List) chan interface{}

List traversings the list

func Mailer Uses

func Mailer() (*texttmpl.Template, *template.Template)

Mailer provides the templates required for sending notification mails.

func MigrationIcon Uses

func MigrationIcon(hostname string) string

MigrationIcon returns a Font Awesome name matching the service an issue/comment was migrated from

func NewFuncMap Uses

func NewFuncMap() []template.FuncMap

NewFuncMap returns functions for injecting to templates

func NewTextFuncMap Uses

func NewTextFuncMap() []texttmpl.FuncMap

NewTextFuncMap returns functions for injecting to text templates It's a subset of those used for HTML and other templates

func RenderCommitBody Uses

func RenderCommitBody(msg, urlPrefix string, metas map[string]string) template.HTML

RenderCommitBody extracts the body of a commit message without its title.

func RenderCommitMessage Uses

func RenderCommitMessage(msg, urlPrefix string, metas map[string]string) template.HTML

RenderCommitMessage renders commit message with XSS-safe and special links.

func RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML

RenderCommitMessageLink renders commit message as a XXS-safe link to the provided default url, handling for special links.

func RenderCommitMessageLinkSubject Uses

func RenderCommitMessageLinkSubject(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML

RenderCommitMessageLinkSubject renders commit message as a XXS-safe link to the provided default url, handling for special links without email to links.

func RenderNote Uses

func RenderNote(msg, urlPrefix string, metas map[string]string) template.HTML

RenderNote renders the contents of a git-notes file as a commit message.

func ReplaceLeft Uses

func ReplaceLeft(s, oldS, newS string) string

ReplaceLeft replaces all prefixes 'oldS' in 's' with 'newS'.

func Safe Uses

func Safe(raw string) template.HTML

Safe render raw as HTML

func SafeJS Uses

func SafeJS(raw string) template.JS

SafeJS renders raw as JS

func Sha1 Uses

func Sha1(str string) string

Sha1 returns sha1 sum of string

func Str2html Uses

func Str2html(raw string) template.HTML

Str2html render Markdown text to HTML

func TrN Uses

func TrN(lang string, cnt interface{}, key1, keyN string) string

TrN returns key to be used for plural text translation

type Actioner Uses

type Actioner interface {
    GetOpType() models.ActionType
    GetActUserName() string
    GetRepoUserName() string
    GetRepoName() string
    GetRepoPath() string
    GetRepoLink() string
    GetBranch() string
    GetContent() string
    GetCreate() time.Time
    GetIssueInfos() []string
}

Actioner describes an action

Package templates imports 30 packages (graph) and is imported by 11 packages. Updated 2019-11-20. Refresh now. Tools for package owners.