{{define "setup"}} {{template "layout-start" .}}

{{if .StorageUnset}}{{t "setup.choose"}}{{else}}{{t "setup.pathTitle"}}{{end}}

{{if not .StorageUnset}}

{{t "setup.changeWarn"}}

{{end}}
{{if .StorageTotal}}
{{if .StorageBlueGit}}

{{t "setup.usedDir" .StorageBlueGit}}{{if .StoragePartial}} {{t "setup.usedDirPartial"}}{{end}}

{{else if .StoragePartial}}

{{t "setup.usedDirCounting"}}

{{end}} {{if .HasReserved}}

{{t "setup.diskStatReserved" .StorageTotal .StorageUsed .StorageReserved .StorageFree}}

{{else}}

{{t "setup.diskStat" .StorageTotal .StorageUsed .StorageFree}}

{{end}}
{{.StoragePercent}}%
{{end}}

{{t "setup.rules" .MinFree}}

{{with .Cache}}

{{t "setup.cacheTitle"}}

{{t "setup.cacheLead"}}

{{if .enabled}}

{{t "setup.cacheUse" .bytes_h .max_h .entries .hits .misses}}

{{else}}

{{t "setup.cacheOff"}}

{{end}}
{{if .enabled}}
{{end}}

{{t "setup.locTitle"}}

{{range .locations}}{{end}}
{{index . "what"}}{{index . "path"}}{{with index . "disk"}}{{.}}{{else}}?{{end}}
{{end}} {{if .ShowUpdate}}{{template "updatestatus" .}}{{end}} {{template "layout-end" .}} {{end}} {{define "home"}} {{template "layout-start" .}}
BlueGit

BlueGit

{{t "home.lead"}}

{{if .StorageUnset}}

{{t "home.storage"}}

{{end}}

{{t "nav.signin"}}

{{if .Repos}}

{{t "home.public"}}

{{end}} {{template "releaserepos" .}} {{template "layout-end" .}} {{end}} {{define "releaserepos"}} {{if .ReleaseRepos}}

{{t "home.releaseOnly"}}

{{end}} {{end}} {{define "dashboard"}} {{template "layout-start" .}}

{{t "nav.dashboard"}}

{{t "nav.new"}}
{{if .StorageUnset}}

{{t "home.storage"}}

{{end}}

{{t "dash.tabOverview"}} {{t "dash.repos"}} {{.DashRepoN}} {{t "dash.groups"}} {{.DashGroupN}}

{{if .DashTab}}
{{if eq .DashTab "repos"}}

{{t "dash.repos"}}

{{if not .Repos}}

{{t "dash.noRepos"}}

{{end}} {{else}}

{{t "dash.groups"}}

{{if not .Groups}}

{{t "dash.noGroups"}}

{{end}} {{end}} {{if gt .DashPages 1}}

{{if .DashPrev}}{{t "dash.prev"}}{{end}} {{t "dash.pageOf" .DashPage .DashPages}} {{if .DashNext}}{{t "dash.next"}}{{end}}

{{end}}
{{else}} {{if .Card}}{{template "usercard" .Card}}{{end}} {{if .Heat}}{{template "heatmap" .Heat}}{{end}}

{{t "dash.repos"}}

{{if not .Repos}}

{{t "dash.noRepos"}}

{{end}} {{if .MoreRepos}}

{{t "dash.showAll" .MoreRepos}}

{{end}}

{{t "dash.groups"}}

{{if not .Groups}}

{{t "dash.noGroups"}}

{{end}} {{if .MoreGroups}}

{{t "dash.showAll" .MoreGroups}}

{{end}}
{{template "releaserepos" .}} {{end}} {{template "layout-end" .}} {{end}} {{define "profile"}} {{template "layout-start" .}} {{if .Card}}{{template "usercard" .Card}}{{end}} {{if .Heat}}{{template "heatmap" .Heat}}{{end}}

{{t "dash.repos"}}

{{t "dash.groups"}}

{{template "layout-end" .}} {{end}} {{define "usercard"}}
{{if .User.AvatarURL}}{{else}}{{initial .User.Username}}{{end}}
{{if eq .Heading "h1"}}

{{.Name}}

{{else}}

{{.Name}}

{{end}}

@{{.User.Username}}

{{if .Bio}}

{{.Bio}}

{{end}} {{if .Since}}

{{t "profile.since" .Since}}

{{end}}
{{if .Own}}{{t "profile.edit"}}{{end}}
{{end}} {{define "heatmap"}}

{{t "heat.title"}}

{{range .Weeks}}{{.Label}}{{end}}
{{range .Weeks}}
{{range .Days}}{{if .Off}}{{else}}{{end}}{{end}}
{{end}}

{{.TotalText}}

{{t "heat.less"}}{{t "heat.more"}}

