fix(ui): login form on 403 page + visibility badge right-aligned #431
@@ -186,6 +186,7 @@ func (ctx *Context) Forbidden() {
|
||||
|
||||
ctx.Data["IsRepo"] = ctx.Repo.Repository != nil
|
||||
ctx.Data["Title"] = "Access Denied"
|
||||
ctx.Data["CurrentURL"] = ctx.Req.URL.RequestURI()
|
||||
ctx.HTML(http.StatusForbidden, "status/403")
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,24 @@
|
||||
<div class="status-page-error-title">403 Access Denied</div>
|
||||
<div class="tw-text-center">
|
||||
<div class="tw-my-4">{{if .AccessDeniedPrompt}}{{.AccessDeniedPrompt}}{{else}}{{ctx.Locale.Tr "error403"}}{{end}}</div>
|
||||
{{if not .IsSigned}}
|
||||
<a class="ui primary button tw-my-4" href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "sign_in"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if not .IsSigned}}
|
||||
<div class="tw-max-w-sm tw-mx-auto tw-mt-4">
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/login" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="redirect_to" value="{{.CurrentURL}}">
|
||||
<div class="required field">
|
||||
<label>{{ctx.Locale.Tr "home.uname_holder"}}</label>
|
||||
<input type="text" name="user_name" required autofocus>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label>{{ctx.Locale.Tr "password"}}</label>
|
||||
<input type="password" name="password" required>
|
||||
</div>
|
||||
<button class="ui primary fluid button tw-mt-2" type="submit">{{ctx.Locale.Tr "sign_in"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user