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

@ -243,7 +243,7 @@ clean:
.PHONY: fmt .PHONY: fmt
fmt: fmt:
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}' @MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
$(eval TEMPLATES := $(wildcard templates/**/*.tmpl)) $(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it @# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES) @$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)

View file

@ -23,7 +23,7 @@
<!-- LDAP and DLDAP --> <!-- LDAP and DLDAP -->
{{if or .Source.IsLDAP .Source.IsDLDAP}} {{if or .Source.IsLDAP .Source.IsDLDAP}}
{{ $cfg:=.Source.Cfg }} {{$cfg:=.Source.Cfg}}
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label> <label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
<div class="ui selection security-protocol dropdown"> <div class="ui selection security-protocol dropdown">
@ -180,7 +180,7 @@
<!-- SMTP --> <!-- SMTP -->
{{if .Source.IsSMTP}} {{if .Source.IsSMTP}}
{{ $cfg:=.Source.Cfg }} {{$cfg:=.Source.Cfg}}
<div class="inline required field"> <div class="inline required field">
<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label> <label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
<div class="ui selection type dropdown"> <div class="ui selection type dropdown">
@ -242,7 +242,7 @@
<!-- PAM --> <!-- PAM -->
{{if .Source.IsPAM}} {{if .Source.IsPAM}}
{{ $cfg:=.Source.Cfg }} {{$cfg:=.Source.Cfg}}
<div class="required field"> <div class="required field">
<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label> <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
<input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required> <input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
@ -262,7 +262,7 @@
<!-- OAuth2 --> <!-- OAuth2 -->
{{if .Source.IsOAuth2}} {{if .Source.IsOAuth2}}
{{ $cfg:=.Source.Cfg }} {{$cfg:=.Source.Cfg}}
<div class="inline required field"> <div class="inline required field">
<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label> <label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
<div class="ui selection type dropdown"> <div class="ui selection type dropdown">
@ -337,7 +337,7 @@
<div class="field"> <div class="field">
<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label> <label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes "," }}{{end}}"> <input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes ","}}{{end}}">
</div> </div>
<div class="field"> <div class="field">
<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> <label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
@ -365,7 +365,7 @@
<!-- SSPI --> <!-- SSPI -->
{{if .Source.IsSSPI}} {{if .Source.IsSSPI}}
{{ $cfg:=.Source.Cfg }} {{$cfg:=.Source.Cfg}}
<div class="field"> <div class="field">
<div class="ui checkbox"> <div class="ui checkbox">
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> <label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>

View file

@ -30,10 +30,10 @@
</div> </div>
<!-- LDAP and DLDAP --> <!-- LDAP and DLDAP -->
{{ template "admin/auth/source/ldap" . }} {{template "admin/auth/source/ldap" .}}
<!-- SMTP --> <!-- SMTP -->
{{ template "admin/auth/source/smtp" . }} {{template "admin/auth/source/smtp" .}}
<!-- PAM --> <!-- PAM -->
<div class="pam required field {{if not (eq .type 4)}}hide{{end}}"> <div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
@ -51,10 +51,10 @@
</div> </div>
<!-- OAuth2 --> <!-- OAuth2 -->
{{ template "admin/auth/source/oauth" . }} {{template "admin/auth/source/oauth" .}}
<!-- SSPI --> <!-- SSPI -->
{{ template "admin/auth/source/sspi" . }} {{template "admin/auth/source/sspi" .}}
<div class="ldap field"> <div class="ldap field">
<div class="ui checkbox"> <div class="ui checkbox">

View file

@ -12,7 +12,7 @@
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="field {{if .Err_UserName}}error{{end}}"> <div class="field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{.locale.Tr "username"}}</label> <label for="user_name">{{.locale.Tr "username"}}</label>
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal }}disabled{{end}}> <input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}}>
</div> </div>
<!-- Types and name --> <!-- Types and name -->
<div class="inline required field {{if .Err_LoginType}}error{{end}}"> <div class="inline required field {{if .Err_LoginType}}error{{end}}">

View file

@ -69,7 +69,7 @@
<div class="inline field local{{if ne .login_type "0-0"}} hide{{end}}"> <div class="inline field local{{if ne .login_type "0-0"}} hide{{end}}">
<div class="ui checkbox"> <div class="ui checkbox">
<label><strong>{{.locale.Tr "auth.allow_password_change" }}</strong></label> <label><strong>{{.locale.Tr "auth.allow_password_change"}}</strong></label>
<input name="must_change_password" type="checkbox" checked> <input name="must_change_password" type="checkbox" checked>
</div> </div>
</div> </div>

View file

@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.activate_account.title" (.DisplayName|DotEscape)}}</title> <title>{{.locale.Tr "mail.activate_account.title" (.DisplayName|DotEscape)}}</title>
</head> </head>
{{ $activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}} {{$activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}}
<body> <body>
<p>{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName | Str2html}}</p><br> <p>{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName | Str2html}}</p><br>
<p>{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br> <p>{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>

View file

@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.activate_email.title" (.DisplayName|DotEscape)}}</title> <title>{{.locale.Tr "mail.activate_email.title" (.DisplayName|DotEscape)}}</title>
</head> </head>
{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}} {{$activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}}
<body> <body>
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br> <p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
<p>{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br> <p>{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>

View file

@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.reset_password.title" (.DisplayName|DotEscape)}}</title> <title>{{.locale.Tr "mail.reset_password.title" (.DisplayName|DotEscape)}}</title>
</head> </head>
{{ $recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}} {{$recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}}
<body> <body>
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br> <p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
<p>{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br> <p>{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br>

View file

@ -5,7 +5,7 @@
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="list"> <div class="list">
{{ range .Members}} {{range .Members}}
<div class="item ui grid"> <div class="item ui grid">
<div class="ui four wide column" style="display: flex;"> <div class="ui four wide column" style="display: flex;">
{{avatar . 48}} {{avatar . 48}}
@ -19,7 +19,7 @@
{{$.locale.Tr "org.members.membership_visibility"}} {{$.locale.Tr "org.members.membership_visibility"}}
</div> </div>
<div class="meta"> <div class="meta">
{{ $isPublic := index $.MembersIsPublicMember .ID}} {{$isPublic := index $.MembersIsPublicMember .ID}}
{{if $isPublic}} {{if $isPublic}}
<strong>{{$.locale.Tr "org.members.public"}}</strong> <strong>{{$.locale.Tr "org.members.public"}}</strong>
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.locale.Tr "org.members.public_helper"}}</a>){{end}} {{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.locale.Tr "org.members.public_helper"}}</a>){{end}}

View file

@ -50,7 +50,7 @@
{{svg "octicon-package" 32}} {{svg "octicon-package" 32}}
<h2>{{.locale.Tr "packages.empty"}}</h2> <h2>{{.locale.Tr "packages.empty"}}</h2>
{{if and .Repository .CanWritePackages}} {{if and .Repository .CanWritePackages}}
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages" }} {{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages"}}
<p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p> <p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
{{end}} {{end}}
<p>{{.locale.Tr "packages.empty.documentation" | Safe}}</p> <p>{{.locale.Tr "packages.empty.documentation" | Safe}}</p>

