1
0
Fork 0
forked from forgejo/forgejo

Make sure fmt catches all templates (#20979)

* Make sure fmt catches all templates

Make's `wildcard` is not recursive so it missed many template files, fix
that by using `find`.

* Update Makefile
This commit is contained in:
silverwind 2022-08-31 17:58:54 +02:00 committed by GitHub
parent c80ca94ab1
commit 647b2649b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 251 additions and 251 deletions

View file

@ -19,7 +19,7 @@
</div>
</div>
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived) }}
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
{{template "repo/issue/labels/edit_delete_label" .}}
{{end}}
</div>

View file

@ -21,7 +21,7 @@
<div class="ui attached segment">
<div class="labelspage">
{{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived) }}
{{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived)}}
{{template "repo/issue/labels/label_load_template" .}}
<div class="ui divider"></div>
{{else if and ($.PageIsOrgSettingsLabels) (eq .NumLabels 0)}}
@ -57,7 +57,7 @@
</div>
</li>
{{end}}
{{if and (not .PageIsOrgSettingsLabels) (.OrgLabels) }}
{{if and (not .PageIsOrgSettingsLabels) (.OrgLabels)}}
<li class="item">
<div class="ui grid middle aligned">
<div class="ten wide column">

View file

@ -22,7 +22,7 @@
</div>
<div class="ui one column stackable grid">
<div class="column">
{{ $closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale }}
{{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}}
{{if .IsClosed}}
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
{{else}}

View file

@ -71,7 +71,7 @@
</div>
</div>
<div class="meta">
{{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.locale }}
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
{{if .IsClosed}}
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
{{else}}

View file

@ -57,13 +57,13 @@
{{if or .Labels .OrgLabels}}
{{range .Labels}}
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{end}}
<div class="ui divider"></div>
{{range .OrgLabels}}
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{end}}
{{else}}
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>

View file

