Show More
@@ -1,146 +1,148 b'' | |||||
1 | <%inherit file="/base/base.mako"/> |
|
1 | <%inherit file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('Add user')} |
|
4 | ${_('Add user')} | |
5 | %if c.rhodecode_name: |
|
5 | %if c.rhodecode_name: | |
6 | · ${h.branding(c.rhodecode_name)} |
|
6 | · ${h.branding(c.rhodecode_name)} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%def> | |
9 | <%def name="breadcrumbs_links()"> |
|
9 | <%def name="breadcrumbs_links()"> | |
10 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} |
|
10 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
11 | » |
|
11 | » | |
12 | ${h.link_to(_('Users'),h.route_path('users'))} |
|
12 | ${h.link_to(_('Users'),h.route_path('users'))} | |
13 | » |
|
13 | » | |
14 | ${_('Add User')} |
|
14 | ${_('Add User')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="menu_bar_nav()"> |
|
17 | <%def name="menu_bar_nav()"> | |
18 | ${self.menu_items(active='admin')} |
|
18 | ${self.menu_items(active='admin')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <!-- end box / title --> |
|
27 | <!-- end box / title --> | |
28 | ${h.secure_form(h.route_path('users_create'), request=request)} |
|
28 | ${h.secure_form(h.route_path('users_create'), request=request)} | |
29 | <div class="form"> |
|
29 | <div class="form"> | |
30 | <!-- fields --> |
|
30 | <!-- fields --> | |
31 | <div class="fields"> |
|
31 | <div class="fields"> | |
32 | <div class="field"> |
|
32 | <div class="field"> | |
33 | <div class="label"> |
|
33 | <div class="label"> | |
34 | <label for="username">${_('Username')}:</label> |
|
34 | <label for="username">${_('Username')}:</label> | |
35 | </div> |
|
35 | </div> | |
36 | <div class="input"> |
|
36 | <div class="input"> | |
37 | ${h.text('username', class_='medium')} |
|
37 | ${h.text('username', class_='medium')} | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 |
|
40 | |||
41 | <div class="field"> |
|
41 | <div class="field"> | |
42 | <div class="label"> |
|
42 | <div class="label"> | |
43 | <label for="password">${_('Password')}:</label> |
|
43 | <label for="password">${_('Password')}:</label> | |
44 | </div> |
|
44 | </div> | |
45 | <div class="input"> |
|
45 | <div class="input"> | |
46 | ${h.password('password', class_='medium')} |
|
46 | ${h.password('password', class_='medium')} | |
|
47 | ## install this hidden field so password mismatch will correctly attach error message here | |||
|
48 | ${h.hidden('new_password')} | |||
47 | </div> |
|
49 | </div> | |
48 | </div> |
|
50 | </div> | |
49 |
|
51 | |||
50 | <div class="field"> |
|
52 | <div class="field"> | |
51 | <div class="label"> |
|
53 | <div class="label"> | |
52 | <label for="password_confirmation">${_('Password confirmation')}:</label> |
|
54 | <label for="password_confirmation">${_('Password confirmation')}:</label> | |
53 | </div> |
|
55 | </div> | |
54 | <div class="input"> |
|
56 | <div class="input"> | |
55 | ${h.password('password_confirmation',autocomplete="off", class_='medium')} |
|
57 | ${h.password('password_confirmation',autocomplete="off", class_='medium')} | |
56 | <div class="info-block"> |
|
58 | <div class="info-block"> | |
57 | <a id="generate_password" href="#"> |
|
59 | <a id="generate_password" href="#"> | |
58 | <i class="icon-lock"></i> ${_('Generate password')} |
|
60 | <i class="icon-lock"></i> ${_('Generate password')} | |
59 | </a> |
|
61 | </a> | |
60 | <span id="generate_password_preview"></span> |
|
62 | <span id="generate_password_preview"></span> | |
61 | </div> |
|
63 | </div> | |
62 | </div> |
|
64 | </div> | |
63 | </div> |
|
65 | </div> | |
64 |
|
66 | |||
65 | <div class="field"> |
|
67 | <div class="field"> | |
66 | <div class="label"> |
|
68 | <div class="label"> | |
67 | <label for="firstname">${_('First Name')}:</label> |
|
69 | <label for="firstname">${_('First Name')}:</label> | |
68 | </div> |
|
70 | </div> | |
69 | <div class="input"> |
|
71 | <div class="input"> | |
70 | ${h.text('firstname', class_='medium')} |
|
72 | ${h.text('firstname', class_='medium')} | |
71 | </div> |
|
73 | </div> | |
72 | </div> |
|
74 | </div> | |
73 |
|
75 | |||
74 | <div class="field"> |
|
76 | <div class="field"> | |
75 | <div class="label"> |
|
77 | <div class="label"> | |
76 | <label for="lastname">${_('Last Name')}:</label> |
|
78 | <label for="lastname">${_('Last Name')}:</label> | |
77 | </div> |
|
79 | </div> | |
78 | <div class="input"> |
|
80 | <div class="input"> | |
79 | ${h.text('lastname', class_='medium')} |
|
81 | ${h.text('lastname', class_='medium')} | |
80 | </div> |
|
82 | </div> | |
81 | </div> |
|
83 | </div> | |
82 |
|
84 | |||
83 | <div class="field"> |
|
85 | <div class="field"> | |
84 | <div class="label"> |
|
86 | <div class="label"> | |
85 | <label for="email">${_('Email')}:</label> |
|
87 | <label for="email">${_('Email')}:</label> | |
86 | </div> |
|
88 | </div> | |
87 | <div class="input"> |
|
89 | <div class="input"> | |
88 | ${h.text('email', class_='medium')} |
|
90 | ${h.text('email', class_='medium')} | |
89 | ${h.hidden('extern_name', c.default_extern_type)} |
|
91 | ${h.hidden('extern_name', c.default_extern_type)} | |
90 | ${h.hidden('extern_type', c.default_extern_type)} |
|
92 | ${h.hidden('extern_type', c.default_extern_type)} | |
91 | </div> |
|
93 | </div> | |
92 | </div> |
|
94 | </div> | |
93 |
|
95 | |||
94 | <div class="field"> |
|
96 | <div class="field"> | |
95 | <div class="label label-checkbox"> |
|
97 | <div class="label label-checkbox"> | |
96 | <label for="active">${_('Active')}:</label> |
|
98 | <label for="active">${_('Active')}:</label> | |
97 | </div> |
|
99 | </div> | |
98 | <div class="checkboxes"> |
|
100 | <div class="checkboxes"> | |
99 | ${h.checkbox('active',value=True,checked='checked')} |
|
101 | ${h.checkbox('active',value=True,checked='checked')} | |
100 | </div> |
|
102 | </div> | |
101 | </div> |
|
103 | </div> | |
102 |
|
104 | |||
103 | <div class="field"> |
|
105 | <div class="field"> | |
104 | <div class="label label-checkbox"> |
|
106 | <div class="label label-checkbox"> | |
105 | <label for="password_change">${_('Password change')}:</label> |
|
107 | <label for="password_change">${_('Password change')}:</label> | |
106 | </div> |
|
108 | </div> | |
107 | <div class="checkboxes"> |
|
109 | <div class="checkboxes"> | |
108 | ${h.checkbox('password_change',value=True)} |
|
110 | ${h.checkbox('password_change',value=True)} | |
109 | <span class="help-block">${_('Force user to change his password on the next login')}</span> |
|
111 | <span class="help-block">${_('Force user to change his password on the next login')}</span> | |
110 | </div> |
|
112 | </div> | |
111 | </div> |
|
113 | </div> | |
112 |
|
114 | |||
113 | <div class="field"> |
|
115 | <div class="field"> | |
114 | <div class="label label-checkbox"> |
|
116 | <div class="label label-checkbox"> | |
115 | <label for="create_repo_group">${_('Add personal repository group')}:</label> |
|
117 | <label for="create_repo_group">${_('Add personal repository group')}:</label> | |
116 | </div> |
|
118 | </div> | |
117 | <div class="checkboxes"> |
|
119 | <div class="checkboxes"> | |
118 | ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)} |
|
120 | ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)} | |
119 | <span class="help-block"> |
|
121 | <span class="help-block"> | |
120 | ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/> |
|
122 | ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/> | |
121 | ${_('User will be automatically set as this group owner.')} |
|
123 | ${_('User will be automatically set as this group owner.')} | |
122 | </span> |
|
124 | </span> | |
123 | </div> |
|
125 | </div> | |
124 | </div> |
|
126 | </div> | |
125 |
|
127 | |||
126 | <div class="buttons"> |
|
128 | <div class="buttons"> | |
127 | ${h.submit('save',_('Create User'),class_="btn")} |
|
129 | ${h.submit('save',_('Create User'),class_="btn")} | |
128 | </div> |
|
130 | </div> | |
129 | </div> |
|
131 | </div> | |
130 | </div> |
|
132 | </div> | |
131 | ${h.end_form()} |
|
133 | ${h.end_form()} | |
132 | </div> |
|
134 | </div> | |
133 | <script> |
|
135 | <script> | |
134 | $(document).ready(function(){ |
|
136 | $(document).ready(function(){ | |
135 | $('#username').focus(); |
|
137 | $('#username').focus(); | |
136 |
|
138 | |||
137 | $('#generate_password').on('click', function(e){ |
|
139 | $('#generate_password').on('click', function(e){ | |
138 | var tmpl = "(${_('generated password:')} {0})"; |
|
140 | var tmpl = "(${_('generated password:')} {0})"; | |
139 | var new_passwd = generatePassword(12); |
|
141 | var new_passwd = generatePassword(12); | |
140 | $('#generate_password_preview').html(tmpl.format(new_passwd)); |
|
142 | $('#generate_password_preview').html(tmpl.format(new_passwd)); | |
141 | $('#password').val(new_passwd); |
|
143 | $('#password').val(new_passwd); | |
142 | $('#password_confirmation').val(new_passwd); |
|
144 | $('#password_confirmation').val(new_passwd); | |
143 | }) |
|
145 | }) | |
144 | }) |
|
146 | }) | |
145 | </script> |
|
147 | </script> | |
146 | </%def> |
|
148 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now