View file

@ -3,12 +3,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}"> <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .GetType 4}} {{if eq .GetType 4}}
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"> <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}"> <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-down"}} {{svg "octicon-fold-down"}}
</a> </a>
{{end}} {{end}}
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}"> <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-up"}} {{svg "octicon-fold-up"}}
</a> </a>
@ -47,12 +47,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}"> <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .GetType 4}} {{if eq .GetType 4}}
<td colspan="2" class="lines-num"> <td colspan="2" class="lines-num">
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}"> <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-down"}} {{svg "octicon-fold-down"}}
</a> </a>
{{end}} {{end}}
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}"> <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-up"}} {{svg "octicon-fold-up"}}
</a> </a>

View file

@ -1,7 +1,7 @@
{{if $.comment}} {{if $.comment}}
{{ template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}} {{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
{{else if $.root}} {{else if $.root}}
{{ template "repo/diff/comment_form" $}} {{template "repo/diff/comment_form" $}}
{{else}} {{else}}
{{ template "repo/diff/comment_form" dict "root" $}} {{template "repo/diff/comment_form" dict "root" $}}
{{end}} {{end}}

View file

@ -1,8 +1,8 @@
{{range .comments}} {{range .comments}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.locale }} {{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
<div class="comment" id="{{.HashTag}}"> <div class="comment" id="{{.HashTag}}">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span> <span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> <a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@ -12,17 +12,17 @@
<div class="content comment-container"> <div class="content comment-container">
<div class="ui top attached header comment-header df ac sb"> <div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac"> <div class="comment-header-left df ac">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="text black mr-2"> <span class="text black mr-2">
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
<span class="text grey"> <span class="text grey">
{{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
</span> </span>
<span class="text migrate"> <span class="text migrate">
{{if $.root.Repository.OriginalURL}} {{if $.root.Repository.OriginalURL}}
({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe }}) ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe}})
{{end}} {{end}}
</span> </span>
{{else}} {{else}}
@ -46,7 +46,7 @@
</div> </div>
{{end}} {{end}}
{{end}} {{end}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}} {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
</div> </div>
</div> </div>

View file

@ -7,11 +7,11 @@
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} {{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.compare_changes"}} {{.locale.Tr "repo.pulls.compare_changes"}}
<div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div> <div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div>
{{ else }} {{else}}
{{.locale.Tr "action.compare_commits_general"}} {{.locale.Tr "action.compare_commits_general"}}
{{ end }} {{end}}
</h2> </h2>
{{ $BaseCompareName := $.BaseName -}} {{$BaseCompareName := $.BaseName -}}
{{- $HeadCompareName := $.HeadRepo.OwnerName -}} {{- $HeadCompareName := $.HeadRepo.OwnerName -}}
{{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}} {{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}}
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
@ -174,7 +174,7 @@
</div> </div>
{{if .IsNothingToCompare}} {{if .IsNothingToCompare}}
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }} {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div> <div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}> <div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
<button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button> <button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button>

View file

@ -4,17 +4,17 @@
<div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}"> <div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu"> <div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
<div class="new-menu-inner"> <div class="new-menu-inner">
<a class="item active" data-tab="diff-side-by-side-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a> <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
{{if and .blobBase .blobHead}} {{if and .blobBase .blobHead}}
<a class="item" data-tab="diff-swipe-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a> <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
<a class="item" data-tab="diff-overlay-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a> <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
<div class="hide"> <div class="hide">
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{ .file.Index }}"> <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.Index}}">
<div class="diff-side-by-side"> <div class="diff-side-by-side">
{{if .blobBase }} {{if .blobBase}}
<span class="side"> <span class="side">
<p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p> <p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p>
<span class="before-container"><img class="image-before" /></span> <span class="before-container"><img class="image-before" /></span>
@ -29,7 +29,7 @@
</p> </p>
</span> </span>
{{end}} {{end}}
{{if .blobHead }} {{if .blobHead}}
<span class="side"> <span class="side">
<p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p> <p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p>
<span class="after-container"><img class="image-after" /></span> <span class="after-container"><img class="image-after" /></span>
@ -47,7 +47,7 @@
</div> </div>
</div> </div>
{{if and .blobBase .blobHead}} {{if and .blobBase .blobHead}}
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{ .file.Index }}"> <div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
<div class="diff-swipe"> <div class="diff-swipe">
<div class="swipe-frame"> <div class="swipe-frame">
<span class="before-container"><img class="image-before" /></span> <span class="before-container"><img class="image-before" /></span>
@ -61,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{ .file.Index }}"> <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.Index}}">
<div class="diff-overlay"> <div class="diff-overlay">
<div class="overlay-frame"> <div class="overlay-frame">
<div class="ui centered"> <div class="ui centered">

View file

@ -22,9 +22,9 @@
</div> </div>
{{end}} {{end}}
<div class="ui divider"></div> <div class="ui divider"></div>
<button type="submit" name="type" value="approve" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button> <button type="submit" name="type" value="approve" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button> <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
<button type="submit" name="type" value="reject" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button> <button type="submit" name="type" value="reject" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
</form> </form>
</div> </div>
</div> </div>

View file

@ -6,12 +6,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}"> <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
{{if eq .GetType 4}} {{if eq .GetType 4}}
<td class="lines-num lines-num-old"> <td class="lines-num lines-num-old">
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}"> <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-down"}} {{svg "octicon-fold-down"}}
</a> </a>
{{end}} {{end}}
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}"> <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-up"}} {{svg "octicon-fold-up"}}
</a> </a>

View file

@ -5,12 +5,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}"> <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
{{if eq .GetType 4}} {{if eq .GetType 4}}
<td colspan="2" class="lines-num"> <td colspan="2" class="lines-num">
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}"> <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-down"}} {{svg "octicon-fold-down"}}
</a> </a>
{{end}} {{end}}
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}"> <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-up"}} {{svg "octicon-fold-up"}}
</a> </a>

View file

@ -3,19 +3,19 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu"> <div class="menu">
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all"> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all">
<i class="circle {{ if eq .WhitespaceBehavior "show-all" }}dot{{else}}outline{{end}} icon"></i> <i class="circle {{if eq .WhitespaceBehavior "show-all"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_show_everything"}} {{.locale.Tr "repo.diff.whitespace_show_everything"}}
</a> </a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all"> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all">
<i class="circle {{ if eq .WhitespaceBehavior "ignore-all" }}dot{{else}}outline{{end}} icon"></i> <i class="circle {{if eq .WhitespaceBehavior "ignore-all"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}} {{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
</a> </a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change"> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change">
<i class="circle {{ if eq .WhitespaceBehavior "ignore-change" }}dot{{else}}outline{{end}} icon"></i> <i class="circle {{if eq .WhitespaceBehavior "ignore-change"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}} {{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
</a> </a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol"> <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol">
<i class="circle {{ if eq .WhitespaceBehavior "ignore-eol" }}dot{{else}}outline{{end}} icon"></i> <i class="circle {{if eq .WhitespaceBehavior "ignore-eol"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}} {{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
</a> </a>
</div> </div>