{{t "heat.note"}}

{{end}} {{define "new"}} {{template "layout-start" .}}

{{t "title.new"}}

{{template "layout-end" .}} {{end}} {{define "account"}} {{template "layout-start" .}}

{{t "title.account"}}

{{t "acct.hint"}}

{{t "profile.edit"}}

{{t "acct.bioHint"}}

{{t "acct.language"}}

{{if .NewToken}}

{{.NewToken}}

{{end}}

{{t "acct.tokens"}}

{{if .Tokens}}
{{if .ShowExpiry}}{{end}} {{range .Tokens}} {{if $.ShowExpiry}}{{end}} {{end}}
{{t "acct.col.name"}} {{t "acct.col.prefix"}} {{t "acct.col.created"}} {{t "acct.col.used"}}{{t "acct.col.expires"}}
{{.Name}} {{.Prefix}} {{date .CreatedAt}} {{with date .LastUsedAt}}{{.}}{{else}}{{t "acct.never"}}{{end}}{{date .ExpiresAt}}
{{end}}

{{t "runner.title"}}

{{t "runner.userLead"}} {{t "help.runnerDocs"}}

{{template "runnerlist" (dict "Runners" .RunnerList "CSRF" .CSRF "Delete" "/settings/runners/delete" "Token" .NewRunnerToken "New" "/settings/runners/token" "Base" .BaseURL)}}

{{t "acct.ssh"}}

{{if .Keys}}
{{range .Keys}}{{end}}
{{t "acct.col.name"}} {{t "acct.col.fingerprint"}} {{t "acct.col.created"}}
{{.Name}} {{.Fingerprint}} {{date .CreatedAt}}
{{end}}

{{t "acct.export"}}

{{template "layout-end" .}} {{end}} {{define "ficon"}} {{if eq . "dir"}} {{else if eq . "md"}} {{else if eq . "code"}} {{else if eq . "cfg"}} {{else if eq . "lic"}} {{else if eq . "img"}} {{else}} {{end}} {{end}} {{define "visicon"}} {{if eq . "public"}} {{else}} {{end}} {{end}} {{define "branchpick"}} {{if .RevProtected}}{{end}} {{end}} {{define "avatar"}} {{if .UserURL}}{{end}} {{if .Avatar}}{{else}}{{if .Initial}}{{.Initial}}{{else}}{{initial .Author}}{{end}}{{end}} {{if .UserURL}}{{end}} {{end}} {{define "commitwho"}}{{if .UserURL}}{{.Author}}{{else}}{{.Author}}{{end}}{{if .RawName}} {{.RawName}}{{end}}{{if .PushedBy}} · {{t "commit.pushedBy" .PushedBy}}{{end}}{{end}} {{define "commitbar"}} {{if .Head}}
{{template "avatar" .Head}}
{{.Head.Subject}}
{{template "commitwho" .Head}} · {{.Head.When}}
{{if and .Head.PipeStatus (eq .Page "overview")}} {{.Head.PipeLabel}} {{.Head.PipeDuration}} {{template "stage-dots" .}} {{template "pipe-retry" (dict "Can" .CanWrite "CSRF" .CSRF "Path" .Repo.FullPath "ID" .Head.PipeID "Failed" .Head.PipeFailed "Back" (printf "/%s" .Repo.FullPath))}} {{else if .Head.PipeStatus}}{{.Head.PipeLabel}}{{end}} {{slice .Head.SHA 0 8}} {{t "repo.history"}}
{{end}} {{end}} {{define "stage-dots"}} {{with .Head}}
{{range .PipeStages}}
{{t "pipe.stage"}}: {{.Name}}
{{end}}
{{end}} {{end}} {{define "codemenu"}} {{end}} {{define "filetable"}} {{if .Files}}
{{range .Files}} {{end}}
{{t "repo.name"}}{{t "repo.lastCommit"}}{{t "repo.lastChange"}}
{{template "ficon" .Icon}} {{if .Dir}}{{.Name}}{{else}}{{.Name}}{{end}} {{if .SHA}}{{.Subject}}{{end}} {{.When}}
{{else if eq .Page "files"}}

{{t "repo.emptyDir"}}

{{else if not .Head}}

{{t "repo.noCommits"}}

{{end}} {{end}} {{define "repo"}} {{template "layout-start" .}}

{{t "tab.overview"}}

{{t "repo.searchFile"}} {{if and .User .ForkTargets (not .ReleaseOnly)}}{{end}}
{{if and .User .ForkTargets (not .ReleaseOnly)}}

{{t "fork.title" .Repo.FullPath}}

{{t "fork.hint"}}

