mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-09 15:14:32 +00:00
Purpose: 1. Make the whole code base have unified "item" layout 2. Clarify our "list" styles: "flex-relaxed-list", "flex-divided-list" 3. Prepare to replace legacy "ui relaxed list" * https://github.com/go-gitea/gitea/pull/37445#discussion_r3144458865 4. Prepare for refactoring the "pull merge box", it needs the "flex-divided-list" * related to "Refactor pull request view (*)" like #37451 5. Fix legacy abuses of "flex-list", e.g.: repo home sidebar
196 lines
9.2 KiB
Handlebars
196 lines
9.2 KiB
Handlebars
<div class="secondary-nav">
|
|
{{with .Repository}}
|
|
<div class="ui container">
|
|
<div class="repo-header flex-left-right">
|
|
{{/* left part */}}
|
|
<div class="flex-text-block">
|
|
{{template "repo/icon" .}}
|
|
<div class="flex-text-block tw-flex-wrap tw-text-18">
|
|
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
|
|
</div>
|
|
<div class="flex-text-block tw-flex-wrap">
|
|
{{if .IsArchived}}
|
|
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
|
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.archived"}}">{{svg "octicon-archive" 18}}</div>
|
|
{{end}}
|
|
{{if .IsPrivate}}
|
|
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
|
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.private"}}">{{svg "octicon-lock" 18}}</div>
|
|
{{else}}
|
|
{{if .Owner.Visibility.IsPrivate}}
|
|
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
|
|
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
{{if $.Permission.HasAnyUnitPublicAccess}}
|
|
<span class="ui basic orange label">{{ctx.Locale.Tr "repo.desc.public_access"}}</span>
|
|
{{end}}
|
|
{{if .IsTemplate}}
|
|
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.template"}}</span>
|
|
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
|
|
{{end}}
|
|
{{if eq .ObjectFormatName "sha256"}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{if not (or .IsBeingCreated .IsBroken)}}
|
|
{{/* right part */}}
|
|
<div class="flex-text-block tw-flex-wrap">
|
|
{{if $.CanUserAcceptOrRejectTransfer}}
|
|
<button type="button" class="ui compact small basic primary button link-action" data-url="{{$.RepoLink}}/action/accept_transfer"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.GetDisplayName}}"
|
|
>{{ctx.Locale.Tr "repo.transfer.accept"}}</button>
|
|
<button type="button" class="ui compact small basic red button link-action" data-url="{{$.RepoLink}}/action/reject_transfer"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.GetDisplayName}}"
|
|
>{{ctx.Locale.Tr "repo.transfer.reject"}}</button>
|
|
{{else if $.RepoTransfer}}
|
|
<div data-tooltip-content="{{ctx.Locale.Tr "repo.transfer.is_transferring_prompt" $.RepoTransfer.Recipient.GetDisplayName}}">
|
|
<button class="ui compact small basic red button" disabled>{{ctx.Locale.Tr "repo.transfer.is_transferring"}}</button>
|
|
</div>
|
|
{{end}}
|
|
{{if $.EnableFeed}}
|
|
{{/* An extra div-element is not necessary here, as this button does not secretly contain two buttons. */}}
|
|
<a class="ui compact small basic button" href="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
|
|
{{svg "octicon-rss" 16}}
|
|
</a>
|
|
{{end}}
|
|
{{template "repo/header/watch" $}}
|
|
{{if not $.DisableStars}}
|
|
{{template "repo/header/star" $}}
|
|
{{end}}
|
|
{{if and (not .IsEmpty) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
|
|
{{template "repo/header/fork" $}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{/* next line, secondary info */}}
|
|
{{if $.PullMirror}}
|
|
<div class="secondary-info">
|
|
{{ctx.Locale.Tr "repo.mirror_from"}}
|
|
<a target="_blank" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a>
|
|
{{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{DateUtils.TimeSince $.PullMirror.UpdatedUnix}}{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{if .IsFork}}<div class="secondary-info">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
|
|
{{if .IsGenerated}}<div class="secondary-info">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<div class="ui container">
|
|
<overflow-menu class="ui secondary pointing menu">
|
|
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
|
|
<div class="overflow-menu-items">
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
|
<a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if and (ne .BranchName .Repository.DefaultBranch) (not $.PageIsWiki)}}/src/{{.RefTypeNameSubURL}}{{end}}">
|
|
{{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
|
|
<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues">
|
|
{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}}
|
|
{{if .Repository.NumOpenIssues}}
|
|
<span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalTracker}}
|
|
<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank">
|
|
{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if and .Repository.CanEnablePulls (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests)}}
|
|
<a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls">
|
|
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}}
|
|
{{if .Repository.NumOpenPulls}}
|
|
<span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if and .EnableActions (.Permission.CanRead ctx.Consts.RepoUnitTypeActions) (not .IsEmptyRepo)}}
|
|
<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
|
|
{{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}}
|
|
{{if .Repository.NumOpenActionRuns}}
|
|
<span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypePackages}}
|
|
<a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item">
|
|
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{$projectsUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeProjects}}
|
|
{{if and (not ctx.Consts.RepoUnitTypeProjects.UnitGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeProjects) ($projectsUnit.ProjectsConfig.IsProjectsAllowed "repo")}}
|
|
<a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item">
|
|
{{svg "octicon-project"}} {{ctx.Locale.Tr "repo.projects"}}
|
|
{{if .Repository.NumOpenProjects}}
|
|
<span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if and (.Permission.CanRead ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}}
|
|
<a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases">
|
|
{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}}
|
|
{{if .NumReleases}}
|
|
<span class="ui small label">{{CountFmt .NumReleases}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeWiki}}
|
|
<a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki">
|
|
{{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalWiki}}
|
|
<a class="item" href="{{(.Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank">
|
|
{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}}
|
|
<a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity">
|
|
{{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{template "custom/extra_tabs" .}}
|
|
|
|
{{if .Permission.IsAdmin}}
|
|
<span class="item-flex-space"></span>
|
|
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
|
|
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<div class="overflow-menu-items">
|
|
{{if(and .Repository.IsBeingCreated (.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}
|
|
<a class="{{if not .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}">
|
|
{{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.migration_status"}}
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if .Permission.IsAdmin}}
|
|
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
|
|
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</overflow-menu>
|
|
</div>
|
|
<div class="ui tabs divider"></div>
|
|
</div>
|