View file

@ -11,8 +11,8 @@
<div class="fitted item treepath"> <div class="fitted item treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a> <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{ $n := len .TreeNames}} {{$n := len .TreeNames}}
{{ $l := Subtract $n 1}} {{$l := Subtract $n 1}}
{{range $i, $v := .TreeNames}} {{range $i, $v := .TreeNames}}
<div class="divider"> / </div> <div class="divider"> / </div>
{{if eq $i $l}} {{if eq $i $l}}

View file

@ -9,8 +9,8 @@
<div class="item fitted treepath"> <div class="item fitted treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a> <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
{{ $n := len .TreeNames}} {{$n := len .TreeNames}}
{{ $l := Subtract $n 1}} {{$l := Subtract $n 1}}
{{range $i, $v := .TreeNames}} {{range $i, $v := .TreeNames}}
<div class="divider"> / </div> <div class="divider"> / </div>
{{if eq $i $l}} {{if eq $i $l}}

View file

@ -1,10 +1,10 @@
<div id="rev-container"> <div id="rev-container">
<ul id="rev-list"> <ul id="rev-list">
{{ range $commitI, $commit := .Graph.Commits }} {{range $commitI, $commit := .Graph.Commits}}
<li {{if $commit.Rev}}id="commit-{{$commit.Rev}}"{{end}} data-flow="{{$commit.Flow}}"> <li {{if $commit.Rev}}id="commit-{{$commit.Rev}}"{{end}} data-flow="{{$commit.Flow}}">
{{ if $commit.OnlyRelation }} {{if $commit.OnlyRelation}}
<span></span> <span></span>
{{ else }} {{else}}
<span class="sha" id="{{$commit.ShortRev}}"> <span class="sha" id="{{$commit.ShortRev}}">
{{$class := "ui sha label"}} {{$class := "ui sha label"}}
{{if $commit.Commit.Signature}} {{if $commit.Commit.Signature}}
@ -72,8 +72,8 @@
{{end}} {{end}}
</span> </span>
<span class="time df ac">{{$commit.Date}}</span> <span class="time df ac">{{$commit.Date}}</span>
{{ end }} {{end}}
</li> </li>
{{ end }} {{end}}
</ul> </ul>
</div> </div>

View file

@ -19,7 +19,7 @@
</div> </div>
</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" .}} {{template "repo/issue/labels/edit_delete_label" .}}
{{end}} {{end}}
</div> </div>

View file

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

View file

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

View file

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

View file