{{end}} {{if .Heat}}{{template "heatmap" .Heat}}{{end}}
{{template "branchpick" .}} {{.Repo.Name}}
{{template "codemenu" .}}
{{template "commitbar" .}} {{template "filetable" .}} {{if .ReadmeName}}
{{template "ficon" "md"}} {{.ReadmeName}}
{{.Readme}}
{{end}}
{{if and .Head .Head.PipeLive}}{{end}} {{template "layout-end" .}} {{end}} {{define "files"}} {{template "layout-start" .}}

{{t "tab.files"}}

{{template "branchpick" .}} {{.Repo.Name}} {{if .BlobPath}}{{range splitPath .BlobPath}} / {{.}}{{end}}{{else if .TreePath}}{{range splitPath .TreePath}} / {{.}}{{end}}{{end}} {{if or .BlobPath .TreePath}}{{end}}
{{template "codemenu" .}}
{{if .BlobPath}}

{{template "ficon" (iconOf .FileName)}} {{.FileName}}

{{template "commitbar" .}}
{{$raw := printf "/%s/-/raw/%s?rev=%s" .Repo.FullPath .BlobPath .Rev}}
{{template "ficon" (iconOf .FileName)}} {{.FileName}} {{.BlobSize}} {{t "file.download"}} {{t "file.raw"}}
{{if .IsSVG}}
{{.FileName}}
{{end}} {{if .IsImage}}
{{.FileName}}
{{else if .Binary}}

{{t "repo.binary"}}

{{else}} {{range .Lines}}{{end}}
{{.N}}{{.HTML}}
{{end}}
{{else}} {{template "filetable" .}} {{end}}
{{template "layout-end" .}} {{end}} {{define "tags"}} {{template "layout-start" .}}

{{t "title.tags"}}

{{if .CanWrite}}{{end}}
{{if .Tags}}
{{range .Tags}}
{{.Name}} {{if .Protected}}{{t "vis.protected"}}{{end}}

{{if .SHA}}{{.Short}}{{end}} {{if .Subject}}{{if .SHA}}{{end}}{{.Subject}}{{end}} {{if .When}}{{if or .SHA .Subject}}{{end}}{{.When}}{{end}}

{{if .Annotated}}

{{t "tag.annotated"}} {{.Message}}

{{else}}

{{t "tag.lightweight"}}

{{end}} {{if .HasRelease}}

{{t "tag.release"}}

{{end}}
{{if .CanDelete}}{{end}}
{{end}}
{{else if .Query}}

{{t "tag.noMatch"}}

{{else}}

{{t "repo.noTags"}}

{{end}} {{if .CanWrite}}

{{t "tag.create"}}

{{range .Branches}}{{end}}

{{end}} {{template "layout-end" .}} {{end}} {{define "commits"}} {{template "layout-start" .}}
{{.Repo.Name}}

{{t "title.commits"}}

{{if .CommitDays}} {{range .CommitDays}}

{{.Label}}

{{range .Items}}
{{if .WhoURL}}{{end}} {{if .Ident}}{{.Ident}}{{else if .Avatar}}{{else}}{{if .Initial}}{{.Initial}}{{else}}{{initial .Author}}{{end}}{{end}} {{if .WhoURL}}{{end}}
{{.Subject}}

{{if .WhoURL}}{{.Who}}{{else}}{{.Who}}{{end}} {{t "commit.authoredWhen" .When}}

{{if .PipeStatus}}{{end}} {{if gt (len .SHA) 8}}{{slice .SHA 0 8}}{{else}}{{.SHA}}{{end}}
{{end}}
{{end}} {{if or .CommitPrev .CommitNext}} {{end}} {{else if .Query}}

{{t "commit.none"}}

{{else}}

{{t "repo.noCommits"}}

{{end}} {{template "layout-end" .}} {{end}} {{define "runnerlist"}} {{if .Token}}

{{t "runner.tokenOnce"}}

{{.Token}}

sudo bluegit-runner register --url {{.Base}} --token {{.Token}}
{{end}}
{{tip "runner.tip.token"}}
{{if .Runners}}
{{range .Runners}}{{end}}
{{t "acct.col.name"}}{{t "runner.status"}}{{t "runner.seen"}}{{t "runner.version"}}
{{.Name}} {{if .Paused}}{{t "runner.paused"}} {{end}}{{if and .Draining .Online}}{{t "runner.draining"}} {{end}}{{if .Online}}{{t "runner.online"}}{{else}}{{t "runner.offline"}}{{end}} {{date .LastSeen}} {{.Version}}
{{else}}

{{t "runner.none"}}

{{end}} {{end}} {{define "forks"}} {{template "layout-start" .}}

{{t "fork.listTitle"}}

{{if .Fork.IsFork}}

{{if .Fork.Upstream}}{{t "fork.of"}} {{.Fork.Upstream.FullPath}}{{else}}{{t "fork.hidden"}}{{end}}

{{end}} {{template "layout-end" .}} {{end}}