@ -15,11 +15,11 @@
<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"/>
<input type="hidden" id="type" value="{{.IssueType}}">
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
<div class="twelve wide column comment-list prevent-before-timeline">
<ui class="ui timeline">
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
{{if .Issue.OriginalAuthor }}
{{if .Issue.OriginalAuthor}}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}}
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
@ -29,16 +29,16 @@
<div class="content comment-container">
<div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac">
{{if .Issue.OriginalAuthor }}
{{if .Issue.OriginalAuthor}}
<span class="text black">
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
{{ .Issue.OriginalAuthor }}
{{.Issue.OriginalAuthor}}
</span>
<span class="text grey">
{{ .locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe }}
{{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}}
</span>
<span class="text migrate">
{{if .Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}
{{if .Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
</span>
{{else}}
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
@ -92,13 +92,13 @@
</div>
</div>
{{ template "repo/issue/view_content/comments" . }}
{{template "repo/issue/view_content/comments" .}}
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
{{ template "repo/issue/view_content/pull". }}
{{template "repo/issue/view_content/pull".}}
{{end}}
{{if .IsSigned}}
{{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived) }}
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
<div class="timeline-item comment form">
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
{{avatar .SignedUser}}
@ -129,7 +129,7 @@
</form>
</div>
</div>
{{ else if .Repository.IsArchived }}
{{else if .Repository.IsArchived}}
<div class="ui warning message">
{{if .Issue.IsPull}}
{{.locale.Tr "repo.archive.pull.nocomment"}}
@ -137,7 +137,7 @@
{{.locale.Tr "repo.archive.issue.nocomment"}}
{{end}}
</div>
{{ end }}
{{end}}
{{else}}
{{if .Repository.IsArchived}}
<div class="ui warning message">
@ -191,7 +191,7 @@
</ui>
</div>
{{ template "repo/issue/view_content/sidebar" . }}
{{template "repo/issue/view_content/sidebar" .}}
</div>
<div class="hide" id="edit-content-form">
@ -231,7 +231,7 @@
<div class="ui small basic delete modal">
<div class="ui icon header">
{{svg "octicon-trash"}}
{{.locale.Tr "repo.branch.delete" .HeadTarget }}
{{.locale.Tr "repo.branch.delete" .HeadTarget}}
</div>
<div class="content">
<p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p>

View file

@ -1,10 +1,10 @@
{{if .ctx.IsSigned}}
<div class="item action ui pointing select-reaction dropdown top right" data-action-url="{{ .ActionURL }}">
<div class="item action ui pointing select-reaction dropdown top right" data-action-url="{{.ActionURL}}">
<a class="add-reaction">
{{svg "octicon-smiley"}}
</a>
<div class="menu">
<div class="header">{{ .ctx.locale.Tr "repo.pick_reaction"}}</div>
<div class="header">{{.ctx.locale.Tr "repo.pick_reaction"}}</div>
<div class="divider"></div>
{{range $value := AllowedReactions}}
<div class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</div>

View file

@ -1,7 +1,7 @@
{{ template "base/alert" }}
{{template "base/alert"}}
{{range .Issue.Comments}}
{{if call $.ShouldShowCommentType .Type}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
@ -14,7 +14,7 @@
35 = CANCEL_SCHEDULED_AUTO_MERGE_PR -->
{{if eq .Type 0}}
<div class="timeline-item comment" id="{{.HashTag}}">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}}
<a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@ -24,16 +24,16 @@
<div class="content comment-container">
<div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
<span class="text black mr-2">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
<span class="text grey">
{{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}}
</span>
<span class="text migrate">
({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}
({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
</span>
{{else}}
{{if gt .Poster.ID 0}}
@ -101,7 +101,7 @@
</a>
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if .Issue.IsPull }}
{{if .Issue.IsPull}}
{{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
{{else}}
{{$.locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
@ -116,7 +116,7 @@
</a>
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if .Issue.IsPull }}
{{if .Issue.IsPull}}
{{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
{{else}}
{{$.locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
@ -140,19 +140,19 @@
</span>
</div>
{{else if eq .Type 3 5 6}}
{{ $refFrom:= "" }}
{{$refFrom:= ""}}
{{if ne .RefRepoID .Issue.RepoID}}
{{ $refFrom = $.locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape) }}
{{$refFrom = $.locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}}
{{end}}
{{ $refTr := "repo.issues.ref_issue_from" }}
{{$refTr := "repo.issues.ref_issue_from"}}
{{if .Issue.IsPull}}
{{ $refTr = "repo.issues.ref_pull_from" }}
{{else if eq .RefAction 1 }}
{{ $refTr = "repo.issues.ref_closing_from" }}
{{else if eq .RefAction 2 }}
{{ $refTr = "repo.issues.ref_reopening_from" }}
{{$refTr = "repo.issues.ref_pull_from"}}
{{else if eq .RefAction 1}}
{{$refTr = "repo.issues.ref_closing_from"}}
{{else if eq .RefAction 2}}
{{$refTr = "repo.issues.ref_reopening_from"}}
{{end}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span>
<a href="{{.Poster.HomeLink}}">
@ -224,11 +224,11 @@
</a>
<span class="text grey">
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
{{ if eq .Poster.ID .Assignee.ID }}
{{if eq .Poster.ID .Assignee.ID}}
{{$.locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
{{ else }}
{{else}}
{{$.locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
{{ end }}
{{end}}
</span>
{{else}}
<a href="{{.Assignee.HomeLink}}">
@ -288,7 +288,7 @@
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
</span>
{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
{{template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" .}}
<div class="detail">
{{svg "octicon-clock"}}
<span class="text grey">{{.Content}}</span>
@ -304,7 +304,7 @@
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}}
</span>
{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
{{template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" .}}
<div class="detail">
{{svg "octicon-clock"}}
<span class="text grey">{{.Content}}</span>
@ -408,7 +408,7 @@
{{else if eq .Type 22}}
<div class="timeline-item-group">
<div class="timeline-item event">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
{{else}}
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar .Poster}}
@ -416,13 +416,13 @@
{{end}}
<span class="badge{{if eq .Review.Type 1}} bg-green text-white{{else if eq .Review.Type 3}} bg-red text-white{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
<span class="text grey">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
<span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
{{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}}
@ -447,13 +447,13 @@
<div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac">
<span class="text grey">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
<span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
{{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}}
@ -509,7 +509,7 @@
{{if .Review.CodeComments}}
<div class="timeline-item event">
{{ range $filename, $lines := .Review.CodeComments}}
{{range $filename, $lines := .Review.CodeComments}}
{{range $line, $comms := $lines}}
<div class="ui segments">
<div class="ui segment py-3 df ac sb">
@ -519,7 +519,7 @@
{{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}}
<div class="df ac">
<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment ml-3 word-break">{{$filename}}</a>
{{if $invalid }}
{{if $invalid}}
<span class="ui label basic small ml-3">
{{$.locale.Tr "repo.issues.review.outdated"}}
</span>
@ -564,24 +564,24 @@
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}">
<div class="ui comments mb-0">
{{range $comms}}
{{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.locale }}
{{$createdSubStr:= TimeSinceUnix .CreatedUnix $.locale}}
<div class="comment code-comment pb-4" id="{{.HashTag}}">
<div class="content">
<div class="header comment-header">
<div class="comment-header-left df ac">
{{if not .OriginalAuthor }}
{{if not .OriginalAuthor}}
<a class="avatar">
{{avatar .Poster}}
</a>
{{end}}
<span class="text grey">
{{if .OriginalAuthor }}
{{if .OriginalAuthor}}
<span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
{{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}}
@ -671,17 +671,17 @@
<a href="{{.Poster.HomeLink}}">
{{avatar .Poster}}
</a>
{{ if .Content }}
{{if .Content}}
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
</span>
{{ else }}
{{else}}
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
</span>
{{ end }}
{{end}}
</div>
{{else if eq .Type 24}}
<div class="timeline-item event" id="{{.HashTag}}">
@ -752,7 +752,7 @@
<span class="badge">{{svg "octicon-repo-push"}}</span>
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{ if .IsForcePush }}
{{if .IsForcePush}}
{{$.locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}}
{{else}}
{{$.locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}}

View file

@ -1,6 +1,6 @@
{{ if .comment.Time }} {{/* compatibility with time comments made before v1.14 */}}
{{ if (not .comment.Time.Deleted) }}
{{ if (or .ctx.IsAdmin (and .ctx.IsSigned (eq .ctx.SignedUserID .comment.PosterID))) }}
{{if .comment.Time}} {{/* compatibility with time comments made before v1.14 */}}
{{if (not .comment.Time.Deleted)}}
{{if (or .ctx.IsAdmin (and .ctx.IsSigned (eq .ctx.SignedUserID .comment.PosterID)))}}
<span class="ui float right">
<div class="ui mini modal issue-delete-time-modal" data-id="{{.comment.Time.ID}}">
<form method="POST" class="delete-time-form" action="{{.ctx.RepoLink}}/issues/{{.ctx.Issue.Index}}/times/{{.comment.TimeID}}/delete">

View file

@ -4,12 +4,12 @@
{{svg "octicon-kebab-horizontal"}}
</a>
<div class="menu">
{{ $referenceUrl := "" }}
{{ if .issue }}
{{ $referenceUrl = Printf "%s#%s" .ctx.Issue.HTMLURL .item.HashTag }}
{{ else }}
{{ $referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag }}
{{ end }}
{{$referenceUrl := ""}}
{{if .issue}}
{{$referenceUrl = Printf "%s#%s" .ctx.Issue.HTMLURL .item.HashTag}}
{{else}}
{{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag}}
{{end}}
<div class="item context" data-clipboard-text="{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.copy_link"}}</div>
<div class="item context quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.ID}}">{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}</div>
{{if not .ctx.UnitIssuesGlobalDisabled}}

View file

@ -1,10 +1,10 @@
{{if or .PullReviewers .OriginalReviews }}
{{if or .PullReviewers .OriginalReviews}}
<div class="comment box">
<div class="content">
<div class="ui segment">
<h4>{{$.locale.Tr "repo.issues.review.reviewers"}}</h4>
{{range .PullReviewers}}
{{ $createdStr:= TimeSinceUnix .Review.UpdatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .Review.UpdatedUnix $.locale}}
<div class="ui divider"></div>
<div class="review-item">
<div class="review-item-left">
@ -71,7 +71,7 @@
{{- else if eq .Review.Type 4}}yellow
{{else}}grey{{end}}">
{{if .CanChange }}
{{if .CanChange}}
<a href="#" class="ui tooltip icon re-request-review {{if .Checked}}checked{{end}}" data-issue-id="{{$.Issue.ID}}" data-content="{{if .Checked}} {{$.locale.Tr "repo.issues.remove_request_review"}} {{else}} {{$.locale.Tr "repo.issues.re_request_review"}} {{end}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
{{if .Checked}} {{svg "octicon-trash"}} {{else}} {{svg "octicon-sync"}} {{end}}
</a>
@ -82,14 +82,14 @@
</div>
{{end}}
{{range .OriginalReviews}}
{{ $createdStr:= TimeSinceUnix .UpdatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .UpdatedUnix $.locale}}
<div class="ui divider"></div>
<div class="review-item">
<div class="review-item-left">
<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe }}">
<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
<span class="text black ">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
</a>
</div>
@ -180,7 +180,7 @@
<div class="item toggle-wip df ac sb" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title">
<div>
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
{{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress" }}
{{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
</div>
<div>
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
@ -224,7 +224,7 @@
{{else if .IsBlockedByChangedProtectedFiles}}
<div class="item">
<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe }}
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
<div class="ui ordered list">
{{range .ChangedProtectedFiles}}
<div data-value="-" class="item">{{.}}</div>
@ -248,7 +248,7 @@
</div>
<div class="item">
<i class="icon unlock"></i>
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
</div>
{{end}}
@ -278,7 +278,7 @@
{{else if .IsSigned}}
<div class="item">
<i class="icon unlock"></i>
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
</div>
{{end}}
{{end}}
@ -290,7 +290,7 @@
{{$.locale.Tr "repo.pulls.outdated_with_base_branch"}}
</div>
<div class="item-section-right">
{{if and .UpdateAllowed .UpdateByRebaseAllowed }}
{{if and .UpdateAllowed .UpdateByRebaseAllowed}}
<div class="dib">
<div class="ui buttons update-button">
<button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}">
@ -460,7 +460,7 @@
{{else if .IsBlockedByChangedProtectedFiles}}
<div class="item text red">
<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe }}
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
<div class="ui ordered list">
{{range .ChangedProtectedFiles}}
<div data-value="-" class="item">{{.}}</div>

View file

@ -1,5 +1,5 @@
{{range $key, $value := .Reactions}}
<a class="ui label basic{{if $value.HasUser $.ctx.SignedUserID}} primary{{end}}{{if not $.ctx.IsSigned}} disabled{{end}}" data-title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ $.ctx.locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" data-content="{{ $key }}" data-action-url="{{ $.ActionURL }}">
<a class="ui label basic{{if $value.HasUser $.ctx.SignedUserID}} primary{{end}}{{if not $.ctx.IsSigned}} disabled{{end}}" data-title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{$.ctx.locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" data-content="{{$key}}" data-action-url="{{$.ActionURL}}">
<span class="reaction">{{ReactionToEmoji $key}}</span>
<span class="reaction-count">{{len $value}}</span>
</a>

View file

@ -3,7 +3,7 @@
{{.locale.Tr "repo.issues.context.reference_issue"}}
</div>
<div class="content" style="text-align:left">
<form class="ui form" action="{{ Printf "%s/issues/new" .Repository.Link }}" method="post">
<form class="ui form" action="{{Printf "%s/issues/new" .Repository.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="ui segment content">
<div class="field">

View file

@ -2,7 +2,7 @@
<div class="ui segment metas">
{{template "repo/issue/branch_selector_field" .}}
{{if .Issue.IsPull }}
{{if .Issue.IsPull}}
<input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}">
<div class="ui {{if or (not .Reviewers) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
@ -79,10 +79,10 @@
{{end}}
{{range .OriginalReviews}}
<div class="item" style="margin-bottom: 10px;">
<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe }}">
<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
<span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }}
{{.OriginalAuthor}}
</span>
</a>
<span class="ui right type-icon text {{if eq .Type 1}}green
@ -125,12 +125,12 @@
{{if or .Labels .OrgLabels}}
{{range .Labels}}
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{end}}
<div class="ui divider"></div>
{{range .OrgLabels}}
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
{{end}}
{{else}}
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>
@ -337,7 +337,7 @@
</div>
</div>
{{end}}
{{if .Repository.IsTimetrackerEnabled }}
{{if .Repository.IsTimetrackerEnabled}}
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
<div class="ui divider"></div>
<div class="ui timetrack">
@ -580,7 +580,7 @@
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
<div class="ui divider"></div>
<div class="ui watching">
<button class="fluid ui show-modal button {{if .Issue.IsLocked }} negative {{end}}" data-modal="#lock">
<button class="fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock">
{{if .Issue.IsLocked}}
{{svg "octicon-key"}}
{{.locale.Tr "repo.issues.unlock"}}
@ -592,7 +592,7 @@
</div>
<div class="ui tiny modal" id="lock">
<div class="header">
{{ if .Issue.IsLocked }}
{{if .Issue.IsLocked}}
{{.locale.Tr "repo.issues.unlock.title"}}
{{else}}
{{.locale.Tr "repo.issues.lock.title"}}
@ -600,7 +600,7 @@
</div>
<div class="content">
<div class="ui warning message text left">
{{ if .Issue.IsLocked }}
{{if .Issue.IsLocked}}
{{.locale.Tr "repo.issues.unlock.notice_1"}}<br>
{{.locale.Tr "repo.issues.unlock.notice_2"}}<br>
{{else}}
@ -610,13 +610,13 @@
{{end}}
</div>
<form class="ui form" action="{{.Issue.Link}}{{ if .Issue.IsLocked }}/unlock{{else}}/lock{{end}}"
<form class="ui form" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
method="post">
{{.CsrfTokenHtml}}
{{ if not .Issue.IsLocked }}
{{if not .Issue.IsLocked}}
<div class="field">
<strong> {{ .locale.Tr "repo.issues.lock.reason" }} </strong>
<strong> {{.locale.Tr "repo.issues.lock.reason"}} </strong>
</div>
<div class="field">
@ -644,7 +644,7 @@
<div class="text right actions">
<div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div>
<button class="ui red button">
{{ if .Issue.IsLocked }}
{{if .Issue.IsLocked}}
{{.locale.Tr "repo.issues.unlock_confirm"}}
{{else}}
{{.locale.Tr "repo.issues.lock_confirm"}}

View file

@ -44,8 +44,8 @@
{{$baseHref = printf "<a href=\"%s\">%s</a>" (.BaseBranchHTMLURL | Escape) $baseHref}}
{{end}}
{{if .Issue.PullRequest.HasMerged}}
{{ $mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale }}
{{if .Issue.OriginalAuthor }}
{{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale}}
{{if .Issue.OriginalAuthor}}
{{.Issue.OriginalAuthor}}
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
{{else}}
@ -53,7 +53,7 @@
<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
{{end}}
{{else}}
{{if .Issue.OriginalAuthor }}
{{if .Issue.OriginalAuthor}}
<span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span>
{{else}}
<span id="pull-desc" class="pull-desc">
@ -80,11 +80,11 @@
</div>
<div class="scrolling menu" id="branch-select">
{{range .Branches}}
{{ $sameBase := ne $.BaseName $.HeadUserName }}
{{ $differentBranch := ne . $.HeadBranch }}
{{ if or $sameBase $differentBranch }}
{{$sameBase := ne $.BaseName $.HeadUserName}}
{{$differentBranch := ne . $.HeadBranch}}
{{if or $sameBase $differentBranch}}
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
{{ end }}
{{end}}
{{end}}
</div>
</div>
@ -92,9 +92,9 @@
</span>
{{end}}
{{else}}
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale }}
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
<span class="time-desc">
{{if .Issue.OriginalAuthor }}
{{if .Issue.OriginalAuthor}}
{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}}
{{else if gt .Issue.Poster.ID 0}}
{{$.locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}}