@ -57,13 +57,13 @@
{{if or .Labels .OrgLabels}} {{if or .Labels .OrgLabels}}
{{range .Labels}} {{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}} <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}} {{end}}
<div class="ui divider"></div> <div class="ui divider"></div>
{{range .OrgLabels}} {{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}} <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}} {{end}}
{{else}} {{else}}
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div> <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="issueIndex" value="{{.Issue.Index}}"/>
<input type="hidden" id="type" value="{{.IssueType}}"> <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"> <div class="twelve wide column comment-list prevent-before-timeline">
<ui class="ui timeline"> <ui class="ui timeline">
<div id="{{.Issue.HashTag}}" class="timeline-item comment first"> <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> <span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> <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="content comment-container">
<div class="ui top attached header comment-header df ac sb"> <div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac"> <div class="comment-header-left df ac">
{{if .Issue.OriginalAuthor }} {{if .Issue.OriginalAuthor}}
<span class="text black"> <span class="text black">
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
{{ .Issue.OriginalAuthor }} {{.Issue.OriginalAuthor}}
</span> </span>
<span class="text grey"> <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>
<span class="text migrate"> <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> </span>
{{else}} {{else}}
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
@ -92,13 +92,13 @@
</div> </div>
</div> </div>
{{ template "repo/issue/view_content/comments" . }} {{template "repo/issue/view_content/comments" .}}
{{if and .Issue.IsPull (not $.Repository.IsArchived)}} {{if and .Issue.IsPull (not $.Repository.IsArchived)}}
{{ template "repo/issue/view_content/pull". }} {{template "repo/issue/view_content/pull".}}
{{end}} {{end}}
{{if .IsSigned}} {{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"> <div class="timeline-item comment form">
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}"> <a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
{{avatar .SignedUser}} {{avatar .SignedUser}}
@ -129,7 +129,7 @@
</form> </form>
</div> </div>
</div> </div>
{{ else if .Repository.IsArchived }} {{else if .Repository.IsArchived}}
<div class="ui warning message"> <div class="ui warning message">
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
{{.locale.Tr "repo.archive.pull.nocomment"}} {{.locale.Tr "repo.archive.pull.nocomment"}}
@ -137,7 +137,7 @@
{{.locale.Tr "repo.archive.issue.nocomment"}} {{.locale.Tr "repo.archive.issue.nocomment"}}
{{end}} {{end}}
</div> </div>
{{ end }} {{end}}
{{else}} {{else}}
{{if .Repository.IsArchived}} {{if .Repository.IsArchived}}
<div class="ui warning message"> <div class="ui warning message">
@ -191,7 +191,7 @@
</ui> </ui>
</div> </div>
{{ template "repo/issue/view_content/sidebar" . }} {{template "repo/issue/view_content/sidebar" .}}
</div> </div>
<div class="hide" id="edit-content-form"> <div class="hide" id="edit-content-form">
@ -231,7 +231,7 @@
<div class="ui small basic delete modal"> <div class="ui small basic delete modal">
<div class="ui icon header"> <div class="ui icon header">
{{svg "octicon-trash"}} {{svg "octicon-trash"}}
{{.locale.Tr "repo.branch.delete" .HeadTarget }} {{.locale.Tr "repo.branch.delete" .HeadTarget}}
</div> </div>
<div class="content"> <div class="content">
<p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p>

View file

@ -1,10 +1,10 @@
{{if .ctx.IsSigned}} {{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"> <a class="add-reaction">
{{svg "octicon-smiley"}} {{svg "octicon-smiley"}}
</a> </a>
<div class="menu"> <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> <div class="divider"></div>
{{range $value := AllowedReactions}} {{range $value := AllowedReactions}}
<div class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</div> <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}} {{range .Issue.Comments}}
{{if call $.ShouldShowCommentType .Type}} {{if call $.ShouldShowCommentType .Type}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.locale }} {{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
@ -14,7 +14,7 @@
35 = CANCEL_SCHEDULED_AUTO_MERGE_PR --> 35 = CANCEL_SCHEDULED_AUTO_MERGE_PR -->
{{if eq .Type 0}} {{if eq .Type 0}}
<div class="timeline-item comment" id="{{.HashTag}}"> <div class="timeline-item comment" id="{{.HashTag}}">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span> <span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@ -24,16 +24,16 @@
<div class="content comment-container"> <div class="content comment-container">
<div class="ui top attached header comment-header df ac sb"> <div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac"> <div class="comment-header-left df ac">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="text black mr-2"> <span class="text black mr-2">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
<span class="text grey"> <span class="text grey">
{{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}}
</span> </span>
<span class="text migrate"> <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> </span>
{{else}} {{else}}
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
@ -101,7 +101,7 @@
</a> </a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if .Issue.IsPull }} {{if .Issue.IsPull}}
{{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} {{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
{{else}} {{else}}
{{$.locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}} {{$.locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
@ -116,7 +116,7 @@
</a> </a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if .Issue.IsPull }} {{if .Issue.IsPull}}
{{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} {{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
{{else}} {{else}}
{{$.locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}} {{$.locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
@ -140,19 +140,19 @@
</span> </span>
</div> </div>
{{else if eq .Type 3 5 6}} {{else if eq .Type 3 5 6}}
{{ $refFrom:= "" }} {{$refFrom:= ""}}
{{if ne .RefRepoID .Issue.RepoID}} {{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}} {{end}}
{{ $refTr := "repo.issues.ref_issue_from" }} {{$refTr := "repo.issues.ref_issue_from"}}
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
{{ $refTr = "repo.issues.ref_pull_from" }} {{$refTr = "repo.issues.ref_pull_from"}}
{{else if eq .RefAction 1 }} {{else if eq .RefAction 1}}
{{ $refTr = "repo.issues.ref_closing_from" }} {{$refTr = "repo.issues.ref_closing_from"}}
{{else if eq .RefAction 2 }} {{else if eq .RefAction 2}}
{{ $refTr = "repo.issues.ref_reopening_from" }} {{$refTr = "repo.issues.ref_reopening_from"}}
{{end}} {{end}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.locale }} {{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span> <span class="badge">{{svg "octicon-bookmark"}}</span>
<a href="{{.Poster.HomeLink}}"> <a href="{{.Poster.HomeLink}}">
@ -224,11 +224,11 @@
</a> </a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a> <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}} {{$.locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
{{ else }} {{else}}
{{$.locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}} {{$.locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
{{ end }} {{end}}
</span> </span>
{{else}} {{else}}
<a href="{{.Assignee.HomeLink}}"> <a href="{{.Assignee.HomeLink}}">
@ -288,7 +288,7 @@
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
</span> </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"> <div class="detail">
{{svg "octicon-clock"}} {{svg "octicon-clock"}}
<span class="text grey">{{.Content}}</span> <span class="text grey">{{.Content}}</span>
@ -304,7 +304,7 @@
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}}
</span> </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"> <div class="detail">
{{svg "octicon-clock"}} {{svg "octicon-clock"}}
<span class="text grey">{{.Content}}</span> <span class="text grey">{{.Content}}</span>
@ -408,7 +408,7 @@
{{else if eq .Type 22}} {{else if eq .Type 22}}
<div class="timeline-item-group"> <div class="timeline-item-group">
<div class="timeline-item event"> <div class="timeline-item event">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
{{else}} {{else}}
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar .Poster}} {{avatar .Poster}}
@ -416,13 +416,13 @@
{{end}} {{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="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"> <span class="text grey">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="text black"> <span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</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}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}} {{end}}
@ -447,13 +447,13 @@
<div class="ui top attached header comment-header df ac sb"> <div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac"> <div class="comment-header-left df ac">
<span class="text grey"> <span class="text grey">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="text black"> <span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</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}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}} {{end}}
@ -509,7 +509,7 @@
{{if .Review.CodeComments}} {{if .Review.CodeComments}}
<div class="timeline-item event"> <div class="timeline-item event">
{{ range $filename, $lines := .Review.CodeComments}} {{range $filename, $lines := .Review.CodeComments}}
{{range $line, $comms := $lines}} {{range $line, $comms := $lines}}
<div class="ui segments"> <div class="ui segments">
<div class="ui segment py-3 df ac sb"> <div class="ui segment py-3 df ac sb">
@ -519,7 +519,7 @@
{{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}} {{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}}
<div class="df ac"> <div class="df ac">
<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment ml-3 word-break">{{$filename}}</a> <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"> <span class="ui label basic small ml-3">
{{$.locale.Tr "repo.issues.review.outdated"}} {{$.locale.Tr "repo.issues.review.outdated"}}
</span> </span>
@ -564,24 +564,24 @@
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}"> <div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}">
<div class="ui comments mb-0"> <div class="ui comments mb-0">
{{range $comms}} {{range $comms}}
{{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.locale }} {{$createdSubStr:= TimeSinceUnix .CreatedUnix $.locale}}
<div class="comment code-comment pb-4" id="{{.HashTag}}"> <div class="comment code-comment pb-4" id="{{.HashTag}}">
<div class="content"> <div class="content">
<div class="header comment-header"> <div class="header comment-header">
<div class="comment-header-left df ac"> <div class="comment-header-left df ac">
{{if not .OriginalAuthor }} {{if not .OriginalAuthor}}
<a class="avatar"> <a class="avatar">
{{avatar .Poster}} {{avatar .Poster}}
</a> </a>
{{end}} {{end}}
<span class="text grey"> <span class="text grey">
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
<span class="text black"> <span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
<span class="text grey"> {{if $.Repository.OriginalURL}}</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}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> <a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}} {{end}}
@ -671,17 +671,17 @@
<a href="{{.Poster.HomeLink}}"> <a href="{{.Poster.HomeLink}}">
{{avatar .Poster}} {{avatar .Poster}}
</a> </a>
{{ if .Content }} {{if .Content}}
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} {{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
</span> </span>
{{ else }} {{else}}
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} {{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
</span> </span>
{{ end }} {{end}}
</div> </div>
{{else if eq .Type 24}} {{else if eq .Type 24}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
@ -752,7 +752,7 @@
<span class="badge">{{svg "octicon-repo-push"}}</span> <span class="badge">{{svg "octicon-repo-push"}}</span>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> <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}} {{$.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}} {{else}}
{{$.locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}} {{$.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 .comment.Time}} {{/* compatibility with time comments made before v1.14 */}}
{{ if (not .comment.Time.Deleted) }} {{if (not .comment.Time.Deleted)}}
{{ if (or .ctx.IsAdmin (and .ctx.IsSigned (eq .ctx.SignedUserID .comment.PosterID))) }} {{if (or .ctx.IsAdmin (and .ctx.IsSigned (eq .ctx.SignedUserID .comment.PosterID)))}}
<span class="ui float right"> <span class="ui float right">
<div class="ui mini modal issue-delete-time-modal" data-id="{{.comment.Time.ID}}"> <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"> <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"}} {{svg "octicon-kebab-horizontal"}}
</a> </a>
<div class="menu"> <div class="menu">
{{ $referenceUrl := "" }} {{$referenceUrl := ""}}
{{ if .issue }} {{if .issue}}
{{ $referenceUrl = Printf "%s#%s" .ctx.Issue.HTMLURL .item.HashTag }} {{$referenceUrl = Printf "%s#%s" .ctx.Issue.HTMLURL .item.HashTag}}
{{ else }} {{else}}
{{ $referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag }} {{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag}}
{{ end }} {{end}}
<div class="item context" data-clipboard-text="{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.copy_link"}}</div> <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> <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}} {{if not .ctx.UnitIssuesGlobalDisabled}}

