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