]> source.dussan.org Git - gitea.git/commitdiff
unify layout between auth pages (#13547)
authorNorwin <noerw@users.noreply.github.com>
Sat, 14 Nov 2020 02:46:40 +0000 (02:46 +0000)
committerGitHub <noreply@github.com>
Sat, 14 Nov 2020 02:46:40 +0000 (21:46 -0500)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
templates/user/auth/link_account.tmpl
templates/user/auth/signin.tmpl
templates/user/auth/signup.tmpl
templates/user/auth/signup_inner.tmpl
web_src/less/_form.less
web_src/less/_home.less

index 339ca855dd936e2961886ba0245463c1abe4362d..b7fa998a0d7cc774d8a77f548df83def1af0cffc 100644 (file)
@@ -1,21 +1,20 @@
 {{template "base/head" .}}
 
 <div class="user link-account">
+       <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
+               <!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
+               <a class="item {{if not .user_exists}}active{{end}}"
+                       data-tab="auth-link-signup-tab">
+                       {{.i18n.Tr "auth.oauth_signup_tab"}}
+               </a>
+               <a class="item {{if .user_exists}}active{{end}}"
+                       data-tab="auth-link-signin-tab">
+                       {{.i18n.Tr "auth.oauth_signin_tab"}}
+               </a>
+       </div>
+
        <div class="ui middle very relaxed page grid">
                <div class="column">
-
-                       <div class="ui tabular menu">
-                               <!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
-                               <div class="item {{if not .user_exists}}active{{end}}"
-                                       data-tab="auth-link-signup-tab">
-                                       {{.i18n.Tr "auth.oauth_signup_tab"}}
-                               </div>
-                               <div class="item {{if .user_exists}}active{{end}}"
-                                       data-tab="auth-link-signin-tab">
-                                       {{.i18n.Tr "auth.oauth_signin_tab"}}
-                               </div>
-                       </div>
-                       
                        <div class="ui tab {{if not .user_exists}}active{{end}}"
                                data-tab="auth-link-signup-tab">
                                {{template "user/auth/signup_inner" .}}
index bbb471cacb4cc3d59b6b27cc0878677ad7091680..cee40acfc4b99707ac85d2a73c0f42593dd193ae 100644 (file)
@@ -1,8 +1,10 @@
 {{template "base/head" .}}
 <div class="user signin{{if .LinkAccountMode}} icon{{end}}">
        {{template "user/auth/signin_navbar" .}}
-       <div class="ui container">
-               {{template "user/auth/signin_inner" .}}
+       <div class="ui middle very relaxed page grid">
+               <div class="ui container column">
+                       {{template "user/auth/signin_inner" .}}
+               </div>
        </div>
 </div>
 {{template "base/footer" .}}
index b814b466c8dcc3ca7b2240794247673cfbd0c6e1..69319864732c8762fd40a5c8643fc09365b21e01 100644 (file)
@@ -1,3 +1,7 @@
 {{template "base/head" .}}
-{{template "user/auth/signup_inner" .}}
+<div class="user signin{{if .LinkAccountMode}} icon{{end}}">
+       <div class="ui middle very relaxed page grid">
+               {{template "user/auth/signup_inner" .}}
+       </div>
+</div>
 {{template "base/footer" .}}
index 57dd22db4cbf8182ba08ade5154159416cd517dc..70fc2947c3233042ec78ae930b7a3ca427d5d126 100644 (file)
@@ -1,82 +1,78 @@
-<div class="user signup{{if .LinkAccountMode}} icon{{end}}">
-       <div class="ui middle very relaxed page grid">
-               <div class="column">
-                       <form class="ui form" action="{{.SignUpLink}}" method="post">
-                               {{.CsrfTokenHtml}}
-                               <h3 class="ui top attached header">
-                                       {{if .LinkAccountMode}}
-                                               {{.i18n.Tr "auth.oauth_signup_title"}}
-                                       {{else}}
-                                               {{.i18n.Tr "sign_up"}}
-                                       {{end}}
-                               </h3>
-                               <div class="ui attached segment">
-                                       {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
-                                       {{template "base/alert" .}}
-                                       {{end}}
-                                       {{if .DisableRegistration}}
-                                               <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
-                                       {{else}}
-                                               <div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-                                                       <label for="user_name">{{.i18n.Tr "username"}}</label>
-                                                       <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
-                                               </div>
-                                               <div class="required inline field {{if .Err_Email}}error{{end}}">
-                                                       <label for="email">{{.i18n.Tr "email"}}</label>
-                                                       <input id="email" name="email" type="email" value="{{.email}}" required>
-                                               </div>
-
-                                               {{if not .DisablePassword}}
-                                                       <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-                                                               <label for="password">{{.i18n.Tr "password"}}</label>
-                                                               <input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
-                                                       </div>
-                                                       <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-                                                               <label for="retype">{{.i18n.Tr "re_type"}}</label>
-                                                               <input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
-                                                       </div>
-                                               {{end}}
-                                               {{if and .EnableCaptcha (eq .CaptchaType "image")}}
-                                                       <div class="inline field">
-                                                               <label></label>
-                                                               {{.Captcha.CreateHtml}}
-                                                       </div>
-                                                       <div class="required inline field {{if .Err_Captcha}}error{{end}}">
-                                                               <label for="captcha">{{.i18n.Tr "captcha"}}</label>
-                                                               <input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
-                                                       </div>
-                                               {{end}}
-                                               {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
-                                                       <div class="inline field required">
-                                                               <div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
-                                                       </div>
-                                               {{end}}
-                                               {{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
-                                                       <div class="inline field required">
-                                                               <div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div>
-                                                       </div>
-                                               {{end}}
+<div class="ui container column{{if .LinkAccountMode}} icon{{end}}">
+       <h4 class="ui top attached header center">
+               {{if .LinkAccountMode}}
+                       {{.i18n.Tr "auth.oauth_signup_title"}}
+               {{else}}
+                       {{.i18n.Tr "sign_up"}}
+               {{end}}
+       </h4>
+       <div class="ui attached segment">
+               <form class="ui form" action="{{.SignUpLink}}" method="post">
+                       {{.CsrfTokenHtml}}
+                       {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
+                       {{template "base/alert" .}}
+                       {{end}}
+                       {{if .DisableRegistration}}
+                               <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
+                       {{else}}
+                               <div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
+                                       <label for="user_name">{{.i18n.Tr "username"}}</label>
+                                       <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
+                               </div>
+                               <div class="required inline field {{if .Err_Email}}error{{end}}">
+                                       <label for="email">{{.i18n.Tr "email"}}</label>
+                                       <input id="email" name="email" type="email" value="{{.email}}" required>
+                               </div>
 
-                                               <div class="inline field">
-                                                       <label></label>
-                                                       <button class="ui green button">
-                                                               {{if .LinkAccountMode}}
-                                                                       {{.i18n.Tr "auth.oauth_signup_submit"}}
-                                                               {{else}}
-                                                                       {{.i18n.Tr "auth.create_new_account"}}
-                                                               {{end}}
-                                                       </button>
-                                               </div>
+                               {{if not .DisablePassword}}
+                                       <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
+                                               <label for="password">{{.i18n.Tr "password"}}</label>
+                                               <input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
+                                       </div>
+                                       <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
+                                               <label for="retype">{{.i18n.Tr "re_type"}}</label>
+                                               <input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
+                                       </div>
+                               {{end}}
+                               {{if and .EnableCaptcha (eq .CaptchaType "image")}}
+                                       <div class="inline field">
+                                               <label></label>
+                                               {{.Captcha.CreateHtml}}
+                                       </div>
+                                       <div class="required inline field {{if .Err_Captcha}}error{{end}}">
+                                               <label for="captcha">{{.i18n.Tr "captcha"}}</label>
+                                               <input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
+                                       </div>
+                               {{end}}
+                               {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
+                                       <div class="inline field required">
+                                               <div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
+                                       </div>
+                               {{end}}
+                               {{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
+                                       <div class="inline field required">
+                                               <div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div>
+                                       </div>
+                               {{end}}
 
-                                               {{if not .LinkAccountMode}}
-                                               <div class="inline field">
-                                                       <label></label>
-                                                       <a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
-                                               </div>
+                               <div class="inline field">
+                                       <label></label>
+                                       <button class="ui green button">
+                                               {{if .LinkAccountMode}}
+                                                       {{.i18n.Tr "auth.oauth_signup_submit"}}
+                                               {{else}}
+                                                       {{.i18n.Tr "auth.create_new_account"}}
                                                {{end}}
-                                       {{end}}
+                                       </button>
+                               </div>
+
+                               {{if not .LinkAccountMode}}
+                               <div class="inline field">
+                                       <label></label>
+                                       <a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
                                </div>
-                       </form>
-               </div>
+                               {{end}}
+                       {{end}}
+               </form>
        </div>
 </div>
index a7b65265f25cc985c886f3784a5592fc51c6c9a6..1f9a02b26342ee5f956c4447d48878ec8849e6ae 100644 (file)
@@ -232,6 +232,7 @@ textarea:focus,
 .user.activate,
 .user.forgot.password,
 .user.reset.password,
+.user.link-account,
 .user.signin,
 .user.signup {
   @input-padding: 200px;
index 10d6ca33624802653bb7041474fcedbbbed1d637..139df3022b19d6dfe98fda51f88c95625a625a17 100644 (file)
   }
 }
 
-.signup {
-  padding-top: 15px;
-}
-
 footer {
   .ui.container .left,
   .ui.container .right {