##// END OF EJS Templates
templates: use explicit named actions like "create user" instead of generic "save" which is bad UX.
dan -
r4118:921973ad default
parent child Browse files
Show More
@@ -1,105 +1,105 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Add repository group')}
5 ${_('Add repository group')}
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 <%def name="breadcrumbs_links()">
11 <%def name="breadcrumbs_links()">
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
13 &raquo;
13 &raquo;
14 ${h.link_to(_('Repository groups'),h.route_path('repo_groups'))}
14 ${h.link_to(_('Repository groups'),h.route_path('repo_groups'))}
15 &raquo;
15 &raquo;
16 ${_('Add Repository Group')}
16 ${_('Add Repository Group')}
17 </%def>
17 </%def>
18
18
19 <%def name="menu_bar_nav()">
19 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='admin')}
20 ${self.menu_items(active='admin')}
21 </%def>
21 </%def>
22
22
23 <%def name="menu_bar_subnav()">
23 <%def name="menu_bar_subnav()">
24 ${self.admin_menu(active='repository_groups')}
24 ${self.admin_menu(active='repository_groups')}
25 </%def>
25 </%def>
26
26
27 <%def name="main()">
27 <%def name="main()">
28 <div class="box">
28 <div class="box">
29 ${h.secure_form(h.route_path('repo_group_create'), request=request)}
29 ${h.secure_form(h.route_path('repo_group_create'), request=request)}
30 <div class="form">
30 <div class="form">
31 <!-- fields -->
31 <!-- fields -->
32 <div class="fields">
32 <div class="fields">
33 <div class="field">
33 <div class="field">
34 <div class="label">
34 <div class="label">
35 <label for="group_name">${_('Group name')}:</label>
35 <label for="group_name">${_('Group name')}:</label>
36 </div>
36 </div>
37 <div class="input">
37 <div class="input">
38 ${h.text('group_name', class_="medium")}
38 ${h.text('group_name', class_="medium")}
39 </div>
39 </div>
40 </div>
40 </div>
41
41
42 <div class="field">
42 <div class="field">
43 <div class="label">
43 <div class="label">
44 <label for="group_parent_id">${_('Repository group')}:</label>
44 <label for="group_parent_id">${_('Repository group')}:</label>
45 </div>
45 </div>
46 <div class="select">
46 <div class="select">
47 ${h.select('group_parent_id',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
47 ${h.select('group_parent_id',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
48 </div>
48 </div>
49 </div>
49 </div>
50
50
51 <div class="field">
51 <div class="field">
52 <div class="label">
52 <div class="label">
53 <label for="group_description">${_('Description')}:</label>
53 <label for="group_description">${_('Description')}:</label>
54 </div>
54 </div>
55 <div class="textarea editor">
55 <div class="textarea editor">
56 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
56 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
57 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
57 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
58 <span class="help-block">${_('Plain text format with support of {metatags}').format(metatags=metatags_url)|n}</span>
58 <span class="help-block">${_('Plain text format with support of {metatags}').format(metatags=metatags_url)|n}</span>
59 <span id="meta-tags-desc" style="display: none">
59 <span id="meta-tags-desc" style="display: none">
60 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
60 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
61 ${dt.metatags_help()}
61 ${dt.metatags_help()}
62 </span>
62 </span>
63 </div>
63 </div>
64 </div>
64 </div>
65
65
66 <div id="copy_perms" class="field">
66 <div id="copy_perms" class="field">
67 <div class="label label-checkbox">
67 <div class="label label-checkbox">
68 <label for="group_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
68 <label for="group_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
69 </div>
69 </div>
70 <div class="checkboxes">
70 <div class="checkboxes">
71 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
71 ${h.checkbox('group_copy_permissions', value="True", checked="checked")}
72 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
72 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
73 </div>
73 </div>
74 </div>
74 </div>
75
75
76 <div class="buttons">
76 <div class="buttons">
77 ${h.submit('save',_('Save'),class_="btn")}
77 ${h.submit('save',_('Create Repository Group'),class_="btn")}
78 </div>
78 </div>
79 </div>
79 </div>
80 </div>
80 </div>
81 ${h.end_form()}
81 ${h.end_form()}
82 </div>
82 </div>
83 <script>
83 <script>
84 $(document).ready(function(){
84 $(document).ready(function(){
85 var setCopyPermsOption = function(group_val){
85 var setCopyPermsOption = function(group_val){
86 if(group_val !== "-1"){
86 if(group_val !== "-1"){
87 $('#copy_perms').show()
87 $('#copy_perms').show()
88 }
88 }
89 else{
89 else{
90 $('#copy_perms').hide();
90 $('#copy_perms').hide();
91 }
91 }
92 };
92 };
93 $("#group_parent_id").select2({
93 $("#group_parent_id").select2({
94 'containerCssClass': "drop-menu",
94 'containerCssClass': "drop-menu",
95 'dropdownCssClass': "drop-menu-dropdown",
95 'dropdownCssClass': "drop-menu-dropdown",
96 'dropdownAutoWidth': true
96 'dropdownAutoWidth': true
97 });
97 });
98 setCopyPermsOption($('#group_parent_id').val());
98 setCopyPermsOption($('#group_parent_id').val());
99 $("#group_parent_id").on("change", function(e) {
99 $("#group_parent_id").on("change", function(e) {
100 setCopyPermsOption(e.val)
100 setCopyPermsOption(e.val)
101 });
101 });
102 $('#group_name').focus();
102 $('#group_name').focus();
103 })
103 })
104 </script>
104 </script>
105 </%def>
105 </%def>
@@ -1,151 +1,151 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 ${h.secure_form(h.route_path('repo_create'), request=request)}
3 ${h.secure_form(h.route_path('repo_create'), request=request)}
4 <div class="form">
4 <div class="form">
5 <!-- fields -->
5 <!-- fields -->
6 <div class="fields">
6 <div class="fields">
7 <div class="field">
7 <div class="field">
8 <div class="label">
8 <div class="label">
9 <label for="repo_name">${_('Repository name')}:</label>
9 <label for="repo_name">${_('Repository name')}:</label>
10 </div>
10 </div>
11 <div class="input">
11 <div class="input">
12 ${h.text('repo_name', class_="medium")}
12 ${h.text('repo_name', class_="medium")}
13 <div class="info-block">
13 <div class="info-block">
14 <a id="remote_clone_toggle" href="#">${_('Import Existing Repository ?')}</a>
14 <a id="remote_clone_toggle" href="#">${_('Import Existing Repository ?')}</a>
15 </div>
15 </div>
16 %if not c.rhodecode_user.is_admin:
16 %if not c.rhodecode_user.is_admin:
17 ${h.hidden('user_created',True)}
17 ${h.hidden('user_created',True)}
18 %endif
18 %endif
19 </div>
19 </div>
20 </div>
20 </div>
21 <div id="remote_clone" class="field" style="display: none;">
21 <div id="remote_clone" class="field" style="display: none;">
22 <div class="label">
22 <div class="label">
23 <label for="clone_uri">${_('Clone from')}:</label>
23 <label for="clone_uri">${_('Clone from')}:</label>
24 </div>
24 </div>
25 <div class="input">
25 <div class="input">
26 ${h.text('clone_uri', class_="medium")}
26 ${h.text('clone_uri', class_="medium")}
27 <span class="help-block">
27 <span class="help-block">
28 <pre>
28 <pre>
29 - The repository must be accessible over http:// or https://
29 - The repository must be accessible over http:// or https://
30 - For Git projects it's recommended appending .git to the end of clone url.
30 - For Git projects it's recommended appending .git to the end of clone url.
31 - Make sure to select proper repository type from the below selector before importing it.
31 - Make sure to select proper repository type from the below selector before importing it.
32 - If your HTTP[S] repository is not publicly accessible,
32 - If your HTTP[S] repository is not publicly accessible,
33 add authentication information to the URL: https://username:password@server.company.com/repo-name.
33 add authentication information to the URL: https://username:password@server.company.com/repo-name.
34 - The Git LFS/Mercurial Largefiles objects will not be imported.
34 - The Git LFS/Mercurial Largefiles objects will not be imported.
35 - For very large repositories, it's recommended to manually copy them into the
35 - For very large repositories, it's recommended to manually copy them into the
36 RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>.
36 RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>.
37 </pre>
37 </pre>
38 </span>
38 </span>
39 </div>
39 </div>
40 </div>
40 </div>
41 <div class="field">
41 <div class="field">
42 <div class="label">
42 <div class="label">
43 <label for="repo_group">${_('Repository group')}:</label>
43 <label for="repo_group">${_('Repository group')}:</label>
44 </div>
44 </div>
45 <div class="select">
45 <div class="select">
46 ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
46 ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
47 % if c.personal_repo_group:
47 % if c.personal_repo_group:
48 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
48 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
49 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
49 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
50 </a>
50 </a>
51 % endif
51 % endif
52 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
52 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
53 </div>
53 </div>
54 </div>
54 </div>
55 <div class="field">
55 <div class="field">
56 <div class="label">
56 <div class="label">
57 <label for="repo_type">${_('Type')}:</label>
57 <label for="repo_type">${_('Type')}:</label>
58 </div>
58 </div>
59 <div class="select">
59 <div class="select">
60 ${h.select('repo_type','hg',c.backends)}
60 ${h.select('repo_type','hg',c.backends)}
61 <span class="help-block">${_('Set the type of repository to create.')}</span>
61 <span class="help-block">${_('Set the type of repository to create.')}</span>
62 </div>
62 </div>
63 </div>
63 </div>
64 <div class="field">
64 <div class="field">
65 <div class="label">
65 <div class="label">
66 <label for="repo_description">${_('Description')}:</label>
66 <label for="repo_description">${_('Description')}:</label>
67 </div>
67 </div>
68 <div class="textarea editor">
68 <div class="textarea editor">
69 ${h.textarea('repo_description',cols=23,rows=5,class_="medium")}
69 ${h.textarea('repo_description',cols=23,rows=5,class_="medium")}
70 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
70 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
71 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
71 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
72 <span id="meta-tags-desc" style="display: none">
72 <span id="meta-tags-desc" style="display: none">
73 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
73 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
74 ${dt.metatags_help()}
74 ${dt.metatags_help()}
75 </span>
75 </span>
76 </div>
76 </div>
77 </div>
77 </div>
78 <div id="copy_perms" class="field">
78 <div id="copy_perms" class="field">
79 <div class="label label-checkbox">
79 <div class="label label-checkbox">
80 <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
80 <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
81 </div>
81 </div>
82 <div class="checkboxes">
82 <div class="checkboxes">
83 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
83 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
84 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
84 <span class="help-block">${_('Copy permissions from parent repository group.')}</span>
85 </div>
85 </div>
86 </div>
86 </div>
87 <div class="field">
87 <div class="field">
88 <div class="label label-checkbox">
88 <div class="label label-checkbox">
89 <label for="repo_private">${_('Private Repository')}:</label>
89 <label for="repo_private">${_('Private Repository')}:</label>
90 </div>
90 </div>
91 <div class="checkboxes">
91 <div class="checkboxes">
92 ${h.checkbox('repo_private',value="True")}
92 ${h.checkbox('repo_private',value="True")}
93 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
93 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
94 </div>
94 </div>
95 </div>
95 </div>
96 <div class="buttons">
96 <div class="buttons">
97 ${h.submit('save',_('Save'),class_="btn")}
97 ${h.submit('save',_('Create Repository'),class_="btn")}
98 </div>
98 </div>
99 </div>
99 </div>
100 </div>
100 </div>
101 <script>
101 <script>
102 $(document).ready(function(){
102 $(document).ready(function(){
103 var setCopyPermsOption = function(group_val){
103 var setCopyPermsOption = function(group_val){
104 if(group_val != "-1"){
104 if(group_val != "-1"){
105 $('#copy_perms').show()
105 $('#copy_perms').show()
106 }
106 }
107 else{
107 else{
108 $('#copy_perms').hide();
108 $('#copy_perms').hide();
109 }
109 }
110 };
110 };
111
111
112 $('#remote_clone_toggle').on('click', function(e){
112 $('#remote_clone_toggle').on('click', function(e){
113 $('#remote_clone').show();
113 $('#remote_clone').show();
114 e.preventDefault();
114 e.preventDefault();
115 });
115 });
116
116
117 if($('#remote_clone input').hasClass('error')){
117 if($('#remote_clone input').hasClass('error')){
118 $('#remote_clone').show();
118 $('#remote_clone').show();
119 }
119 }
120 if($('#remote_clone input').val()){
120 if($('#remote_clone input').val()){
121 $('#remote_clone').show();
121 $('#remote_clone').show();
122 }
122 }
123
123
124 $("#repo_group").select2({
124 $("#repo_group").select2({
125 'containerCssClass': "drop-menu",
125 'containerCssClass': "drop-menu",
126 'dropdownCssClass': "drop-menu-dropdown",
126 'dropdownCssClass': "drop-menu-dropdown",
127 'dropdownAutoWidth': true,
127 'dropdownAutoWidth': true,
128 'width': "resolve"
128 'width': "resolve"
129 });
129 });
130
130
131 setCopyPermsOption($('#repo_group').val());
131 setCopyPermsOption($('#repo_group').val());
132 $("#repo_group").on("change", function(e) {
132 $("#repo_group").on("change", function(e) {
133 setCopyPermsOption(e.val)
133 setCopyPermsOption(e.val)
134 });
134 });
135
135
136 $("#repo_type").select2({
136 $("#repo_type").select2({
137 'containerCssClass': "drop-menu",
137 'containerCssClass': "drop-menu",
138 'dropdownCssClass': "drop-menu-dropdown",
138 'dropdownCssClass': "drop-menu-dropdown",
139 'minimumResultsForSearch': -1,
139 'minimumResultsForSearch': -1,
140 });
140 });
141
141
142 $('#repo_name').focus();
142 $('#repo_name').focus();
143
143
144 $('#select_my_group').on('click', function(e){
144 $('#select_my_group').on('click', function(e){
145 e.preventDefault();
145 e.preventDefault();
146 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
146 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
147 })
147 })
148
148
149 })
149 })
150 </script>
150 </script>
151 ${h.end_form()}
151 ${h.end_form()}
@@ -1,71 +1,71 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Add user group')}
5 ${_('Add user group')}
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 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 &raquo;
12 &raquo;
13 ${h.link_to(_('User groups'),h.route_path('user_groups'))}
13 ${h.link_to(_('User groups'),h.route_path('user_groups'))}
14 &raquo;
14 &raquo;
15 ${_('Add User Group')}
15 ${_('Add User Group')}
16 </%def>
16 </%def>
17
17
18 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='admin')}
19 ${self.menu_items(active='admin')}
20 </%def>
20 </%def>
21
21
22 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
23 ${self.admin_menu(active='user_groups')}
23 ${self.admin_menu(active='user_groups')}
24 </%def>
24 </%def>
25
25
26 <%def name="main()">
26 <%def name="main()">
27 <div class="box main-content">
27 <div class="box main-content">
28 ${h.secure_form(h.route_path('user_groups_create'), request=request)}
28 ${h.secure_form(h.route_path('user_groups_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="users_group_name">${_('Group name')}:</label>
34 <label for="users_group_name">${_('Group name')}:</label>
35 </div>
35 </div>
36 <div class="input">
36 <div class="input">
37 ${h.text('users_group_name', class_='medium')}
37 ${h.text('users_group_name', class_='medium')}
38 </div>
38 </div>
39 </div>
39 </div>
40 <div class="field">
40 <div class="field">
41 <div class="label">
41 <div class="label">
42 <label for="user_group_description">${_('Description')}:</label>
42 <label for="user_group_description">${_('Description')}:</label>
43 </div>
43 </div>
44 <div class="textarea editor">
44 <div class="textarea editor">
45 ${h.textarea('user_group_description')}
45 ${h.textarea('user_group_description')}
46 <span class="help-block">${_('Short, optional description for this user group.')}</span>
46 <span class="help-block">${_('Short, optional description for this user group.')}</span>
47 </div>
47 </div>
48 </div>
48 </div>
49 <div class="field">
49 <div class="field">
50 <div class="label">
50 <div class="label">
51 <label for="users_group_active">${_('Active')}:</label>
51 <label for="users_group_active">${_('Active')}:</label>
52 </div>
52 </div>
53 <div class="checkboxes">
53 <div class="checkboxes">
54 ${h.checkbox('users_group_active',value=True, checked='checked')}
54 ${h.checkbox('users_group_active',value=True, checked='checked')}
55 </div>
55 </div>
56 </div>
56 </div>
57
57
58 <div class="buttons">
58 <div class="buttons">
59 ${h.submit('save',_('Save'),class_="btn")}
59 ${h.submit('save',_('Create User Group'),class_="btn")}
60 </div>
60 </div>
61 </div>
61 </div>
62 </div>
62 </div>
63 ${h.end_form()}
63 ${h.end_form()}
64 </div>
64 </div>
65 </%def>
65 </%def>
66
66
67 <script>
67 <script>
68 $(document).ready(function(){
68 $(document).ready(function(){
69 $('#users_group_name').focus();
69 $('#users_group_name').focus();
70 })
70 })
71 </script>
71 </script>
@@ -1,147 +1,147 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Add user')}
5 ${_('Add user')}
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 <%def name="breadcrumbs_links()">
10 <%def name="breadcrumbs_links()">
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
11 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
12 &raquo;
12 &raquo;
13 ${h.link_to(_('Users'),h.route_path('users'))}
13 ${h.link_to(_('Users'),h.route_path('users'))}
14 &raquo;
14 &raquo;
15 ${_('Add User')}
15 ${_('Add User')}
16 </%def>
16 </%def>
17
17
18 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='admin')}
19 ${self.menu_items(active='admin')}
20 </%def>
20 </%def>
21
21
22 <%def name="main()">
22 <%def name="main()">
23 <div class="box">
23 <div class="box">
24 <!-- box / title -->
24 <!-- box / title -->
25 <div class="title">
25 <div class="title">
26 ${self.breadcrumbs()}
26 ${self.breadcrumbs()}
27 </div>
27 </div>
28 <!-- end box / title -->
28 <!-- end box / title -->
29 ${h.secure_form(h.route_path('users_create'), request=request)}
29 ${h.secure_form(h.route_path('users_create'), request=request)}
30 <div class="form">
30 <div class="form">
31 <!-- fields -->
31 <!-- fields -->
32 <div class="fields">
32 <div class="fields">
33 <div class="field">
33 <div class="field">
34 <div class="label">
34 <div class="label">
35 <label for="username">${_('Username')}:</label>
35 <label for="username">${_('Username')}:</label>
36 </div>
36 </div>
37 <div class="input">
37 <div class="input">
38 ${h.text('username', class_='medium')}
38 ${h.text('username', class_='medium')}
39 </div>
39 </div>
40 </div>
40 </div>
41
41
42 <div class="field">
42 <div class="field">
43 <div class="label">
43 <div class="label">
44 <label for="password">${_('Password')}:</label>
44 <label for="password">${_('Password')}:</label>
45 </div>
45 </div>
46 <div class="input">
46 <div class="input">
47 ${h.password('password', class_='medium')}
47 ${h.password('password', class_='medium')}
48 </div>
48 </div>
49 </div>
49 </div>
50
50
51 <div class="field">
51 <div class="field">
52 <div class="label">
52 <div class="label">
53 <label for="password_confirmation">${_('Password confirmation')}:</label>
53 <label for="password_confirmation">${_('Password confirmation')}:</label>
54 </div>
54 </div>
55 <div class="input">
55 <div class="input">
56 ${h.password('password_confirmation',autocomplete="off", class_='medium')}
56 ${h.password('password_confirmation',autocomplete="off", class_='medium')}
57 <div class="info-block">
57 <div class="info-block">
58 <a id="generate_password" href="#">
58 <a id="generate_password" href="#">
59 <i class="icon-lock"></i> ${_('Generate password')}
59 <i class="icon-lock"></i> ${_('Generate password')}
60 </a>
60 </a>
61 <span id="generate_password_preview"></span>
61 <span id="generate_password_preview"></span>
62 </div>
62 </div>
63 </div>
63 </div>
64 </div>
64 </div>
65
65
66 <div class="field">
66 <div class="field">
67 <div class="label">
67 <div class="label">
68 <label for="firstname">${_('First Name')}:</label>
68 <label for="firstname">${_('First Name')}:</label>
69 </div>
69 </div>
70 <div class="input">
70 <div class="input">
71 ${h.text('firstname', class_='medium')}
71 ${h.text('firstname', class_='medium')}
72 </div>
72 </div>
73 </div>
73 </div>
74
74
75 <div class="field">
75 <div class="field">
76 <div class="label">
76 <div class="label">
77 <label for="lastname">${_('Last Name')}:</label>
77 <label for="lastname">${_('Last Name')}:</label>
78 </div>
78 </div>
79 <div class="input">
79 <div class="input">
80 ${h.text('lastname', class_='medium')}
80 ${h.text('lastname', class_='medium')}
81 </div>
81 </div>
82 </div>
82 </div>
83
83
84 <div class="field">
84 <div class="field">
85 <div class="label">
85 <div class="label">
86 <label for="email">${_('Email')}:</label>
86 <label for="email">${_('Email')}:</label>
87 </div>
87 </div>
88 <div class="input">
88 <div class="input">
89 ${h.text('email', class_='medium')}
89 ${h.text('email', class_='medium')}
90 ${h.hidden('extern_name', c.default_extern_type)}
90 ${h.hidden('extern_name', c.default_extern_type)}
91 ${h.hidden('extern_type', c.default_extern_type)}
91 ${h.hidden('extern_type', c.default_extern_type)}
92 </div>
92 </div>
93 </div>
93 </div>
94
94
95 <div class="field">
95 <div class="field">
96 <div class="label label-checkbox">
96 <div class="label label-checkbox">
97 <label for="active">${_('Active')}:</label>
97 <label for="active">${_('Active')}:</label>
98 </div>
98 </div>
99 <div class="checkboxes">
99 <div class="checkboxes">
100 ${h.checkbox('active',value=True,checked='checked')}
100 ${h.checkbox('active',value=True,checked='checked')}
101 </div>
101 </div>
102 </div>
102 </div>
103
103
104 <div class="field">
104 <div class="field">
105 <div class="label label-checkbox">
105 <div class="label label-checkbox">
106 <label for="password_change">${_('Password change')}:</label>
106 <label for="password_change">${_('Password change')}:</label>
107 </div>
107 </div>
108 <div class="checkboxes">
108 <div class="checkboxes">
109 ${h.checkbox('password_change',value=True)}
109 ${h.checkbox('password_change',value=True)}
110 <span class="help-block">${_('Force user to change his password on the next login')}</span>
110 <span class="help-block">${_('Force user to change his password on the next login')}</span>
111 </div>
111 </div>
112 </div>
112 </div>
113
113
114 <div class="field">
114 <div class="field">
115 <div class="label label-checkbox">
115 <div class="label label-checkbox">
116 <label for="create_repo_group">${_('Add personal repository group')}:</label>
116 <label for="create_repo_group">${_('Add personal repository group')}:</label>
117 </div>
117 </div>
118 <div class="checkboxes">
118 <div class="checkboxes">
119 ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
119 ${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
120 <span class="help-block">
120 <span class="help-block">
121 ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/>
121 ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/>
122 ${_('User will be automatically set as this group owner.')}
122 ${_('User will be automatically set as this group owner.')}
123 </span>
123 </span>
124 </div>
124 </div>
125 </div>
125 </div>
126
126
127 <div class="buttons">
127 <div class="buttons">
128 ${h.submit('save',_('Save'),class_="btn")}
128 ${h.submit('save',_('Create User'),class_="btn")}
129 </div>
129 </div>
130 </div>
130 </div>
131 </div>
131 </div>
132 ${h.end_form()}
132 ${h.end_form()}
133 </div>
133 </div>
134 <script>
134 <script>
135 $(document).ready(function(){
135 $(document).ready(function(){
136 $('#username').focus();
136 $('#username').focus();
137
137
138 $('#generate_password').on('click', function(e){
138 $('#generate_password').on('click', function(e){
139 var tmpl = "(${_('generated password:')} {0})";
139 var tmpl = "(${_('generated password:')} {0})";
140 var new_passwd = generatePassword(12);
140 var new_passwd = generatePassword(12);
141 $('#generate_password_preview').html(tmpl.format(new_passwd));
141 $('#generate_password_preview').html(tmpl.format(new_passwd));
142 $('#password').val(new_passwd);
142 $('#password').val(new_passwd);
143 $('#password_confirmation').val(new_passwd);
143 $('#password_confirmation').val(new_passwd);
144 })
144 })
145 })
145 })
146 </script>
146 </script>
147 </%def>
147 </%def>
General Comments 0
You need to be logged in to leave comments. Login now