mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Replace list.List
with slices (#16311)
* Replaced list with slice. * Fixed usage of pointer to temporary variable. * Replaced LIFO list with slice. * Lint * Removed type check. * Removed duplicated code. * Lint * Fixed merge. Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
{{.i18n.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink | Str2html}}
|
||||
{{else}}
|
||||
{{.i18n.Tr (TrN .i18n.Lang .Comment.Commits.Len "mail.issue.action.push_1" "mail.issue.action.push_n") .Doer.Name .Comment.Issue.PullRequest.HeadBranch .Comment.Commits.Len | Str2html}}
|
||||
{{.i18n.Tr (TrN .i18n.Lang (len .Comment.Commits) "mail.issue.action.push_1" "mail.issue.action.push_n") .Doer.Name .Comment.Issue.PullRequest.HeadBranch (len .Comment.Commits) | Str2html}}
|
||||
{{end}}
|
||||
</p>
|
||||
{{end}}
|
||||
@@ -69,9 +69,8 @@
|
||||
</div>
|
||||
{{end -}}
|
||||
{{if eq .ActionName "push"}}
|
||||
{{ $r:= List .Comment.Commits}}
|
||||
<ul>
|
||||
{{range $r}}
|
||||
{{range .Comment.Commits}}
|
||||
<li>
|
||||
<a href="{{AppUrl}}{{$.Comment.Issue.PullRequest.BaseRepo.OwnerName}}/{{$.Comment.Issue.PullRequest.BaseRepo.Name}}/commit/{{.ID}}">
|
||||
{{ShortSha .ID.String}}
|
||||
|
@@ -9,8 +9,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="commit-list">
|
||||
{{ $r:= List .Commits}}
|
||||
{{range $r}}
|
||||
{{range .Commits}}
|
||||
<tr>
|
||||
<td class="author">
|
||||
{{$userName := .Author.Name}}
|
||||
@@ -69,9 +68,7 @@
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
|
||||
{{end}}
|
||||
{{if eq (CommitType .) "SignCommitWithStatuses"}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
|
||||
{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
|
||||
{{if IsMultilineCommitMessage .Message}}
|
||||
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
|
||||
{{end}}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
{{ $r:= List .comment.Commits}}
|
||||
{{ $index := 0}}
|
||||
<div class="timeline-item commits-list">
|
||||
{{range $r}}
|
||||
{{range .comment.Commits}}
|
||||
{{ $tag := printf "%s-%d" $.comment.HashTag $index }}
|
||||
{{ $index = Add $index 1}}
|
||||
<div class="singular-commit" id="{{$tag}}">
|
||||
@@ -15,9 +14,7 @@
|
||||
{{end}}
|
||||
|
||||
<span class="ui float right shabox">
|
||||
{{if eq (CommitType .) "SignCommitWithStatuses"}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
|
||||
{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
|
||||
{{$class := "ui sha label"}}
|
||||
{{if .Signature}}
|
||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
||||
|
@@ -699,7 +699,7 @@
|
||||
{{ if .IsForcePush }}
|
||||
{{$.i18n.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr | Safe}}
|
||||
{{else}}
|
||||
{{$.i18n.Tr (TrN $.i18n.Lang .Commits.Len "repo.issues.push_commit_1" "repo.issues.push_commits_n") .Commits.Len $createdStr | Safe}}
|
||||
{{$.i18n.Tr (TrN $.i18n.Lang (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n") (len .Commits) $createdStr | Safe}}
|
||||
{{end}}
|
||||
</span>
|
||||
</div>
|
||||
|
@@ -89,17 +89,15 @@
|
||||
<ul>
|
||||
{{ $push := ActionContent2Commits .}}
|
||||
{{ $repoLink := .GetRepoLink}}
|
||||
{{if $push.Commits}}
|
||||
{{range $push.Commits}}
|
||||
{{ $commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
|
||||
<li>
|
||||
{{avatarHTML ($push.AvatarLink .AuthorEmail) 16 "mr-2" .AuthorName}}
|
||||
<a class="commit-id mr-2" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
|
||||
<span class="text truncate light grey">
|
||||
{{RenderCommitMessage .Message $repoLink $.ComposeMetas}}
|
||||
</span>
|
||||
</li>
|
||||
{{end}}
|
||||
{{range $push.Commits}}
|
||||
{{ $commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
|
||||
<li>
|
||||
{{avatarHTML ($push.AvatarLink .AuthorEmail) 16 "mr-2" .AuthorName}}
|
||||
<a class="commit-id mr-2" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
|
||||
<span class="text truncate light grey">
|
||||
{{RenderCommitMessage .Message $repoLink $.ComposeMetas}}
|
||||
</span>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if and (gt (len $push.Commits) 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" (len $push.Commits)}} »</a></li>{{end}}
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user