View file

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

View file

@ -1,5 +1,5 @@
{{range $key, $value := .Reactions}} {{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">{{ReactionToEmoji $key}}</span>
<span class="reaction-count">{{len $value}}</span> <span class="reaction-count">{{len $value}}</span>
</a> </a>

View file

@ -3,7 +3,7 @@
{{.locale.Tr "repo.issues.context.reference_issue"}} {{.locale.Tr "repo.issues.context.reference_issue"}}
</div> </div>
<div class="content" style="text-align:left"> <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}} {{.CsrfTokenHtml}}
<div class="ui segment content"> <div class="ui segment content">
<div class="field"> <div class="field">

View file

@ -2,7 +2,7 @@
<div class="ui segment metas"> <div class="ui segment metas">
{{template "repo/issue/branch_selector_field" .}} {{template "repo/issue/branch_selector_field" .}}
{{if .Issue.IsPull }} {{if .Issue.IsPull}}
<input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}"> <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"> <div class="ui {{if or (not .Reviewers) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
@ -79,10 +79,10 @@
{{end}} {{end}}
{{range .OriginalReviews}} {{range .OriginalReviews}}
<div class="item" style="margin-bottom: 10px;"> <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"> <span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{ .OriginalAuthor }} {{.OriginalAuthor}}
</span> </span>
</a> </a>
<span class="ui right type-icon text {{if eq .Type 1}}green <span class="ui right type-icon text {{if eq .Type 1}}green
@ -125,12 +125,12 @@
{{if or .Labels .OrgLabels}} {{if or .Labels .OrgLabels}}
{{range .Labels}} {{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}} <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}} {{end}}
<div class="ui divider"></div> <div class="ui divider"></div>
{{range .OrgLabels}} {{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}} <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}} {{end}}
{{else}} {{else}}
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div> <div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>
@ -337,7 +337,7 @@
</div> </div>
</div> </div>
{{end}} {{end}}
{{if .Repository.IsTimetrackerEnabled }} {{if .Repository.IsTimetrackerEnabled}}
{{if and .CanUseTimetracker (not .Repository.IsArchived)}} {{if and .CanUseTimetracker (not .Repository.IsArchived)}}
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui timetrack"> <div class="ui timetrack">
@ -580,7 +580,7 @@
{{if and .IsRepoAdmin (not .Repository.IsArchived)}} {{if and .IsRepoAdmin (not .Repository.IsArchived)}}
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui watching"> <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}} {{if .Issue.IsLocked}}
{{svg "octicon-key"}} {{svg "octicon-key"}}
{{.locale.Tr "repo.issues.unlock"}} {{.locale.Tr "repo.issues.unlock"}}
@ -592,7 +592,7 @@
</div> </div>
<div class="ui tiny modal" id="lock"> <div class="ui tiny modal" id="lock">
<div class="header"> <div class="header">
{{ if .Issue.IsLocked }} {{if .Issue.IsLocked}}
{{.locale.Tr "repo.issues.unlock.title"}} {{.locale.Tr "repo.issues.unlock.title"}}
{{else}} {{else}}
{{.locale.Tr "repo.issues.lock.title"}} {{.locale.Tr "repo.issues.lock.title"}}
@ -600,7 +600,7 @@
</div> </div>
<div class="content"> <div class="content">
<div class="ui warning message text left"> <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_1"}}<br>
{{.locale.Tr "repo.issues.unlock.notice_2"}}<br> {{.locale.Tr "repo.issues.unlock.notice_2"}}<br>
{{else}} {{else}}
@ -610,13 +610,13 @@
{{end}} {{end}}
</div> </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"> method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
{{ if not .Issue.IsLocked }} {{if not .Issue.IsLocked}}
<div class="field"> <div class="field">
<strong> {{ .locale.Tr "repo.issues.lock.reason" }} </strong> <strong> {{.locale.Tr "repo.issues.lock.reason"}} </strong>
</div> </div>
<div class="field"> <div class="field">
@ -644,7 +644,7 @@
<div class="text right actions"> <div class="text right actions">
<div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div> <div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div>
<button class="ui red button"> <button class="ui red button">
{{ if .Issue.IsLocked }} {{if .Issue.IsLocked}}
{{.locale.Tr "repo.issues.unlock_confirm"}} {{.locale.Tr "repo.issues.unlock_confirm"}}
{{else}} {{else}}
{{.locale.Tr "repo.issues.lock_confirm"}} {{.locale.Tr "repo.issues.lock_confirm"}}

View file

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

View file

@ -11,7 +11,7 @@
{{.Title}} {{.Title}}
</div> </div>
<div class="description tc"> <div class="description tc">
{{(Printf "repo.migrate.%s.description" .Name) | $.locale.Tr }} {{(Printf "repo.migrate.%s.description" .Name) | $.locale.Tr}}
</div> </div>
</div> </div>
</a> </a>

View file

