##// END OF EJS Templates
login: show editions in login/register/password-reset boxes.
marcink -
r2819:8640032f default
parent child Browse files
Show More
@@ -1,88 +1,90 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
2 <%inherit file="base/root.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Sign In')}
5 ${_('Sign In')}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10
10
11 <style>body{background-color:#eeeeee;}</style>
11 <style>body{background-color:#eeeeee;}</style>
12 <div class="loginbox">
12 <div class="loginbox">
13 <div class="header">
13 <div class="header">
14 <div id="header-inner" class="title">
14 <div id="header-inner" class="title">
15 <div id="logo">
15 <div id="logo">
16 <div class="logo-wrapper">
16 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
18 </div>
18 </div>
19 %if c.rhodecode_name:
19 %if c.rhodecode_name:
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
21 %endif
21 %endif
22 </div>
22 </div>
23 </div>
23 </div>
24 </div>
24 </div>
25
25
26 <div class="loginwrapper">
26 <div class="loginwrapper">
27 <rhodecode-toast id="notifications"></rhodecode-toast>
27 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <div class="left-column">
28 <div class="left-column">
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
30 </div>
30 </div>
31 <%block name="above_login_button" />
31 <%block name="above_login_button" />
32 <div id="login" class="right-column">
32 <div id="login" class="right-column">
33 <!-- login -->
33 <!-- login -->
34 <div class="sign-in-title">
34 <div class="sign-in-title">
35 <h1>${_('Sign In')}</h1>
35 <h1>${_('Sign In')}</h1>
36 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
36 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
37 <h4>${h.link_to(_("Go to the registration page to create a new account."), request.route_path('register'))}</h4>
37 <h4>${h.link_to(_("Go to the registration page to create a new account."), request.route_path('register'))}</h4>
38 %endif
38 %endif
39 </div>
39 </div>
40 <div class="inner form">
40 <div class="inner form">
41 ${h.form(request.route_path('login', _query={'came_from': c.came_from}), needs_csrf_token=False)}
41 ${h.form(request.route_path('login', _query={'came_from': c.came_from}), needs_csrf_token=False)}
42
42
43 <label for="username">${_('Username')}:</label>
43 <label for="username">${_('Username')}:</label>
44 ${h.text('username', class_='focus', value=defaults.get('username'))}
44 ${h.text('username', class_='focus', value=defaults.get('username'))}
45 %if 'username' in errors:
45 %if 'username' in errors:
46 <span class="error-message">${errors.get('username')}</span>
46 <span class="error-message">${errors.get('username')}</span>
47 <br />
47 <br />
48 %endif
48 %endif
49
49
50 <label for="password">${_('Password')}:</label>
50 <label for="password">${_('Password')}:</label>
51 ${h.password('password', class_='focus')}
51 ${h.password('password', class_='focus')}
52 %if 'password' in errors:
52 %if 'password' in errors:
53 <span class="error-message">${errors.get('password')}</span>
53 <span class="error-message">${errors.get('password')}</span>
54 <br />
54 <br />
55 %endif
55 %endif
56
56
57 ${h.checkbox('remember', value=True, checked=defaults.get('remember'))}
57 ${h.checkbox('remember', value=True, checked=defaults.get('remember'))}
58 <label class="checkbox" for="remember">${_('Remember me')}</label>
58 <label class="checkbox" for="remember">${_('Remember me')}</label>
59
59
60 %if h.HasPermissionAny('hg.password_reset.enabled')():
60 %if h.HasPermissionAny('hg.password_reset.enabled')():
61 <p class="links">
61 <p class="links">
62 ${h.link_to(_('Forgot your password?'), h.route_path('reset_password'), class_='pwd_reset')}
62 ${h.link_to(_('Forgot your password?'), h.route_path('reset_password'), class_='pwd_reset')}
63 </p>
63 </p>
64 %elif h.HasPermissionAny('hg.password_reset.hidden')():
64 %elif h.HasPermissionAny('hg.password_reset.hidden')():
65 <p class="help-block">
65 <p class="help-block">
66 ${_('Password reset is disabled. Please contact ')}
66 ${_('Password reset is disabled. Please contact ')}
67 % if c.visual.rhodecode_support_url:
67 % if c.visual.rhodecode_support_url:
68 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
68 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
69 ${_('or')}
69 ${_('or')}
70 % endif
70 % endif
71 ${_('an administrator if you need help.')}
71 ${_('an administrator if you need help.')}
72 </p>
72 </p>
73 %endif
73 %endif
74
74
75 ${h.submit('sign_in', _('Sign In'), class_="btn sign-in")}
75 ${h.submit('sign_in', _('Sign In'), class_="btn sign-in")}
76
76 <p class="help-block pull-right">
77 RhodeCode ${c.rhodecode_edition}
78 </p>
77 ${h.end_form()}
79 ${h.end_form()}
78 <script type="text/javascript">
80 <script type="text/javascript">
79 $(document).ready(function(){
81 $(document).ready(function(){
80 $('#username').focus();
82 $('#username').focus();
81 })
83 })
82 </script>
84 </script>
83 </div>
85 </div>
84 <!-- end login -->
86 <!-- end login -->
85 <%block name="below_login_button" />
87 <%block name="below_login_button" />
86 </div>
88 </div>
87 </div>
89 </div>
88 </div>
90 </div>
@@ -1,98 +1,101 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
2 <%inherit file="base/root.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Reset Password')}
5 ${_('Reset Password')}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10 <style>body{background-color:#eeeeee;}</style>
10 <style>body{background-color:#eeeeee;}</style>
11
11
12 <div class="loginbox">
12 <div class="loginbox">
13 <div class="header">
13 <div class="header">
14 <div id="header-inner" class="title">
14 <div id="header-inner" class="title">
15 <div id="logo">
15 <div id="logo">
16 <div class="logo-wrapper">
16 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
18 </div>
18 </div>
19 %if c.rhodecode_name:
19 %if c.rhodecode_name:
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
21 %endif
21 %endif
22 </div>
22 </div>
23 </div>
23 </div>
24 </div>
24 </div>
25
25
26 <div class="loginwrapper">
26 <div class="loginwrapper">
27 <rhodecode-toast id="notifications"></rhodecode-toast>
27 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <div class="left-column">
28 <div class="left-column">
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
30 </div>
30 </div>
31
31
32 %if h.HasPermissionAny('hg.password_reset.disabled')():
32 %if h.HasPermissionAny('hg.password_reset.disabled')():
33 <div class="right-column">
33 <div class="right-column">
34 <p>
34 <p>
35 ${_('Password reset is disabled. Please contact ')}
35 ${_('Password reset is disabled. Please contact ')}
36 % if c.visual.rhodecode_support_url:
36 % if c.visual.rhodecode_support_url:
37 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
37 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
38 ${_('or')}
38 ${_('or')}
39 % endif
39 % endif
40 ${_('an administrator if you need help.')}
40 ${_('an administrator if you need help.')}
41 </p>
41 </p>
42 </div>
42 </div>
43 %else:
43 %else:
44 <div id="register" class="right-column">
44 <div id="register" class="right-column">
45 <!-- login -->
45 <!-- login -->
46 <div class="sign-in-title">
46 <div class="sign-in-title">
47 <h1>${_('Reset your Password')}</h1>
47 <h1>${_('Reset your Password')}</h1>
48 <h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
48 <h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
49 </div>
49 </div>
50 <div class="inner form">
50 <div class="inner form">
51 ${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
51 ${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
52 <label for="email">${_('Email Address')}:</label>
52 <label for="email">${_('Email Address')}:</label>
53 ${h.text('email', defaults.get('email'))}
53 ${h.text('email', defaults.get('email'))}
54 %if 'email' in errors:
54 %if 'email' in errors:
55 <span class="error-message">${errors.get('email')}</span>
55 <span class="error-message">${errors.get('email')}</span>
56 <br />
56 <br />
57 %endif
57 %endif
58 <p class="help-block">${_('Password reset link will be sent to matching email address')}</p>
58
59
59 %if captcha_active:
60 %if captcha_active:
60 <div class="login-captcha">
61 <div class="login-captcha">
61 <label for="email">${_('Captcha')}:</label>
62 <label for="email">${_('Captcha')}:</label>
62 ${h.hidden('recaptcha_field')}
63 ${h.hidden('recaptcha_field')}
63 <div id="recaptcha"></div>
64 <div id="recaptcha"></div>
64
65
65 %if 'recaptcha_field' in errors:
66 %if 'recaptcha_field' in errors:
66 <span class="error-message">${errors.get('recaptcha_field')}</span>
67 <span class="error-message">${errors.get('recaptcha_field')}</span>
67 <br />
68 <br />
68 %endif
69 %endif
69 </div>
70 </div>
70 %endif
71 %endif
71
72
72 ${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
73 ${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
73 <div class="activation_msg">${_('Password reset link will be sent to matching email address')}</div>
74 <p class="help-block pull-right">
75 RhodeCode ${c.rhodecode_edition}
76 </p>
74
77
75 ${h.end_form()}
78 ${h.end_form()}
76 </div>
79 </div>
77 </div>
80 </div>
78 %endif
81 %endif
79 </div>
82 </div>
80 </div>
83 </div>
81
84
82 <script type="text/javascript">
85 <script type="text/javascript">
83 $(document).ready(function(){
86 $(document).ready(function(){
84 $('#email').focus();
87 $('#email').focus();
85 });
88 });
86 </script>
89 </script>
87
90
88 % if captcha_active:
91 % if captcha_active:
89 <script type="text/javascript">
92 <script type="text/javascript">
90 var onloadCallback = function() {
93 var onloadCallback = function() {
91 grecaptcha.render('recaptcha', {
94 grecaptcha.render('recaptcha', {
92 'sitekey' : "${captcha_public_key}"
95 'sitekey' : "${captcha_public_key}"
93 });
96 });
94 };
97 };
95 </script>
98 </script>
96 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
99 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
97 % endif
100 % endif
98
101
@@ -1,130 +1,132 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/root.mako"/>
2 <%inherit file="base/root.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Create an Account')}
5 ${_('Create an Account')}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10 <style>body{background-color:#eeeeee;}</style>
10 <style>body{background-color:#eeeeee;}</style>
11
11
12 <div class="loginbox">
12 <div class="loginbox">
13 <div class="header">
13 <div class="header">
14 <div id="header-inner" class="title">
14 <div id="header-inner" class="title">
15 <div id="logo">
15 <div id="logo">
16 <div class="logo-wrapper">
16 <div class="logo-wrapper">
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
17 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
18 </div>
18 </div>
19 %if c.rhodecode_name:
19 %if c.rhodecode_name:
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
20 <div class="branding"> ${h.branding(c.rhodecode_name)}</div>
21 %endif
21 %endif
22 </div>
22 </div>
23 </div>
23 </div>
24 </div>
24 </div>
25
25
26 <div class="loginwrapper">
26 <div class="loginwrapper">
27 <rhodecode-toast id="notifications"></rhodecode-toast>
27 <rhodecode-toast id="notifications"></rhodecode-toast>
28 <div class="left-column">
28 <div class="left-column">
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
29 <img class="sign-in-image" src="${h.asset('images/sign-in.png')}" alt="RhodeCode"/>
30 </div>
30 </div>
31 <%block name="above_register_button" />
31 <%block name="above_register_button" />
32 <div id="register" class="right-column">
32 <div id="register" class="right-column">
33 <!-- login -->
33 <!-- login -->
34 <div class="sign-in-title">
34 <div class="sign-in-title">
35 <h1>${_('Create an account')}</h1>
35 <h1>${_('Create an account')}</h1>
36 <h4>${h.link_to(_("Go to the login page to sign in with an existing account."), request.route_path('login'))}</h4>
36 <h4>${h.link_to(_("Go to the login page to sign in with an existing account."), request.route_path('login'))}</h4>
37 </div>
37 </div>
38 <div class="inner form">
38 <div class="inner form">
39 ${h.form(request.route_path('register'), needs_csrf_token=False)}
39 ${h.form(request.route_path('register'), needs_csrf_token=False)}
40
40
41 <label for="username">${_('Username')}:</label>
41 <label for="username">${_('Username')}:</label>
42 ${h.text('username', defaults.get('username'))}
42 ${h.text('username', defaults.get('username'))}
43 %if 'username' in errors:
43 %if 'username' in errors:
44 <span class="error-message">${errors.get('username')}</span>
44 <span class="error-message">${errors.get('username')}</span>
45 <br />
45 <br />
46 %endif
46 %endif
47
47
48 <label for="password">${_('Password')}:</label>
48 <label for="password">${_('Password')}:</label>
49 ${h.password('password', defaults.get('password'))}
49 ${h.password('password', defaults.get('password'))}
50 %if 'password' in errors:
50 %if 'password' in errors:
51 <span class="error-message">${errors.get('password')}</span>
51 <span class="error-message">${errors.get('password')}</span>
52 <br />
52 <br />
53 %endif
53 %endif
54
54
55 <label for="password_confirmation">${_('Re-enter password')}:</label>
55 <label for="password_confirmation">${_('Re-enter password')}:</label>
56 ${h.password('password_confirmation', defaults.get('password_confirmation'))}
56 ${h.password('password_confirmation', defaults.get('password_confirmation'))}
57 %if 'password_confirmation' in errors:
57 %if 'password_confirmation' in errors:
58 <span class="error-message">${errors.get('password_confirmation')}</span>
58 <span class="error-message">${errors.get('password_confirmation')}</span>
59 <br />
59 <br />
60 %endif
60 %endif
61
61
62 <label for="firstname">${_('First Name')}:</label>
62 <label for="firstname">${_('First Name')}:</label>
63 ${h.text('firstname', defaults.get('firstname'))}
63 ${h.text('firstname', defaults.get('firstname'))}
64 %if 'firstname' in errors:
64 %if 'firstname' in errors:
65 <span class="error-message">${errors.get('firstname')}</span>
65 <span class="error-message">${errors.get('firstname')}</span>
66 <br />
66 <br />
67 %endif
67 %endif
68
68
69 <label for="lastname">${_('Last Name')}:</label>
69 <label for="lastname">${_('Last Name')}:</label>
70 ${h.text('lastname', defaults.get('lastname'))}
70 ${h.text('lastname', defaults.get('lastname'))}
71 %if 'lastname' in errors:
71 %if 'lastname' in errors:
72 <span class="error-message">${errors.get('lastname')}</span>
72 <span class="error-message">${errors.get('lastname')}</span>
73 <br />
73 <br />
74 %endif
74 %endif
75
75
76 <label for="email">${_('Email')}:</label>
76 <label for="email">${_('Email')}:</label>
77 ${h.text('email', defaults.get('email'))}
77 ${h.text('email', defaults.get('email'))}
78 %if 'email' in errors:
78 %if 'email' in errors:
79 <span class="error-message">${errors.get('email')}</span>
79 <span class="error-message">${errors.get('email')}</span>
80 <br />
80 <br />
81 %endif
81 %endif
82
82
83 %if captcha_active:
83 %if captcha_active:
84 <div>
84 <div>
85 <label for="recaptcha">${_('Captcha')}:</label>
85 <label for="recaptcha">${_('Captcha')}:</label>
86 ${h.hidden('recaptcha_field')}
86 ${h.hidden('recaptcha_field')}
87 <div id="recaptcha"></div>
87 <div id="recaptcha"></div>
88 %if 'recaptcha_field' in errors:
88 %if 'recaptcha_field' in errors:
89 <span class="error-message">${errors.get('recaptcha_field')}</span>
89 <span class="error-message">${errors.get('recaptcha_field')}</span>
90 <br />
90 <br />
91 %endif
91 %endif
92 </div>
92 </div>
93 %endif
93 %endif
94
94
95 %if not auto_active:
95 %if not auto_active:
96 <p class="activation_msg">
96 <p class="activation_msg">
97 ${_('Account activation requires admin approval.')}
97 ${_('Account activation requires admin approval.')}
98 </p>
98 </p>
99 %endif
99 %endif
100 <p class="register_message">
100 <p class="register_message">
101 ${register_message|n}
101 ${register_message|n}
102 </p>
102 </p>
103
103
104 ${h.submit('sign_up',_('Create Account'),class_="btn sign-in")}
104 ${h.submit('sign_up',_('Create Account'),class_="btn sign-in")}
105
105 <p class="help-block pull-right">
106 RhodeCode ${c.rhodecode_edition}
107 </p>
106 ${h.end_form()}
108 ${h.end_form()}
107 </div>
109 </div>
108 <%block name="below_register_button" />
110 <%block name="below_register_button" />
109 </div>
111 </div>
110 </div>
112 </div>
111 </div>
113 </div>
112
114
113
115
114 <script type="text/javascript">
116 <script type="text/javascript">
115 $(document).ready(function(){
117 $(document).ready(function(){
116 $('#username').focus();
118 $('#username').focus();
117 });
119 });
118 </script>
120 </script>
119
121
120 % if captcha_active:
122 % if captcha_active:
121 <script type="text/javascript">
123 <script type="text/javascript">
122 var onloadCallback = function() {
124 var onloadCallback = function() {
123 grecaptcha.render('recaptcha', {
125 grecaptcha.render('recaptcha', {
124 'sitekey' : "${captcha_public_key}"
126 'sitekey' : "${captcha_public_key}"
125 });
127 });
126 };
128 };
127 </script>
129 </script>
128 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
130 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
129 % endif
131 % endif
130
132
General Comments 0
You need to be logged in to leave comments. Login now