mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
Finishes the residual pass: the bulk of served leaks remained (28 locale files, most templates, all raster/source assets, Chinese READMEs). Imports, identifiers, and wire contracts are left intact. - locale: 28 files, all "Gitea" -> "Hanzo Git"; docs/blog/about.gitea.* + gitea.com/.io + go-gitea help URLs -> docs.hanzo.ai / git.hanzo.ai / github.com/hanzoai/git (keys with lowercase "gitea" preserved) - templates: footer, swagger UI title + generated OpenAPI specs (stale gitea.dev x-go-package -> github.com/hanzoai/git), webhook usernames, OAuth-source labels, package/help doc links, example org/team identifiers - Go served defaults: RSS feed author/description, git commit user.name + fallback email, WWW-Authenticate realms (OAuth2/packages/container), 500/error pages, MS Teams card, built-in OAuth provider label, CLI --help, SSH + push-rejection messages, startup/index/redis/doctor logs, test-mail subject + X-Mailer - config: app.example.ini APP_NAME default - assets: source assets/*.svg, gitea.svg, gitea-gitea sprite, and all PNGs (logo/favicon/apple-touch/avatar_default) regenerated as the committed black-tile Hanzo mark; --color-logo #609926 -> monochrome; favicon-status test realigned to the new mark (viewBox 64) - README.zh-tw + README.zh-cn rewritten as Hanzo Git - render field CommitParticipant.GiteaUser -> User Preserved (imports / identifiers / external contracts): code.gitea.io, module github.com/hanzoai/git, gitea.dev/sdk dep, X-Gitea-* webhook + email headers, WWW-Authenticate realm="Gitea" in git-HTTP (Git Credential Manager OAuth2 detection), GitServiceType "Gitea" migration-source name, theme id gitea-auto, .gitea-* classes / svg symbol ids, Go/JS identifiers, "The Gitea Authors" copyright headers, outbound User-Agent headers. Co-authored-by: Hanzo Dev <[email protected]>
221 lines
9.8 KiB
Handlebars
221 lines
9.8 KiB
Handlebars
{{template "base/head" .}}
|
|
{{$commitLinkBase := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/commit"}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository diff">
|
|
{{template "repo/header" .}}
|
|
<div class="ui container fluid padded">
|
|
<div class="ui top attached header clearing segment tw-relative commit-header">
|
|
<div class="tw-flex tw-mb-4 tw-gap-1">
|
|
<h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.MessageTitle}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.MessageUTF8 $.Repository}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "AdditionalClasses" "tw-inline"}}</h3>
|
|
{{if not $.PageIsWiki}}
|
|
<div class="commit-header-buttons">
|
|
<a class="ui primary tiny button" href="{{.SourcePath}}">
|
|
{{ctx.Locale.Tr "repo.diff.browse_source"}}
|
|
</a>
|
|
{{if and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}{{- /* */ -}}
|
|
<div class="ui dropdown primary tiny button">
|
|
{{ctx.Locale.Tr "repo.commit.operations"}}
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="menu">
|
|
<div class="header">{{ctx.Locale.Tr "repo.commit.operations"}}</div>
|
|
<div class="divider"></div>
|
|
<div class="item show-create-branch-modal"
|
|
data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
|
|
data-branch-from="{{ShortSha .CommitID}}"
|
|
data-branch-from-urlcomponent="{{.CommitID}}"
|
|
data-modal="#create-branch-modal">
|
|
{{ctx.Locale.Tr "repo.branch.create_branch_operation"}}
|
|
</div>
|
|
<div class="item show-create-branch-modal"
|
|
data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
|
|
data-branch-from="{{ShortSha .CommitID}}"
|
|
data-branch-from-urlcomponent="{{.CommitID}}"
|
|
data-modal="#create-tag-modal"
|
|
data-modal-from-span="#modal-create-tag-from-span"
|
|
data-modal-form="#create-tag-form">
|
|
{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
|
|
</div>
|
|
<div class="item show-modal revert-button"
|
|
data-modal="#cherry-pick-modal"
|
|
data-modal-cherry-pick-type="revert"
|
|
data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}"
|
|
data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.revert-content"}}"
|
|
data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.revert"}}">{{ctx.Locale.Tr "repo.commit.revert"}}</div>
|
|
<div class="item cherry-pick-button show-modal"
|
|
data-modal="#cherry-pick-modal"
|
|
data-modal-cherry-pick-type="cherry-pick"
|
|
data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}"
|
|
data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.cherry-pick-content"}}"
|
|
data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.cherry-pick"}}">{{ctx.Locale.Tr "repo.commit.cherry-pick"}}</div>
|
|
<div class="ui g-modal-confirm modal" id="cherry-pick-modal">
|
|
<div class="header">
|
|
<span id="cherry-pick-header"></span>
|
|
</div>
|
|
<div class="content">
|
|
<p id="cherry-pick-content" class="branch-dropdown"></p>
|
|
|
|
<form method="get">
|
|
{{template "repo/branch_dropdown" dict
|
|
"Repository" .Repository
|
|
"ShowTabBranches" true
|
|
"CurrentRefType" "branch"
|
|
"CurrentRefShortName" $.Repository.DefaultBranch
|
|
"RefFormActionTemplate" (print "{RepoLink}/_cherrypick/" .CommitID "/{RefShortName}")
|
|
}}
|
|
<input type="hidden" id="cherry-pick-type" name="cherry-pick-type"><br>
|
|
<button type="submit" id="cherry-pick-submit" class="ui primary button"></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="ui small modal" id="create-branch-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.branch.new_branch"}}
|
|
</div>
|
|
<div class="content">
|
|
<form class="ui form" id="create-branch-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.branch.new_branch_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-branch-from-span")}}
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label>
|
|
<input id="new_branch_name" name="new_branch_name" required>
|
|
</div>
|
|
|
|
<div class="actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.branch.confirm_create_branch"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="ui small modal" id="create-tag-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
|
|
</div>
|
|
<div class="content">
|
|
<form class="ui form" id="create-tag-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
|
|
<input type="hidden" name="create_tag" value="true">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.tag.create_tag_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-tag-from-span")}}
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label for="new_branch_name">{{ctx.Locale.Tr "repo.release.tag_name"}}</label>
|
|
<input id="new_branch_name" name="new_branch_name" required>
|
|
</div>
|
|
|
|
<div class="actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.tag.confirm_create_tag"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{if .Commit.MessageBody}}
|
|
<pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.MessageUTF8 $.Repository}}</pre>
|
|
{{end}}
|
|
{{template "repo/commit_load_branches_and_tags" .}}
|
|
</div>
|
|
|
|
<div class="ui bottom attached segment flex-text-block tw-flex-wrap">
|
|
<div class="flex-text-inline">
|
|
{{if .Author}}
|
|
{{ctx.AvatarUtils.Avatar .Author 20}}
|
|
<strong>{{.Author.GetShortDisplayNameLinkHTML}}</strong>
|
|
{{else}}
|
|
{{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 20}}
|
|
<strong>{{.Commit.Author.Name}}</strong>
|
|
{{end}}
|
|
</div>
|
|
<span class="tw-text-text-light">{{DateUtils.TimeSince .Commit.Committer.When}}</span>
|
|
|
|
{{$committerIsAuthor := and (eq .Commit.Committer.Name .Commit.Author.Name) (eq .Commit.Committer.Email .Commit.Author.Email)}}
|
|
{{if not $committerIsAuthor}}
|
|
<div class="flex-text-inline">
|
|
<span class="tw-text-text-light">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span>
|
|
{{if and .Verification.CommittingUser}}
|
|
{{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}}
|
|
<strong>{{.Verification.CommittingUser.GetShortDisplayNameLinkHTML}}</strong>
|
|
{{else}}
|
|
{{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Email 20}}
|
|
<strong>{{.Commit.Committer.Name}}</strong>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .CommitOtherParticipants}}
|
|
<div class="flex-text-inline">
|
|
<span class="tw-text-text-light">{{ctx.Locale.Tr "repo.diff.coauthored_by"}}</span>
|
|
{{range $participant := .CommitOtherParticipants}}
|
|
{{$user := $participant.User}}
|
|
{{$gitIdentity := $participant.GitIdentity}}
|
|
{{if $user}}
|
|
{{ctx.AvatarUtils.Avatar $user 20}}
|
|
<strong>{{$user.GetShortDisplayNameLinkHTML}}</strong>
|
|
{{else}}
|
|
{{$gitName := $gitIdentity.Name}}
|
|
{{$gitEmail := $gitIdentity.Email}}
|
|
{{ctx.AvatarUtils.AvatarByEmail $gitEmail $gitEmail 20}}{{/* use the same layout as the "author" above */}}
|
|
<strong>{{$gitName}}</strong>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .Verification}}
|
|
{{template "repo/commit_sign_badge" dict "CommitSignVerification" .Verification}}
|
|
{{end}}
|
|
|
|
<div class="tw-flex-1"></div>
|
|
|
|
<div class="flex-text-inline tw-gap-5">
|
|
{{if .Parents}}
|
|
<div class="flex-text-inline">
|
|
<span>{{ctx.Locale.Tr "repo.diff.parent"}}</span>
|
|
{{range .Parents}}
|
|
<a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .}}">{{ShortSha .}}</a>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-text-inline">
|
|
<span>{{ctx.Locale.Tr "repo.diff.commit"}}</span>
|
|
<a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .CommitID}}">{{ShortSha .CommitID}}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{if .NoteRendered}}
|
|
<div class="ui top attached header segment git-notes">
|
|
{{svg "octicon-note" 16 "tw-mr-2"}}
|
|
{{ctx.Locale.Tr "repo.diff.git-notes"}}:
|
|
{{if .NoteAuthor}}
|
|
<a href="{{.NoteAuthor.HomeLink}}">
|
|
{{if .NoteAuthor.FullName}}
|
|
<strong>{{.NoteAuthor.FullName}}</strong>
|
|
{{else}}
|
|
<strong>{{.NoteCommit.Author.Name}}</strong>
|
|
{{end}}
|
|
</a>
|
|
{{else}}
|
|
<strong>{{.NoteCommit.Author.Name}}</strong>
|
|
{{end}}
|
|
<span class="tw-text-text-light">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span>
|
|
</div>
|
|
<div class="ui bottom attached info segment git-notes">
|
|
<pre class="commit-body">{{.NoteRendered}}</pre>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{template "repo/diff/box" .}}
|
|
</div>
|
|
</div>
|
|
{{template "base/footer" .}}
|