@ -42,8 +42,8 @@
<li class="item"> <li class="item">
{{svg "octicon-project"}} <a href="{{$.RepoLink}}/projects/{{.ID}}">{{.Title}}</a> {{svg "octicon-project"}} <a href="{{$.RepoLink}}/projects/{{.ID}}">{{.Title}}</a>
<div class="meta"> <div class="meta">
{{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.locale }} {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
{{if .IsClosed }} {{if .IsClosed}}
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}} {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
{{end}} {{end}}
<span class="issue-stats"> <span class="issue-stats">

View file

@ -78,7 +78,7 @@
<div class="ui container fluid padded" id="project-board"> <div class="ui container fluid padded" id="project-board">
<div class="board"> <div class="board">
{{ range $board := .Boards }} {{range $board := .Boards}}
<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}"> <div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">
<div class="board-column-header df ac sb"> <div class="board-column-header df ac sb">
@ -169,13 +169,13 @@
</div> </div>
</div> </div>
</div> </div>
{{ end }} {{end}}
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui cards board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}"> <div class="ui cards board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
{{ range (index $.IssuesMap .ID) }} {{range (index $.IssuesMap .ID)}}
<!-- start issue card --> <!-- start issue card -->
<div class="card board-card" data-issue="{{.ID}}"> <div class="card board-card" data-issue="{{.ID}}">
@ -207,8 +207,8 @@
<div class="meta my-2"> <div class="meta my-2">
<span class="text light grey"> <span class="text light grey">
#{{.Index}} #{{.Index}}
{{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale }} {{$timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale}}
{{if .OriginalAuthor }} {{if .OriginalAuthor}}
{{$.locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}} {{$.locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}}
{{else if gt .Poster.ID 0}} {{else if gt .Poster.ID 0}}
{{$.locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}} {{$.locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}}
@ -217,43 +217,43 @@
{{end}} {{end}}
</span> </span>
</div> </div>
{{- if .MilestoneID }} {{- if .MilestoneID}}
<div class="meta my-2"> <div class="meta my-2">
<a class="milestone" href="{{$.RepoLink}}/milestone/{{ .MilestoneID}}"> <a class="milestone" href="{{$.RepoLink}}/milestone/{{.MilestoneID}}">
{{svg "octicon-milestone" 16 "mr-2 vm"}} {{svg "octicon-milestone" 16 "mr-2 vm"}}
<span class="vm">{{ .Milestone.Name }}</span> <span class="vm">{{.Milestone.Name}}</span>
</a> </a>
</div> </div>
{{- end }} {{- end}}
{{- range index $.LinkedPRs .ID }} {{- range index $.LinkedPRs .ID}}
<div class="meta my-2"> <div class="meta my-2">
<a href="{{$.RepoLink}}/pulls/{{ .Index }}"> <a href="{{$.RepoLink}}/pulls/{{.Index}}">
<span class="m-0 {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "mr-2 vm"}}</span> <span class="m-0 {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "mr-2 vm"}}</span>
<span class="vm">{{ .Title}} <span class="text light grey">#{{.Index}}</span></span> <span class="vm">{{.Title}} <span class="text light grey">#{{.Index}}</span></span>
</a> </a>
</div> </div>
{{- end }} {{- end}}
</div> </div>
{{ if or .Labels .Assignees }} {{if or .Labels .Assignees}}
<div class="extra content labels-list p-0 pt-2"> <div class="extra content labels-list p-0 pt-2">
{{ range .Labels }} {{range .Labels}}
<a class="ui label" target="_blank" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}};" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> <a class="ui label" target="_blank" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}};" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
{{ end }} {{end}}
<div class="right floated"> <div class="right floated">
{{ range .Assignees }} {{range .Assignees}}
<a class="tooltip" target="_blank" href="{{.HTMLURL}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini mr-3"}}</a> <a class="tooltip" target="_blank" href="{{.HTMLURL}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini mr-3"}}</a>
{{ end }} {{end}}
</div> </div>
</div> </div>
{{ end }} {{end}}
</div> </div>
<!-- stop issue card --> <!-- stop issue card -->
{{ end }} {{end}}
</div> </div>
</div> </div>
{{ end }} {{end}}
</div> </div>
</div> </div>

View file

@ -84,7 +84,7 @@
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a> <a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
</span> </span>
{{end}} {{end}}
{{if .Sha1 }} {{if .Sha1}}
{{template "repo/branch_dropdown" dict "root" $ "release" .}} {{template "repo/branch_dropdown" dict "root" $ "release" .}}
{{end}} {{end}}
{{end}} {{end}}
@ -95,12 +95,12 @@
<a href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{svg "octicon-tag" 16 "mr-2"}}{{.TagName}}</a> <a href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{svg "octicon-tag" 16 "mr-2"}}{{.TagName}}</a>
</h4> </h4>
<p class="text grey"> <p class="text grey">
{{ if gt .Publisher.ID 0 }} {{if gt .Publisher.ID 0}}
<span class="author"> <span class="author">
{{avatar .Publisher 20}} {{avatar .Publisher 20}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a> <a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
</span> </span>
{{ end }} {{end}}
<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}{{if .Target}}...{{.Target | PathEscapeSegments}}{{end}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.release.ahead.target" $.DefaultBranch}}</span> <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}{{if .Target}}...{{.Target | PathEscapeSegments}}{{end}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.release.ahead.target" $.DefaultBranch}}</span>
</p> </p>
<div class="download"> <div class="download">

View file

@ -56,7 +56,7 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{$.locale.Tr "repo.settings.teams"}} {{$.locale.Tr "repo.settings.teams"}}
</h4> </h4>
{{ $allowedToChangeTeams := ( or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner)) }} {{$allowedToChangeTeams := ( or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
{{if .Teams}} {{if .Teams}}
<div class="ui attached segment collaborator list"> <div class="ui attached segment collaborator list">
{{range $t, $team := .Teams}} {{range $t, $team := .Teams}}
@ -71,10 +71,10 @@
<div class="ui inline dropdown"> <div class="ui inline dropdown">
<div class="text">{{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div> <div class="text">{{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
</div> </div>
{{ if or (eq .AccessMode 1) (eq .AccessMode 2) }} {{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
{{ $first := true }} {{$first := true}}
<div class="description"> <div class="description">
Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $unit.Type) ($team.UnitEnabled $unit.Type)}}{{if $first}}{{ $first = false }}{{else}}, {{end}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}} Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $unit.Type) ($team.UnitEnabled $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
</div> </div>
{{end}} {{end}}
</div> </div>

View file

@ -5,7 +5,7 @@
<div class="ui container"> <div class="ui container">
{{template "base/alert" .}} {{template "base/alert" .}}
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist }} {{.locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
{{if gt .NumAssociatable 0}} {{if gt .NumAssociatable 0}}
<div class="ui right"> <div class="ui right">
<form class="ui form" method="post" action="{{$.Link}}/associate"> <form class="ui form" method="post" action="{{$.Link}}/associate">

View file

@ -336,7 +336,7 @@
</div> </div>
</div> </div>
<div class="ui checkbox"> <div class="ui checkbox">
<input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{ if .Repository.CloseIssuesViaCommitInAnyBranch }}checked{{end}}> <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}>
<label>{{.locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label> <label>{{.locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
</div> </div>
</div> </div>
@ -678,9 +678,9 @@
<input type="hidden" name="action" value="cancel_transfer"> <input type="hidden" name="action" value="cancel_transfer">
<button class="ui red button">{{.locale.Tr "repo.settings.transfer_abort"}}</button> <button class="ui red button">{{.locale.Tr "repo.settings.transfer_abort"}}</button>
</form> </form>
{{ else }} {{else}}
<button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.locale.Tr "repo.settings.transfer"}}</button> <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.locale.Tr "repo.settings.transfer"}}</button>
{{ end }} {{end}}
</div> </div>
<div> <div>
<h5>{{.locale.Tr "repo.settings.transfer"}}</h5> <h5>{{.locale.Tr "repo.settings.transfer"}}</h5>

View file

@ -93,14 +93,14 @@
{{if or .AllowlistUserIDs (and $.Owner.IsOrganization .AllowlistTeamIDs)}} {{if or .AllowlistUserIDs (and $.Owner.IsOrganization .AllowlistTeamIDs)}}
{{$userIDs := .AllowlistUserIDs}} {{$userIDs := .AllowlistUserIDs}}
{{range $.Users}} {{range $.Users}}
{{if contain $userIDs .ID }} {{if contain $userIDs .ID}}
<a class="ui basic image label" href="{{.HomeLink}}">{{avatar . 26}} {{.GetDisplayName}}</a> <a class="ui basic image label" href="{{.HomeLink}}">{{avatar . 26}} {{.GetDisplayName}}</a>
{{end}} {{end}}
{{end}} {{end}}
{{if $.Owner.IsOrganization}} {{if $.Owner.IsOrganization}}
{{$teamIDs := .AllowlistTeamIDs}} {{$teamIDs := .AllowlistTeamIDs}}
{{range $.Teams}} {{range $.Teams}}
{{if contain $teamIDs .ID }} {{if contain $teamIDs .ID}}
<a class="ui basic image label" href="{{$.Owner.OrganisationLink}}/teams/{{PathEscape .LowerName}}">{{.Name}}</a> <a class="ui basic image label" href="{{$.Owner.OrganisationLink}}/teams/{{PathEscape .LowerName}}">{{.Name}}</a>
{{end}} {{end}}
{{end}} {{end}}

View file

@ -54,7 +54,7 @@
<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
<pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}} <pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}}
<strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}} <strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
{{ range $key, $val := .RequestInfo.Headers }}<strong>{{$key}}:</strong> {{$val}} {{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
{{end}}</pre> {{end}}</pre>
<h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5> <h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre> <pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
@ -65,7 +65,7 @@
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}"> <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
{{if .ResponseInfo}} {{if .ResponseInfo}}
<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
<pre class="webhook-info">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}} <pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
{{end}}</pre> {{end}}</pre>
<h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5> <h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre> <pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>

