diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/mail/notify/repo_transfer.tmpl | 17 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 18 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 18 | ||||
-rw-r--r-- | templates/user/notification/notification_div.tmpl | 8 |
4 files changed, 57 insertions, 4 deletions
diff --git a/templates/mail/notify/repo_transfer.tmpl b/templates/mail/notify/repo_transfer.tmpl new file mode 100644 index 0000000000..68ceded116 --- /dev/null +++ b/templates/mail/notify/repo_transfer.tmpl @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>{{.Subject}}</title> +</head> + +<body> + <p>{{.Subject}}. + To accept or reject it visit <a href="{{.Link}}">{{.Repo}}</a> or just ignore it. + <p> + --- + <br> + <a href="{{.Link}}">View it on Gitea</a>. + </p> +</body> +</html> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 31bcd5c48a..2f593567d5 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -42,6 +42,24 @@ </div> {{if not .IsBeingCreated}} <div class="repo-buttons"> + {{if $.RepoTransfer}} + <form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}"> + {{$.CsrfTokenHtml}} + <div class="ui poping up" data-content="{{if $.CanUserAcceptTransfer}}{{$.i18n.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.i18n.Tr "repo.transfer.no_permission_to_accept"}}{{end}}" data-position="bottom center" data-variation="tiny"> + <button type="submit" class="ui button {{if $.CanUserAcceptTransfer}}green {{end}} ok inverted small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> + {{$.i18n.Tr "repo.transfer.accept"}} + </button> + </div> + </form> + <form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}"> + {{$.CsrfTokenHtml}} + <div class="ui poping up" data-content="{{if $.CanUserAcceptTransfer}}{{$.i18n.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.i18n.Tr "repo.transfer.no_permission_to_reject"}}{{end}}" data-position="bottom center" data-variation="tiny"> + <button type="submit" class="ui button {{if $.CanUserAcceptTransfer}}red {{end}}ok inverted small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> + {{$.i18n.Tr "repo.transfer.reject"}} + </button> + </div> + </form> + {{end}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} <div class="ui labeled button{{if not $.IsSigned}} poping up{{end}}" tabindex="0"{{if not $.IsSigned}} data-content="{{$.i18n.Tr "repo.watch_guest_user" }}" data-position="top center" data-variation="tiny"{{end}}> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index e85451ac39..b69f90f9c5 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -444,11 +444,23 @@ {{end}} <div class="item"> <div class="ui right"> - <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button> + {{if .RepoTransfer}} + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="cancel_transfer"> + <button class="ui red button">{{.i18n.Tr "repo.settings.transfer_abort"}}</button> + </form> + {{ else }} + <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button> + {{ end }} </div> <div> <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5> - <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p> + {{if .RepoTransfer}} + <p>{{.i18n.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}</p> + {{else}} + <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p> + {{end}} </div> </div> @@ -599,7 +611,7 @@ <div class="text right actions"> <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> - <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button> + <button class="ui red button">{{.i18n.Tr "repo.settings.transfer_perform"}}</button> </div> </form> </div> diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl index 2f25e73387..2158dcb000 100644 --- a/templates/user/notification/notification_div.tmpl +++ b/templates/user/notification/notification_div.tmpl @@ -39,6 +39,8 @@ <td class="collapsing" data-href="{{.HTMLURL}}"> {{if eq .Status 3}} <span class="blue">{{svg "octicon-pin"}}</span> + {{else if not $issue}} + <span class="gray">{{svg "octicon-repo"}}</span> {{else if $issue.IsPull}} {{if $issue.IsClosed}} {{if $issue.GetPullRequest.HasMerged}} @@ -59,7 +61,11 @@ </td> <td class="eleven wide" data-href="{{.HTMLURL}}"> <a class="item" href="{{.HTMLURL}}"> - #{{$issue.Index}} - {{$issue.Title}} + {{if $issue}} + #{{$issue.Index}} - {{$issue.Title}} + {{else}} + {{$repo.FullName}} + {{end}} </a> </td> <td data-href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}"> |