snapshot of https://github.com/go-gitea/gitea.git (main, 2026-09-15; blobs > 131072B omitted)
Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
This commit is contained in:
43
templates/repo/header/fork.tmpl
Normal file
43
templates/repo/header/fork.tmpl
Normal file
@@ -0,0 +1,43 @@
|
||||
{{$canNotForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}}
|
||||
{{$forkHref := printf "%s/fork" $.RepoLink}}
|
||||
{{if not $.IsSigned}}
|
||||
{{$forkHref = printf "%s/user/login" AppSubUrl}}
|
||||
{{else if $.ShowForkModal}}{{/* see backend comment for this logic */}}
|
||||
{{$forkHref = "#"}}
|
||||
{{else if eq (len $.UserAndOrgForks) 1}}
|
||||
{{$forkHref = printf "%s/%s" AppSubUrl (index $.UserAndOrgForks 0).FullName}}
|
||||
{{else if $canNotForkOwn}}
|
||||
{{$forkHref = "#"}}
|
||||
{{end}}
|
||||
<a role="button" class="ui compact small basic button {{if $.ShowForkModal}}show-modal{{end}}" href="{{$forkHref}}"
|
||||
{{if and $.IsSigned $.ShowForkModal}}data-modal="#fork-repo-modal"{{end}}
|
||||
{{if not $.IsSigned}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}"
|
||||
{{else if $canNotForkOwn}}
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}"
|
||||
{{end}}
|
||||
>
|
||||
{{svg "octicon-repo-forked"}}
|
||||
<span class="not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span>
|
||||
<span class="ui small label">{{CountFmt $.Repository.NumForks}}</span>
|
||||
</a>
|
||||
{{if $.ShowForkModal}}
|
||||
<div class="ui small modal" id="fork-repo-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.already_forked" $.Repository.Name}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui relaxed list">
|
||||
{{range $.UserAndOrgForks}}
|
||||
<div class="item">
|
||||
<a class="flex-text-block" href="{{.Link}}">{{svg "octicon-repo-forked"}}{{.FullName}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if $.CanSignedUserFork}}
|
||||
<div class="divider"></div>
|
||||
<a href="{{$.RepoLink}}/fork">{{ctx.Locale.Tr "repo.fork_to_different_account"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
14
templates/repo/header/star.tmpl
Normal file
14
templates/repo/header/star.tmpl
Normal file
@@ -0,0 +1,14 @@
|
||||
{{$buttonText := ctx.Locale.Tr (Iif $.IsStaringRepo "repo.unstar" "repo.star")}}
|
||||
<a role="button" class="ui compact small basic button" aria-label="{{$buttonText}}"
|
||||
{{if $.IsSigned}}
|
||||
data-fetch-method="post"
|
||||
data-fetch-url="{{$.RepoLink}}/action/{{Iif $.IsStaringRepo "unstar" "star"}}"
|
||||
{{else}}
|
||||
href="{{AppSubUrl}}/user/login"
|
||||
data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"
|
||||
{{end}}
|
||||
>
|
||||
{{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
<span class="ui small label">{{CountFmt .Repository.NumStars}}</span>
|
||||
</a>
|
||||
57
templates/repo/header/watch.tmpl
Normal file
57
templates/repo/header/watch.tmpl
Normal file
@@ -0,0 +1,57 @@
|
||||
{{$isIgnoring := and $.IsSigned $.RepoWatch.IsIgnoring}}
|
||||
{{$buttonText := ctx.Locale.Tr (Iif $isIgnoring "repo.ignoring" (Iif $.RepoWatch.IsWatching "repo.watching" "repo.watch"))}}
|
||||
{{$count := CountFmt .Repository.NumWatches}}
|
||||
<div id="repo-header-watch" class="flex-text-block">
|
||||
{{if $.IsSigned}}
|
||||
{{$mode := $.RepoWatch.SelectedMode}}
|
||||
{{$isAll := eq $mode "all"}}
|
||||
{{$isCustom := eq $mode "custom"}}
|
||||
{{$isParticipating := eq $mode "participate"}}
|
||||
<button type="button" class="ui dropdown custom compact small basic button" data-global-init="initRepoWatchMenu" aria-label="{{$buttonText}}">
|
||||
{{svg (Iif $isIgnoring "octicon-eye-closed" "octicon-eye")}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
<span class="ui small label">{{$count}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</button>
|
||||
<div class="tippy-target">
|
||||
{{$testParticipating := ctx.Locale.Tr "repo.watch.mode.participating"}}
|
||||
<a class="item{{if $isParticipating}} active{{end}}" role="menuitem" aria-label="{{$testParticipating}}"
|
||||
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/participate" data-fetch-sync="$body #repo-header-watch"
|
||||
>
|
||||
{{svg "octicon-check" 16 (Iif $isParticipating "" "tw-invisible")}}
|
||||
<div>{{$testParticipating}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.participating.desc"}}</div></div>
|
||||
</a>
|
||||
{{$textAll := ctx.Locale.Tr "repo.watch.mode.all"}}
|
||||
<a class="item{{if $isAll}} active{{end}}" role="menuitem" aria-label="{{$textAll}}"
|
||||
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/watch" data-fetch-sync="$body #repo-header-watch"
|
||||
>
|
||||
{{svg "octicon-check" 16 (Iif $isAll "" "tw-invisible")}}
|
||||
<div>{{$textAll}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.all.desc"}}</div></div>
|
||||
</a>
|
||||
{{$textIgnore := ctx.Locale.Tr "repo.watch.mode.ignore"}}
|
||||
<a class="item{{if $isIgnoring}} active{{end}}" role="menuitem" aria-label="{{$textIgnore}}"
|
||||
data-fetch-method="post" data-fetch-url="{{$.RepoLink}}/action/ignore" data-fetch-sync="$body #repo-header-watch"
|
||||
>
|
||||
{{svg "octicon-check" 16 (Iif $isIgnoring "" "tw-invisible")}}
|
||||
<div>{{$textIgnore}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.ignore.desc"}}</div></div>
|
||||
</a>
|
||||
{{$textCustom := ctx.Locale.Tr "repo.watch.mode.custom"}}
|
||||
<a class="item {{if $isCustom}}active{{end}} show-modal" role="menuitem" aria-label="{{$textCustom}}"
|
||||
data-modal="#repo-watch-options-modal"
|
||||
data-modal-form.url="{{$.RepoLink}}/action/watch/options"
|
||||
data-modal-issues="{{$.RepoWatch.IncludeIssues}}"
|
||||
data-modal-pull_requests="{{$.RepoWatch.IncludePullRequests}}"
|
||||
data-modal-releases="{{$.RepoWatch.IncludeReleases}}"
|
||||
>
|
||||
{{svg "octicon-check" 16 (Iif $isCustom "" "tw-invisible")}}
|
||||
<div>{{$textCustom}}<div class="tw-text-12 tw-text-text-light-2">{{ctx.Locale.Tr "repo.watch.mode.custom.desc"}}</div></div>
|
||||
</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<a role="button" class="ui compact small basic button" href="{{AppSubUrl}}/user/login" aria-label="{{$buttonText}}" data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}">
|
||||
{{svg "octicon-eye"}}
|
||||
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
|
||||
<span class="ui small label">{{$count}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
Reference in New Issue
Block a user