View file

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="page-content repository wiki revisions"> <div class="page-content repository wiki revisions">
{{template "repo/header" .}} {{template "repo/header" .}}
{{ $title := .title}} {{$title := .title}}
<div class="ui container"> <div class="ui container">
<div class="ui stackable grid"> <div class="ui stackable grid">
<div class="ui eight wide column text right df ac je"> <div class="ui eight wide column text right df ac je">

View file

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="page-content repository wiki view"> <div class="page-content repository wiki view">
{{template "repo/header" .}} {{template "repo/header" .}}
{{ $title := .title}} {{$title := .title}}
<div class="ui container"> <div class="ui container">
<div class="repo-button-row df ac sb fw"> <div class="repo-button-row df ac sb fw">
<div class="df ac"> <div class="df ac">

View file

@ -20,7 +20,7 @@
<div class="inline field"> <div class="inline field">
<label></label> <label></label>
<button class="ui green button">{{.locale.Tr "settings.change_password" }}</button> <button class="ui green button">{{.locale.Tr "settings.change_password"}}</button>
</div> </div>
</form> </form>
</div> </div>

View file

@ -4,7 +4,7 @@
<div class="column seven wide"> <div class="column seven wide">
<div class="ui middle centered raised segments"> <div class="ui middle centered raised segments">
<h1 class="ui top attached header"> <h1 class="ui top attached header">
{{.locale.Tr "auth.authorization_failed" }} {{.locale.Tr "auth.authorization_failed"}}
</h1> </h1>
<h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3> <h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
<div class="ui attached segment"> <div class="ui attached segment">

View file

