##// END OF EJS Templates
templates: Migrate login and register templates to pyramid.
johbo -
r31:c2bebd31 default
parent child Browse files
Show More
@@ -34,21 +34,35 b''
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."),h.url('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(h.url.current(**request.GET), needs_csrf_token=False)}
41 ${h.form(request.route_path('login', _query={'came_from': came_from}), needs_csrf_token=False)}
42
42 <label for="username">${_('Username')}:</label>
43 <label for="username">${_('Username')}:</label>
43 ${h.text('username',class_='focus')}
44 ${h.text('username', class_='focus', value=defaults.get('username'))}
45 %if 'username' in errors:
46 <span class="error-message">${errors.get('username')}</span>
47 <br />
48 %endif
49
44 <label for="password">${_('Password')}:</label>
50 <label for="password">${_('Password')}:</label>
45 ${h.password('password',class_='focus')}
51 ${h.password('password', class_='focus')}
46 <input type="checkbox" id="remember" name="remember" />
52 %if 'password' in errors:
53 <span class="error-message">${errors.get('password')}</span>
54 <br />
55 %endif
56
57 ${h.checkbox('remember', value=True, checked=defaults.get('remember'))}
47 <label class="checkbox" for="remember">${_('Remember me')}</label>
58 <label class="checkbox" for="remember">${_('Remember me')}</label>
59
48 <p class="links">
60 <p class="links">
49 ${h.link_to(_('Forgot your password?'),h.url('reset_password'))}
61 ${h.link_to(_('Forgot your password?'), h.route_path('reset_password'))}
50 </p>
62 </p>
51 ${h.submit('sign_in',_('Sign In'),class_="btn sign-in")}
63
64 ${h.submit('sign_in', _('Sign In'), class_="btn sign-in")}
65
52 ${h.end_form()}
66 ${h.end_form()}
53 <script type="text/javascript">
67 <script type="text/javascript">
54 $(document).ready(function(){
68 $(document).ready(function(){
@@ -57,6 +71,7 b''
57 </script>
71 </script>
58 </div>
72 </div>
59 <!-- end login -->
73 <!-- end login -->
74 <%block name="below_login_button" />
60 </div>
75 </div>
61 </div>
76 </div>
62 </div>
77 </div>
@@ -33,56 +33,91 b''
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."),h.url('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(url('register'), needs_csrf_token= False)}
39 ${h.form(request.route_path('register'), needs_csrf_token=False)}
40
40 <label for="username">${_('Username')}:</label>
41 <label for="username">${_('Username')}:</label>
41 ${h.text('username', c.form_data.get('username'))}
42 ${h.text('username', defaults.get('username'))}
43 %if 'username' in errors:
44 <span class="error-message">${errors.get('username')}</span>
45 <br />
46 %endif
47
42 <label for="password">${_('Password')}:</label>
48 <label for="password">${_('Password')}:</label>
43 ${h.password('password', c.form_data.get('password'))}
49 ${h.password('password', defaults.get('password'))}
44 <label for="password">${_('Re-enter password')}:</label>
50 %if 'password' in errors:
45 ${h.password('password_confirmation', c.form_data.get('password'))}
51 <span class="error-message">${errors.get('password')}</span>
52 <br />
53 %endif
54
55 <label for="password_confirmation">${_('Re-enter password')}:</label>
56 ${h.password('password_confirmation', defaults.get('password_confirmation'))}
57 %if 'password_confirmation' in errors:
58 <span class="error-message">${errors.get('password_confirmation')}</span>
59 <br />
60 %endif
61
46 <label for="firstname">${_('First Name')}:</label>
62 <label for="firstname">${_('First Name')}:</label>
47 ${h.text('firstname')}
63 ${h.text('firstname', defaults.get('firstname'))}
64 %if 'firstname' in errors:
65 <span class="error-message">${errors.get('firstname')}</span>
66 <br />
67 %endif
68
48 <label for="lastname">${_('Last Name')}:</label>
69 <label for="lastname">${_('Last Name')}:</label>
49 ${h.text('lastname')}
70 ${h.text('lastname', defaults.get('lastname'))}
71 %if 'lastname' in errors:
72 <span class="error-message">${errors.get('lastname')}</span>
73 <br />
74 %endif
75
50 <label for="email">${_('Email')}:</label>
76 <label for="email">${_('Email')}:</label>
51 ${h.text('email', c.form_data.get('email'))}
77 ${h.text('email', defaults.get('email'))}
78 %if 'email' in errors:
79 <span class="error-message">${errors.get('email')}</span>
80 <br />
81 %endif
52
82
53 %if c.captcha_active:
83 %if captcha_active:
54 <div>
84 <div>
55 <label for="email">${_('Captcha')}:</label>
85 <label for="recaptcha">${_('Captcha')}:</label>
56 ${h.hidden('recaptcha_field')}
86 ${h.hidden('recaptcha_field')}
57 <div id="recaptcha"></div>
87 <div id="recaptcha"></div>
88 %if 'recaptcha_field' in errors:
89 <span class="error-message">${errors.get('recaptcha_field')}</span>
90 <br />
91 %endif
58 </div>
92 </div>
59 %endif
93 %endif
60
94
61 %if not c.auto_active:
95 %if not auto_active:
62 <p class="activation_msg">
96 <p class="activation_msg">
63 ${_('Account activation requires admin approval.')}
97 ${_('Account activation requires admin approval.')}
64 </p>
98 </p>
65 %endif
99 %endif
66 <p class="register_message">
100 <p class="register_message">
67 ${c.register_message|n}
101 ${register_message|n}
68 </p>
102 </p>
69
103
70 ${h.submit('sign_up',_('Create Account'),class_="btn sign-in")}
104 ${h.submit('sign_up',_('Create Account'),class_="btn sign-in")}
71
105
72 ${h.end_form()}
106 ${h.end_form()}
73 </div>
107 </div>
108 <%block name="below_register_button" />
74 </div>
109 </div>
75 </div>
110 </div>
76 </div>
111 </div>
77
112
78 %if c.captcha_active:
113 %if captcha_active:
79 <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
114 <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
80 %endif
115 %endif
81 <script type="text/javascript">
116 <script type="text/javascript">
82 $(document).ready(function(){
117 $(document).ready(function(){
83 $('#username').focus();
118 $('#username').focus();
84 %if c.captcha_active:
119 %if captcha_active:
85 Recaptcha.create("${c.captcha_public_key}", "recaptcha", {theme: "white"});
120 Recaptcha.create("${captcha_public_key}", "recaptcha", {theme: "white"});
86 %endif
121 %endif
87 });
122 });
88 </script>
123 </script>
General Comments 0
You need to be logged in to leave comments. Login now