diff options
Diffstat (limited to 'templates')
29 files changed, 100 insertions, 100 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index ccd1029cd8..0d9432b395 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -50,7 +50,7 @@ <dt>{{.locale.Tr "admin.config.reverse_auth_user"}}</dt> <dd>{{.ReverseProxyAuthUser}}</dd> - {{if .EnvVars }} + {{if .EnvVars}} <div class="ui divider"></div> {{range .EnvVars}} <dt>{{.Name}}</dt> diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index b5db356bd8..d34999e6eb 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -22,9 +22,9 @@ <td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td> <td>{{.Spec}}</td> <td>{{DateFmtLong .Next}}</td> - <td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td> + <td>{{if gt .Prev.Year 1}}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td> <td>{{.ExecTimes}}</td> - <td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status "" }}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td> + <td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td> </tr> {{end}} </tbody> diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 7d0fa0019a..b831f50c85 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -34,7 +34,7 @@ </tr> {{end}} </tbody> - {{ if .Notices }} + {{if .Notices}} <tfoot class="full-width"> <tr> <th></th> @@ -65,11 +65,11 @@ </th> </tr> </tfoot> - {{ end }} + {{end}} </table> </div> - {{ template "base/paginate" . }} + {{template "base/paginate" .}} </div> </div> diff --git a/templates/admin/process-row.tmpl b/templates/admin/process-row.tmpl index b97d0fc8dc..4ab190af46 100644 --- a/templates/admin/process-row.tmpl +++ b/templates/admin/process-row.tmpl @@ -1,6 +1,6 @@ <div class="item"> <div class="df ac"> - <div class="icon ml-3 mr-3">{{if eq .Process.Type "request"}}{{svg "octicon-globe" 16 }}{{else if eq .Process.Type "system"}}{{svg "octicon-cpu" 16 }}{{else}}{{svg "octicon-terminal" 16 }}{{end}}</div> + <div class="icon ml-3 mr-3">{{if eq .Process.Type "request"}}{{svg "octicon-globe" 16}}{{else if eq .Process.Type "system"}}{{svg "octicon-cpu" 16}}{{else}}{{svg "octicon-terminal" 16}}{{end}}</div> <div class="content f1"> <div class="header">{{.Process.Description}}</div> <div class="description"><span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span></div> diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl index a7ea4c602a..95fd3a5e05 100644 --- a/templates/admin/queue.tmpl +++ b/templates/admin/queue.tmpl @@ -30,12 +30,12 @@ </tbody> </table> </div> - {{if lt $sum 0 }} + {{if lt $sum 0}} <h4 class="ui top attached header"> {{.locale.Tr "admin.monitor.queue.nopool.title"}} </h4> <div class="ui attached segment"> - {{if eq .Queue.Type "wrapped" }} + {{if eq .Queue.Type "wrapped"}} <p>{{.locale.Tr "admin.monitor.queue.wrapped.desc"}}</p> {{else if eq .Queue.Type "persistable-channel"}} <p>{{.locale.Tr "admin.monitor.queue.persistable-channel.desc"}}</p> @@ -58,7 +58,7 @@ </div> <div class="inline field"> <label for="timeout">{{.locale.Tr "admin.monitor.queue.settings.timeout"}}</label> - <input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout }}"> + <input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout}}"> </div> <div class="inline field"> <label for="number">{{.locale.Tr "admin.monitor.queue.settings.numberworkers"}}</label> @@ -166,7 +166,7 @@ </tr> {{else}} <tr> - <td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none" }} + <td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none"}} </tr> {{end}} </tbody> diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index d8b337fc09..a8ae486bcb 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -2,13 +2,13 @@ <div class="df ac"> <div class="icon ml-3 mr-3"> {{if eq .Process.Type "request"}} - {{svg "octicon-globe" 16 }} + {{svg "octicon-globe" 16}} {{else if eq .Process.Type "system"}} - {{svg "octicon-cpu" 16 }} + {{svg "octicon-cpu" 16}} {{else if eq .Process.Type "normal"}} - {{svg "octicon-terminal" 16 }} + {{svg "octicon-terminal" 16}} {{else}} - {{svg "octicon-code" 16 }} + {{svg "octicon-code" 16}} {{end}} </div> <div class="content f1"> @@ -16,7 +16,7 @@ <div class="description">{{if ne .Process.Type "none"}}<span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span>{{end}}</div> </div> <div> - {{if or (eq .Process.Type "request") (eq .Process.Type "normal") }} + {{if or (eq .Process.Type "request") (eq .Process.Type "normal")}} <a class="delete-button icon" href="" data-url="{{.root.Link}}/cancel/{{.Process.PID}}" data-id="{{.Process.PID}}" data-name="{{.Process.Description}}">{{svg "octicon-trash" 16 "text-red"}}</a> {{end}} </div> @@ -29,7 +29,7 @@ <summary> <div class="dif content"> <div class="header ml-3"> - <span class="icon mr-3">{{svg "octicon-code" 16 }}</span>{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}} + <span class="icon mr-3">{{svg "octicon-code" 16}}</span>{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}} </div> <div class="description"> {{range .Labels}} @@ -41,7 +41,7 @@ <div class="list"> {{range .Entry}} <div class="item df ac"> - <span class="icon mr-4">{{svg "octicon-dot-fill" 16 }}</span> + <span class="icon mr-4">{{svg "octicon-dot-fill" 16}}</span> <div class="content f1"> <div class="header"><code>{{.Function}}</code></div> <div class="description"><code>{{.File}}:{{.Line}}</code></div> diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 0e1b382d9d..3fa0f8e7ac 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -16,7 +16,7 @@ <!-- Third-party libraries --> {{if .EnableCaptcha}} {{if eq .CaptchaType "recaptcha"}} - <script src='{{ URLJoin .RecaptchaURL "api.js"}}' async></script> + <script src='{{URLJoin .RecaptchaURL "api.js"}}' async></script> {{end}} {{if eq .CaptchaType "hcaptcha"}} <script src='https://hcaptcha.com/1/api.js' async></script> diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 233cf3e1d5..39749613de 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -65,8 +65,8 @@ <meta property="og:description" content="{{MetaDescription}}"> {{end}} <meta property="og:site_name" content="{{AppName}}"> -{{if .IsSigned }} - {{ if ne .SignedUser.Theme "gitea" }} +{{if .IsSigned}} + {{if ne .SignedUser.Theme "gitea"}} <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme | PathEscape}}.css?v={{AssetVersion}}"> {{end}} {{else if ne DefaultTheme "gitea"}} diff --git a/templates/base/head_script.tmpl b/templates/base/head_script.tmpl index a74923b55f..8369b63b35 100644 --- a/templates/base/head_script.tmpl +++ b/templates/base/head_script.tmpl @@ -21,18 +21,18 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly. enableTimeTracking: {{EnableTimetracking}}, {{if .RequireTribute}} tributeValues: Array.from(new Map([ - {{ range .Participants }} + {{range .Participants}} ['{{.Name}}', {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}', name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.AvatarLink}}'}], - {{ end }} - {{ range .Assignees }} + {{end}} + {{range .Assignees}} ['{{.Name}}', {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}', name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.AvatarLink}}'}], - {{ end }} - {{ range .MentionableTeams }} + {{end}} + {{range .MentionableTeams}} ['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}', name: '{{$.MentionableTeamsOrg}}/{{.Name}}', avatar: '{{$.MentionableTeamsOrgAvatar}}'}], - {{ end }} + {{end}} ]).values()), {{end}} mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}}, diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl index 45783b2263..b6429b1919 100644 --- a/templates/explore/code.tmpl +++ b/templates/explore/code.tmpl @@ -4,27 +4,27 @@ <div class="ui container"> <form class="ui form ignore-dirty" style="max-width: 100%"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable }} disabled{{end}} placeholder="{{.locale.Tr "explore.search"}}..." autofocus> - <div class="ui dropdown selection{{if .CodeIndexerUnavailable }} disabled{{end}}"> - <input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable }} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}} + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <div class="ui dropdown selection{{if .CodeIndexerUnavailable}} disabled{{end}}"> + <input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div> <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> <div class="item" data-value="">{{.locale.Tr "explore.search.fuzzy"}}</div> <div class="item" data-value="match">{{.locale.Tr "explore.search.match"}}</div> </div> </div> - <button class="ui primary button"{{if .CodeIndexerUnavailable }} disabled{{end}}>{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{.locale.Tr "explore.search"}}</button> </div> </form> <div class="ui divider"></div> <div class="ui user list"> - {{if .CodeIndexerUnavailable }} + {{if .CodeIndexerUnavailable}} <div class="ui error message"> <p>{{$.locale.Tr "explore.code_search_unavailable"}}</p> </div> {{else if .SearchResults}} <h3> - {{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html }} + {{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html}} </h3> <div class="df ac fw"> {{range $term := .SearchResultLanguages}} diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index cd75f48520..2a5c444dce 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -8,7 +8,7 @@ {{$avatar}} {{end}} <a class="name" href="{{.Link}}"> - {{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} + {{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} </a> <div class="labels df ac fw"> {{if .IsArchived}} @@ -39,9 +39,9 @@ </div> </div> <div class="metas df ac"> - {{if .PrimaryLanguage }} + {{if .PrimaryLanguage}} <a href="{{$.Link}}?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}"> - <span class="text grey df ac mr-3"><i class="color-icon mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{ .PrimaryLanguage.Language }}</span> + <span class="text grey df ac mr-3"><i class="color-icon mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{.PrimaryLanguage.Language}}</span> </a> {{end}} {{if not $.DisableStars}} @@ -51,12 +51,12 @@ </div> </div> <div class="description"> - {{ $description := .DescriptionHTML $.Context}} + {{$description := .DescriptionHTML $.Context}} {{if $description}}<p>{{$description}}</p>{{end}} - {{if .Topics }} + {{if .Topics}} <div class="ui tags"> {{range .Topics}} - {{if ne . "" }}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1"><div class="ui small label topic">{{.}}</div></a>{{end}} + {{if ne . ""}}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1"><div class="ui small label topic">{{.}}</div></a>{{end}} {{end}} </div> {{end}} diff --git a/templates/mail/release.tmpl b/templates/mail/release.tmpl index 931c0d1b54..b2acdce8b2 100644 --- a/templates/mail/release.tmpl +++ b/templates/mail/release.tmpl @@ -11,7 +11,7 @@ </head> -{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape) }} +{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape)}} {{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.HTMLURL | Escape) (.Release.Repo.FullName | Escape)}} <body> <p> diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 37cdf3ef02..c2f6c2d982 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -41,7 +41,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe }} + {{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} </div> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} @@ -56,7 +56,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe }} + {{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} </div> {{end}} </div> @@ -87,25 +87,25 @@ {{if .Permission.CanRead $.UnitTypeCode}} {{if eq .Activity.Code.CommitCountInAllBranches 0}} <div class="ui center aligned segment"> - <h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity" }}</h4> + <h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity"}}</h4> </div> {{end}} {{if gt .Activity.Code.CommitCountInAllBranches 0}} <div class="ui attached segment horizontal segments"> <div class="ui attached segment text"> - {{.locale.Tr "repo.activity.git_stats_exclude_merges" }} + {{.locale.Tr "repo.activity.git_stats_exclude_merges"}} <strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong> {{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} <strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }} + {{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} <strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_all_branches" }} - {{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }} + {{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}} + {{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} <strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong> {{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} - {{.locale.Tr "repo.activity.git_stats_additions" }} + {{.locale.Tr "repo.activity.git_stats_additions"}} <strong class="text green">{{.locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong> - {{.locale.Tr "repo.activity.git_stats_and_deletions" }} + {{.locale.Tr "repo.activity.git_stats_and_deletions"}} <strong class="text red">{{.locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>. </div> <div class="ui attached segment"> diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 9e3fadee0c..8ece768832 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -87,7 +87,7 @@ {{.CsrfTokenHtml}} <div class="field"> <label> - {{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe }} + {{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}} </label> </div> <div class="required field"> @@ -112,7 +112,7 @@ <input type="hidden" name="create_tag" value="true"> <div class="field"> <label> - {{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe }} + {{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}} </label> </div> <div class="required field"> diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 1003f2ee74..720067ce68 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -62,8 +62,8 @@ <span class="message-wrapper"> {{if $.PageIsWiki}} <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span> - {{else }} - {{ $commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String) }} + {{else}} + {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span> {{end}} </span> diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index c1e1363187..f2f121c42c 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -1,8 +1,8 @@ -{{ $index := 0}} +{{$index := 0}} <div class="timeline-item commits-list"> {{range .comment.Commits}} - {{ $tag := printf "%s-%d" $.comment.HashTag $index }} - {{ $index = Add $index 1}} + {{$tag := printf "%s-%d" $.comment.HashTag $index}} + {{$index = Add $index 1}} <div class="singular-commit" id="{{$tag}}"> <span class="badge badge-commit">{{svg "octicon-git-commit"}}</span> {{if .User}} @@ -46,7 +46,7 @@ {{end}} </span> - {{ $commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String) }} + {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}} <span class="mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</span> {{if IsMultilineCommitMessage .Message}} <button class="ui button ellipsis-button" aria-expanded="false">...</button> diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index a15f08da6d..ab54041b9d 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -3,7 +3,7 @@ {{if or .PageIsCommits (gt .CommitCount 0)}} {{.CommitCount}} {{.locale.Tr "repo.commits.commits"}} {{if .RefName}}({{.RefName}}){{end}} {{else if .IsNothingToCompare}} - {{.locale.Tr "repo.commits.nothing_to_compare" }} {{if .RefName}}({{.RefName}}){{end}} + {{.locale.Tr "repo.commits.nothing_to_compare"}} {{if .RefName}}({{.RefName}}){{end}} {{else}} {{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}} {{end}} diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl index a303c9d9fb..56e60d4229 100644 --- a/templates/repo/forks.tmpl +++ b/templates/repo/forks.tmpl @@ -19,6 +19,6 @@ </div> </div> - {{ template "base/paginate" . }} + {{template "base/paginate" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index 70985a5fa4..7efd6ec023 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -52,8 +52,8 @@ </h2> <div class="ui dividing"></div> <div class="ui segment loading hide" id="loading-indicator"></div> - {{ template "repo/graph/svgcontainer" .}} - {{ template "repo/graph/commits" .}} + {{template "repo/graph/svgcontainer" .}} + {{template "repo/graph/commits" .}} </div> </div> </div> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index a08196f264..831784a623 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -66,7 +66,7 @@ {{end}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.watch_guest_user" }}" data-position="top center"{{end}}> + <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.watch_guest_user"}}" data-position="top center"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> {{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{$.locale.Tr "repo.watch"}}{{end}} </button> @@ -78,7 +78,7 @@ {{if not $.DisableStars}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.star_guest_user" }}" data-position="top center"{{end}}> + <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.star_guest_user"}}" data-position="top center"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.locale.Tr "repo.star"}}{{end}} </button> @@ -182,21 +182,21 @@ {{end}} {{if .Permission.CanRead $.UnitTypePackages}} - <a href="{{.RepoLink}}/packages" class="{{ if .IsPackagesPage }}active{{end}} item"> + <a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active{{end}} item"> {{svg "octicon-package"}} {{.locale.Tr "packages.title"}} </a> {{end}} - {{ if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} - <a href="{{.RepoLink}}/projects" class="{{ if .IsProjectsPage }}active{{end}} item"> + {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} + <a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active{{end}} item"> {{svg "octicon-project"}} {{.locale.Tr "repo.project_board"}} {{if .Repository.NumOpenProjects}} <span class="ui primary small label">{{CountFmt .Repository.NumOpenProjects}}</span> {{end}} </a> - {{ end }} + {{end}} - {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }} + {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases"> {{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}} {{if .NumReleases}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 5c3eec8ab0..7b74c1cc76 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}} <div class="ui repo-description"> <div id="repo-desc"> - {{ $description := .Repository.DescriptionHTML $.Context}} + {{$description := .Repository.DescriptionHTML $.Context}} {{if $description}}<span class="description">{{$description}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.locale.Tr "repo.no_desc"}}</span>{{end}} <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> </div> @@ -13,12 +13,12 @@ <div class="ui repo-search"> <form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get"> <div class="field"> - <div class="ui action input{{if .CodeIndexerUnavailable }} disabled left icon tooltip{{end}}"{{if .CodeIndexerUnavailable }} data-content="{{.locale.Tr "repo.search.code_search_unavailable"}}"{{end}}> - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable }} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> - {{if .CodeIndexerUnavailable }} + <div class="ui action input{{if .CodeIndexerUnavailable}} disabled left icon tooltip{{end}}"{{if .CodeIndexerUnavailable}} data-content="{{.locale.Tr "repo.search.code_search_unavailable"}}"{{end}}> + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> + {{if .CodeIndexerUnavailable}} <i class="icon df ac jc">{{svg "octicon-alert"}}</i> {{end}} - <button class="ui icon button"{{if .CodeIndexerUnavailable }} disabled{{end}} type="submit"> + <button class="ui icon button"{{if .CodeIndexerUnavailable}} disabled{{end}} type="submit"> {{svg "octicon-search"}} </button> </div> @@ -63,8 +63,8 @@ <div class="repo-button-row df ac sb fw"> <div class="df ac"> {{template "repo/branch_dropdown" dict "root" .}} - {{ $n := len .TreeNames}} - {{ $l := Subtract $n 1}} + {{$n := len .TreeNames}} + {{$l := Subtract $n 1}} <!-- If home page, show new PR. If not, show breadcrumb --> {{if eq $n 0}} {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} @@ -99,7 +99,7 @@ </button> {{end}} {{else}} - <span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section" title="{{$v}}">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span> + <span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section" title="{{$v}}">{{EllipsisString $v 30}}</span>{{else}}{{$p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span> {{end}} </div> <div class="df ac"> @@ -130,7 +130,7 @@ </button> </div> {{end}} - {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} + {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame)}} <a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> {{svg "octicon-history" 16 "mr-3"}}{{.locale.Tr "repo.file_history"}} </a> diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl index 5a02418a5a..9d8845443e 100644 --- a/templates/repo/search.tmpl +++ b/templates/repo/search.tmpl @@ -5,26 +5,26 @@ <div class="ui repo-search"> <form class="ui form ignore-dirty" method="get"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable }} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> - <div class="ui dropdown selection{{if .CodeIndexerUnavailable }} disabled{{end}}"> - <input name="t" type="hidden"{{if .CodeIndexerUnavailable }} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}"> + <div class="ui dropdown selection{{if .CodeIndexerUnavailable}} disabled{{end}}"> + <input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="text">{{.locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div> <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> <div class="item" data-value="">{{.locale.Tr "repo.search.fuzzy"}}</div> <div class="item" data-value="match">{{.locale.Tr "repo.search.match"}}</div> </div> </div> - <button class="ui icon button"{{if .CodeIndexerUnavailable }} disabled{{end}} type="submit">{{svg "octicon-search" 16}}</button> + <button class="ui icon button"{{if .CodeIndexerUnavailable}} disabled{{end}} type="submit">{{svg "octicon-search" 16}}</button> </div> </form> </div> - {{if .CodeIndexerUnavailable }} + {{if .CodeIndexerUnavailable}} <div class="ui error message"> <p>{{$.locale.Tr "repo.search.code_search_unavailable"}}</p> </div> {{else if .Keyword}} <h3> - {{.locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html }} + {{.locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}} </h3> {{if .SearchResults}} <div class="df ac fw"> diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index 276bf05a4f..cf017caaff 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -1,4 +1,4 @@ -<div class="ui segments repository-summary{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats }} repository-summary-language-stats{{end}} mt-2 mb-0"> +<div class="ui segments repository-summary{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} repository-summary-language-stats{{end}} mt-2 mb-0"> <div class="ui segment sub-menu repository-menu"> <div class="ui two horizontal center link list"> {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}} @@ -19,27 +19,27 @@ {{end}} </div> </div> - {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats }} + {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} <div class="ui segment sub-menu language-stats-details" style="display: none"> <div class="ui horizontal center link list"> {{range .LanguageStats}} <div class="item df ac jc"> - <i class="color-icon mr-3" style="background-color: {{ .Color }}"></i> + <i class="color-icon mr-3" style="background-color: {{.Color}}"></i> <span class="bold mr-3"> - {{if eq .Language "other" }} - {{ $.locale.Tr "repo.language_other" }} + {{if eq .Language "other"}} + {{$.locale.Tr "repo.language_other"}} {{else}} - {{ .Language }} + {{.Language}} {{end}} </span> - {{ .Percentage }}% + {{.Percentage}}% </div> {{end}} </div> </div> <a class="ui segment language-stats"> {{range .LanguageStats}} - <div class="bar" style="width: {{ .Percentage }}%; background-color: {{ .Color }}"> </div> + <div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}"> </div> {{end}} </a> {{end}} diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl index 39d0021d0c..eec31d8b50 100644 --- a/templates/repo/user_cards.tmpl +++ b/templates/repo/user_cards.tmpl @@ -25,5 +25,5 @@ {{end}} </ul> - {{ template "base/paginate" . }} + {{template "base/paginate" .}} </div> diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index a76700a726..f06521046e 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -122,7 +122,7 @@ </table> <div class="code-line-menu ui vertical pointing menu tippy-target"> {{if $.Permission.CanRead $.UnitTypeIssues}} - <a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{.Repository.HTMLURL}}{{printf "/src/commit/" }}{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}" rel="nofollow noindex">{{.locale.Tr "repo.issues.context.reference_issue"}}</a> + <a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{.Repository.HTMLURL}}{{printf "/src/commit/"}}{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}" rel="nofollow noindex">{{.locale.Tr "repo.issues.context.reference_issue"}}</a> {{end}} <a class="item view_git_blame" href="{{.Repository.HTMLURL}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.view_git_blame"}}</a> <a class="item copy-line-permalink" data-url="{{.Repository.HTMLURL}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_copy_permalink"}}</a> diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index bd26fac24c..b923a9e6c0 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -18,14 +18,14 @@ <strong>{{.LatestCommit.Author.Name}}</strong> {{end}} {{end}} - <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}"> + <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}"> <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span> {{if .LatestCommit.Signature}} {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}} {{end}} </a> {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses "root" $}} - {{ $commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String) }} + {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}} <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span> {{if IsMultilineCommitMessage .LatestCommit.Message}} <button class="ui button ellipsis-button" aria-expanded="false">...</button> diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 86d67cb178..0e5879c612 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -1,5 +1,5 @@ <div class="issue list"> - {{ $approvalCounts := .ApprovalCounts}} + {{$approvalCounts := .ApprovalCounts}} {{range .Issues}} <li class="item df py-3"> <div class="issue-item-left df"> @@ -55,8 +55,8 @@ #{{.Index}} {{end}} </a> - {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale }} - {{if .OriginalAuthor }} + {{$timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale}} + {{if .OriginalAuthor}} {{$.locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}} {{else if gt .Poster.ID 0}} {{$.locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}} diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 2a973c2d5b..7644872f09 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -28,7 +28,7 @@ {{if .Owner.Location}} <li>{{svg "octicon-location"}} {{.Owner.Location}}</li> {{end}} - {{if .ShowUserEmail }} + {{if .ShowUserEmail}} <li> {{svg "octicon-mail"}} <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a> diff --git a/templates/user/project.tmpl b/templates/user/project.tmpl index b03787e5ef..3db9d19eed 100644 --- a/templates/user/project.tmpl +++ b/templates/user/project.tmpl @@ -58,7 +58,7 @@ <div class="inline field"> <label></label> <button class="ui green button"> - {{.locale.Tr "repo.projects.create" }} + {{.locale.Tr "repo.projects.create"}} </button> <a class="ui button" href="{{AppSubUrl}}/">{{.locale.Tr "cancel"}}</a> </div> |