@ -10,10 +10,10 @@
</h2> </h2>
<div class="ui attached segment"> <div class="ui attached segment">
{{template "base/alert" .}} {{template "base/alert" .}}
{{if .user_email }} {{if .user_email}}
<div class="inline field"> <div class="inline field">
<label for="user_name">{{.locale.Tr "email"}}</label> <label for="user_name">{{.locale.Tr "email"}}</label>
<input id="user_name" type="text" value="{{ .user_email }}" disabled> <input id="user_name" type="text" value="{{.user_email}}" disabled>
</div> </div>
{{end}} {{end}}
{{if .IsResetForm}} {{if .IsResetForm}}
@ -34,7 +34,7 @@
<h4 class="ui dividing header"> <h4 class="ui dividing header">
{{.locale.Tr "twofa"}} {{.locale.Tr "twofa"}}
</h4> </h4>
<div class="ui warning visible message">{{.locale.Tr "settings.twofa_is_enrolled" | Str2html }}</div> <div class="ui warning visible message">{{.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</div>
{{if .scratch_code}} {{if .scratch_code}}
<div class="required inline field {{if .Err_Token}}error{{end}}"> <div class="required inline field {{if .Err_Token}}error{{end}}">
<label for="token">{{.locale.Tr "auth.scratch_code"}}</label> <label for="token">{{.locale.Tr "auth.scratch_code"}}</label>

View file

@ -46,19 +46,19 @@
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
<div class="inline field required"> <div class="inline field required">
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> <div class="g-recaptcha" data-sitekey="{{.RecaptchaSitekey}}"></div>
</div> </div>
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
<div class="inline field required"> <div class="inline field required">
<div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div> <div class="h-captcha" data-sitekey="{{.HcaptchaSitekey}}"></div>
</div> </div>
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "mcaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "mcaptcha")}}
<div class="inline field df ac db-small captcha-field"> <div class="inline field df ac db-small captcha-field">
<span>{{.locale.Tr "captcha"}}</span> <span>{{.locale.Tr "captcha"}}</span>
<div class="border-secondary w-100-small" id="mcaptcha__widget-container" style="width: 50%; height: 5em"></div> <div class="border-secondary w-100-small" id="mcaptcha__widget-container" style="width: 50%; height: 5em"></div>
<div class="m-captcha" data-sitekey="{{ .McaptchaSitekey }}" data-instance-url="{{ .McaptchaURL }}"></div> <div class="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
</div> </div>
{{end}} {{end}}

View file

@ -22,7 +22,7 @@
</div> </div>
<div class="inline field"> <div class="inline field">
<label for="openid">OpenID URI</label> <label for="openid">OpenID URI</label>
<input id="openid" value="{{ .OpenID }}" readonly> <input id="openid" value="{{.OpenID}}" readonly>
</div> </div>
<div class="inline field"> <div class="inline field">
<label></label> <label></label>

View file

@ -32,22 +32,22 @@
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
<div class="inline field required"> <div class="inline field required">
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> <div class="g-recaptcha" data-sitekey="{{.RecaptchaSitekey}}"></div>
</div> </div>
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
<div class="inline field required"> <div class="inline field required">
<div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div> <div class="h-captcha" data-sitekey="{{.HcaptchaSitekey}}"></div>
</div> </div>
{{end}} {{end}}
{{if and .EnableCaptcha (eq .CaptchaType "mcaptcha")}} {{if and .EnableCaptcha (eq .CaptchaType "mcaptcha")}}
<div class="inline field required"> <div class="inline field required">
<div class="m-captcha" data-sitekey="{{ .McaptchaSitekey }}" data-instance-url="{{ .McaptchaURL }}"></div> <div class="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
</div> </div>
{{end}} {{end}}
<div class="inline field"> <div class="inline field">
<label for="openid">OpenID URI</label> <label for="openid">OpenID URI</label>
<input id="openid" value="{{ .OpenID }}" readonly> <input id="openid" value="{{.OpenID}}" readonly>
</div> </div>
<div class="inline field"> <div class="inline field">
<label></label> <label></label>

View file

@ -23,38 +23,38 @@
{{$.locale.Tr "action.create_branch" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.create_branch" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}}
{{end}} {{end}}
{{else if eq .GetOpType 6}} {{else if eq .GetOpType 6}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.create_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.create_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 7}} {{else if eq .GetOpType 7}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.create_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.create_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 8}} {{else if eq .GetOpType 8}}
{{$.locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 9}} {{else if eq .GetOpType 9}}
{{$.locale.Tr "action.push_tag" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.push_tag" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 10}} {{else if eq .GetOpType 10}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.comment_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.comment_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 11}} {{else if eq .GetOpType 11}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.merge_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.merge_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 12}} {{else if eq .GetOpType 12}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.close_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.close_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 13}} {{else if eq .GetOpType 13}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.reopen_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.reopen_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 14}} {{else if eq .GetOpType 14}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.close_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.close_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 15}} {{else if eq .GetOpType 15}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.reopen_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.reopen_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 16}} {{else if eq .GetOpType 16}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.delete_tag" (.GetRepoLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.delete_tag" (.GetRepoLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 17}} {{else if eq .GetOpType 17}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.delete_branch" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.delete_branch" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 18}} {{else if eq .GetOpType 18}}
{{$.locale.Tr "action.mirror_sync_push" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.mirror_sync_push" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
@ -63,30 +63,30 @@
{{else if eq .GetOpType 20}} {{else if eq .GetOpType 20}}
{{$.locale.Tr "action.mirror_sync_delete" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.mirror_sync_delete" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 21}} {{else if eq .GetOpType 21}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.approve_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.approve_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 22}} {{else if eq .GetOpType 22}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.reject_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.reject_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 23}} {{else if eq .GetOpType 23}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$.locale.Tr "action.comment_pull" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{$.locale.Tr "action.comment_pull" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
{{else if eq .GetOpType 24}} {{else if eq .GetOpType 24}}
{{ $linkText := .Content | RenderEmoji }} {{$linkText := .Content | RenderEmoji}}
{{$.locale.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/releases/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}} {{$.locale.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/releases/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}}
{{else if eq .GetOpType 25}} {{else if eq .GetOpType 25}}
{{ $index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ $reviewer := index .GetIssueInfos 1}} {{$reviewer := index .GetIssueInfos 1}}
{{$.locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) $reviewer | Str2html}} {{$.locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) $reviewer | Str2html}}
{{end}} {{end}}
</p> </p>
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}} {{if or (eq .GetOpType 5) (eq .GetOpType 18)}}
<div class="content"> <div class="content">
<ul> <ul>
{{ $push := ActionContent2Commits .}} {{$push := ActionContent2Commits .}}
{{ $repoLink := .GetRepoLink}} {{$repoLink := .GetRepoLink}}
{{range $push.Commits}} {{range $push.Commits}}
{{ $commitLink := printf "%s/commit/%s" $repoLink .Sha1}} {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<li> <li>
{{avatarHTML ($push.AvatarLink .AuthorEmail) 16 "mr-2" .AuthorName}} {{avatarHTML ($push.AvatarLink .AuthorEmail) 16 "mr-2" .AuthorName}}
<a class="commit-id mr-2" href="{{$commitLink}}">{{ShortSha .Sha1}}</a> <a class="commit-id mr-2" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>

View file

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

View file

@ -2,7 +2,7 @@
<div class="ui container"> <div class="ui container">
<h1 class="ui dividing header">{{.locale.Tr "notification.notifications"}}</h1> <h1 class="ui dividing header">{{.locale.Tr "notification.notifications"}}</h1>
<div class="ui top attached tabular menu"> <div class="ui top attached tabular menu">
{{ $notificationUnreadCount := call .NotificationUnreadCount}} {{$notificationUnreadCount := call .NotificationUnreadCount}}
<a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active{{end}} item"> <a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active{{end}} item">
{{.locale.Tr "notification.unread"}} {{.locale.Tr "notification.unread"}}
<div class="ui label {{if not $notificationUnreadCount}}hidden{{end}}">{{$notificationUnreadCount}}</div> <div class="ui label {{if not $notificationUnreadCount}}hidden{{end}}">{{$notificationUnreadCount}}</div>

View file

@ -139,9 +139,9 @@
<div class="ui attached error segment"> <div class="ui attached error segment">
<div class="ui red message"> <div class="ui red message">
<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p> <p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
{{ if .UserDeleteWithComments }} {{if .UserDeleteWithComments}}
<p class="text left" style="font-weight: bold;">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p> <p class="text left" style="font-weight: bold;">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
{{ end }} {{end}}
</div> </div>
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post"> <form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
{{template "base/disable_form_autofill"}} {{template "base/disable_form_autofill"}}

View file

@ -29,7 +29,7 @@
</div> </div>
<div class="ui attached bottom segment"> <div class="ui attached bottom segment">
<h5 class="ui top header"> <h5 class="ui top header">
{{.locale.Tr "settings.create_oauth2_application" }} {{.locale.Tr "settings.create_oauth2_application"}}
</h5> </h5>
<form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post"> <form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}

View file

@ -1,7 +1,7 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "settings.manage_ssh_keys"}} {{.locale.Tr "settings.manage_ssh_keys"}}
<div class="ui right"> <div class="ui right">
{{if not .DisableSSH }} {{if not .DisableSSH}}
<div id="add-ssh-button" class="ui primary tiny show-panel button" data-panel="#add-ssh-key-panel"> <div id="add-ssh-button" class="ui primary tiny show-panel button" data-panel="#add-ssh-key-panel">
{{.locale.Tr "settings.add_key"}} {{.locale.Tr "settings.add_key"}}
</div> </div>

View file

@ -11,7 +11,7 @@
{{if .Dirs}} {{if .Dirs}}
<div class="ui middle aligned divided list"> <div class="ui middle aligned divided list">
{{range $dirI, $dir := .Dirs}} {{range $dirI, $dir := .Dirs}}
{{ $repo := index $.ReposMap $dir}} {{$repo := index $.ReposMap $dir}}
<div class="item"> <div class="item">
<div class="content"> <div class="content">
{{if $repo}} {{if $repo}}

View file

@ -4,7 +4,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
<p>{{.locale.Tr "settings.twofa_desc"}}</p> <p>{{.locale.Tr "settings.twofa_desc"}}</p>
{{if .TOTPEnrolled}} {{if .TOTPEnrolled}}
<p>{{$.locale.Tr "settings.twofa_is_enrolled" | Str2html }}</p> <p>{{$.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data"> <form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<p>{{.locale.Tr "settings.regenerate_scratch_token_desc"}}</p> <p>{{.locale.Tr "settings.regenerate_scratch_token_desc"}}</p>