Show More
@@ -1,150 +1,150 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | <div class="panel panel-default"> |
|
4 | <div class="panel panel-default"> | |
5 | <div class="panel-heading"> |
|
5 | <div class="panel-heading"> | |
6 | <h3 class="panel-title"> |
|
6 | <h3 class="panel-title"> | |
7 | ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')} |
|
7 | ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')} | |
8 | - ${_('User groups administration')} |
|
8 | - ${_('User groups administration')} | |
9 | </h3> |
|
9 | </h3> | |
10 | </div> |
|
10 | </div> | |
11 | <div class="panel-body"> |
|
11 | <div class="panel-body"> | |
12 | <div class="fields"> |
|
12 | <div class="fields"> | |
13 | <div class="field"> |
|
13 | <div class="field"> | |
14 | <div class="label label-checkbox"> |
|
14 | <div class="label label-checkbox"> | |
15 |
<label for="users_group_active">${_('Add |
|
15 | <label for="users_group_active">${_('Add user to user group')}:</label> | |
16 | </div> |
|
16 | </div> | |
17 | <div class="input"> |
|
17 | <div class="input"> | |
18 | ${h.text('add_user_to_group', placeholder="user group name", class_="medium")} |
|
18 | ${h.text('add_user_to_group', placeholder="user group name", class_="medium")} | |
19 | </div> |
|
19 | </div> | |
20 |
|
20 | |||
21 | </div> |
|
21 | </div> | |
22 | </div> |
|
22 | </div> | |
23 |
|
23 | |||
24 | <div class="groups_management"> |
|
24 | <div class="groups_management"> | |
25 | ${h.secure_form(h.route_path('edit_user_groups_management_updates', user_id=c.user.user_id), request=request)} |
|
25 | ${h.secure_form(h.route_path('edit_user_groups_management_updates', user_id=c.user.user_id), request=request)} | |
26 | <div id="repos_list_wrap"> |
|
26 | <div id="repos_list_wrap"> | |
27 | <table id="user_group_list_table" class="display"></table> |
|
27 | <table id="user_group_list_table" class="display"></table> | |
28 | </div> |
|
28 | </div> | |
29 | <div class="buttons"> |
|
29 | <div class="buttons"> | |
30 | ${h.submit('save',_('Save'),class_="btn")} |
|
30 | ${h.submit('save',_('Save'),class_="btn")} | |
31 | </div> |
|
31 | </div> | |
32 | ${h.end_form()} |
|
32 | ${h.end_form()} | |
33 | </div> |
|
33 | </div> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 | <script> |
|
36 | <script> | |
37 | var api; |
|
37 | var api; | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | $('#user_group_count').text(api.page.info().recordsDisplay); |
|
41 | $('#user_group_count').text(api.page.info().recordsDisplay); | |
42 | }; |
|
42 | }; | |
43 |
|
43 | |||
44 | $('#user_group_list_table').on('click', 'a.editor_remove', function (e) { |
|
44 | $('#user_group_list_table').on('click', 'a.editor_remove', function (e) { | |
45 | e.preventDefault(); |
|
45 | e.preventDefault(); | |
46 | var row = api.row($(this).closest('tr')); |
|
46 | var row = api.row($(this).closest('tr')); | |
47 | row.remove().draw(); |
|
47 | row.remove().draw(); | |
48 | } ); |
|
48 | } ); | |
49 |
|
49 | |||
50 | $('#user_group_list_table').DataTable({ |
|
50 | $('#user_group_list_table').DataTable({ | |
51 | data: ${c.groups|n}, |
|
51 | data: ${c.groups|n}, | |
52 | dom: 'rtp', |
|
52 | dom: 'rtp', | |
53 | pageLength: ${c.visual.admin_grid_items}, |
|
53 | pageLength: ${c.visual.admin_grid_items}, | |
54 | order: [[ 0, "asc" ]], |
|
54 | order: [[ 0, "asc" ]], | |
55 | columns: [ |
|
55 | columns: [ | |
56 | { data: {"_": "group_name", |
|
56 | { data: {"_": "group_name", | |
57 | "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," , |
|
57 | "sort": "group_name"}, title: "${_('Name')}", className: "td-componentname," , | |
58 | render: function (data,type,full,meta) |
|
58 | render: function (data,type,full,meta) | |
59 | {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}}, |
|
59 | {return '<div><i class="icon-user-group" title="User group">'+data+'</i></div>'}}, | |
60 |
|
60 | |||
61 | { data: {"_": "group_description", |
|
61 | { data: {"_": "group_description", | |
62 | "sort": "group_description"}, title: "${_('Description')}", className: "td-description" }, |
|
62 | "sort": "group_description"}, title: "${_('Description')}", className: "td-description" }, | |
63 | { data: {"_": "users_group_id"}, className: "td-user", |
|
63 | { data: {"_": "users_group_id"}, className: "td-user", | |
64 | render: function (data,type,full,meta) |
|
64 | render: function (data,type,full,meta) | |
65 | {return '<input type="hidden" name="users_group_id" value="'+data+'">'}}, |
|
65 | {return '<input type="hidden" name="users_group_id" value="'+data+'">'}}, | |
66 | { data: {"_": "active", |
|
66 | { data: {"_": "active", | |
67 | "sort": "active"}, title: "${_('Active')}", className: "td-active"}, |
|
67 | "sort": "active"}, title: "${_('Active')}", className: "td-active"}, | |
68 | { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user", |
|
68 | { data: {"_": "owner_data"}, title: "${_('Owner')}", className: "td-user", | |
69 | render: function (data,type,full,meta) |
|
69 | render: function (data,type,full,meta) | |
70 | {return '<div class="rc-user tooltip">'+ |
|
70 | {return '<div class="rc-user tooltip">'+ | |
71 | '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+ |
|
71 | '<img class="gravatar" src="'+ data.owner_icon +'" height="16" width="16">'+ | |
72 | data.owner +'</div>' |
|
72 | data.owner +'</div>' | |
73 | } |
|
73 | } | |
74 | }, |
|
74 | }, | |
75 | { data: null, |
|
75 | { data: null, | |
76 | title: "${_('Action')}", |
|
76 | title: "${_('Action')}", | |
77 | className: "td-action", |
|
77 | className: "td-action", | |
78 | defaultContent: '-' |
|
78 | defaultContent: '-' | |
79 | } |
|
79 | } | |
80 | ], |
|
80 | ], | |
81 | language: { |
|
81 | language: { | |
82 | paginate: DEFAULT_GRID_PAGINATION, |
|
82 | paginate: DEFAULT_GRID_PAGINATION, | |
83 | emptyTable: _gettext("No user groups available yet.") |
|
83 | emptyTable: _gettext("No user groups available yet.") | |
84 | }, |
|
84 | }, | |
85 | "initComplete": function( settings, json ) { |
|
85 | "initComplete": function( settings, json ) { | |
86 | var data_grid = $('#user_group_list_table').dataTable(); |
|
86 | var data_grid = $('#user_group_list_table').dataTable(); | |
87 | api = data_grid.api(); |
|
87 | api = data_grid.api(); | |
88 | get_datatable_count(); |
|
88 | get_datatable_count(); | |
89 | } |
|
89 | } | |
90 | }); |
|
90 | }); | |
91 |
|
91 | |||
92 | // update the counter when doing search |
|
92 | // update the counter when doing search | |
93 | $('#user_group_list_table').on( 'search.dt', function (e,settings) { |
|
93 | $('#user_group_list_table').on( 'search.dt', function (e,settings) { | |
94 | get_datatable_count(); |
|
94 | get_datatable_count(); | |
95 | }); |
|
95 | }); | |
96 |
|
96 | |||
97 | // filter, filter both grids |
|
97 | // filter, filter both grids | |
98 | $('#q_filter').on( 'keyup', function () { |
|
98 | $('#q_filter').on( 'keyup', function () { | |
99 | var user_api = $('#user_group_list_table').dataTable().api(); |
|
99 | var user_api = $('#user_group_list_table').dataTable().api(); | |
100 | user_api |
|
100 | user_api | |
101 | .columns(0) |
|
101 | .columns(0) | |
102 | .search(this.value) |
|
102 | .search(this.value) | |
103 | .draw(); |
|
103 | .draw(); | |
104 | }); |
|
104 | }); | |
105 |
|
105 | |||
106 | // refilter table if page load via back button |
|
106 | // refilter table if page load via back button | |
107 | $("#q_filter").trigger('keyup'); |
|
107 | $("#q_filter").trigger('keyup'); | |
108 |
|
108 | |||
109 | }); |
|
109 | }); | |
110 |
|
110 | |||
111 | $('#language').select2({ |
|
111 | $('#language').select2({ | |
112 | 'containerCssClass': "drop-menu", |
|
112 | 'containerCssClass': "drop-menu", | |
113 | 'dropdownCssClass': "drop-menu-dropdown", |
|
113 | 'dropdownCssClass': "drop-menu-dropdown", | |
114 | 'dropdownAutoWidth': true |
|
114 | 'dropdownAutoWidth': true | |
115 | }); |
|
115 | }); | |
116 |
|
116 | |||
117 |
|
117 | |||
118 |
|
118 | |||
119 | $(document).ready(function(){ |
|
119 | $(document).ready(function(){ | |
120 | $("#group_parent_id").select2({ |
|
120 | $("#group_parent_id").select2({ | |
121 | 'containerCssClass': "drop-menu", |
|
121 | 'containerCssClass': "drop-menu", | |
122 | 'dropdownCssClass': "drop-menu-dropdown", |
|
122 | 'dropdownCssClass': "drop-menu-dropdown", | |
123 | 'dropdownAutoWidth': true |
|
123 | 'dropdownAutoWidth': true | |
124 | }); |
|
124 | }); | |
125 |
|
125 | |||
126 | $('#add_user_to_group').autocomplete({ |
|
126 | $('#add_user_to_group').autocomplete({ | |
127 | serviceUrl: pyroutes.url('user_group_autocomplete_data'), |
|
127 | serviceUrl: pyroutes.url('user_group_autocomplete_data'), | |
128 | minChars:2, |
|
128 | minChars:2, | |
129 | maxHeight:400, |
|
129 | maxHeight:400, | |
130 | width:300, |
|
130 | width:300, | |
131 | deferRequestBy: 300, //miliseconds |
|
131 | deferRequestBy: 300, //miliseconds | |
132 | showNoSuggestionNotice: true, |
|
132 | showNoSuggestionNotice: true, | |
133 | params: { user_groups:true }, |
|
133 | params: { user_groups:true }, | |
134 | formatResult: autocompleteFormatResult, |
|
134 | formatResult: autocompleteFormatResult, | |
135 | lookupFilter: autocompleteFilterResult, |
|
135 | lookupFilter: autocompleteFilterResult, | |
136 | onSelect: function(element, suggestion){ |
|
136 | onSelect: function(element, suggestion){ | |
137 | var owner = {owner_icon: suggestion.owner_icon, owner:suggestion.owner}; |
|
137 | var owner = {owner_icon: suggestion.owner_icon, owner:suggestion.owner}; | |
138 | api.row.add( |
|
138 | api.row.add( | |
139 | {"active": suggestion.active, |
|
139 | {"active": suggestion.active, | |
140 | "owner_data": owner, |
|
140 | "owner_data": owner, | |
141 | "users_group_id": suggestion.id, |
|
141 | "users_group_id": suggestion.id, | |
142 | "group_description": suggestion.description, |
|
142 | "group_description": suggestion.description, | |
143 | "group_name": suggestion.value}).draw(); |
|
143 | "group_name": suggestion.value}).draw(); | |
144 | } |
|
144 | } | |
145 | }); |
|
145 | }); | |
146 | }) |
|
146 | }) | |
147 |
|
147 | |||
148 | </script> |
|
148 | </script> | |
149 |
|
149 | |||
150 |
|
150 |
@@ -1,63 +1,63 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <div class="panel panel-default"> |
|
3 | <div class="panel panel-default"> | |
4 | <div class="panel-heading"> |
|
4 | <div class="panel-heading"> | |
5 | <h3 class="panel-title"> |
|
5 | <h3 class="panel-title"> | |
6 | ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')} |
|
6 | ${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')} | |
7 | - ${_('New SSH Key generation')} |
|
7 | - ${_('New SSH Key generation')} | |
8 | </h3> |
|
8 | </h3> | |
9 | </div> |
|
9 | </div> | |
10 | <div class="panel-body"> |
|
10 | <div class="panel-body"> | |
11 | %if c.ssh_enabled and c.ssh_key_generator_enabled: |
|
11 | %if c.ssh_enabled and c.ssh_key_generator_enabled: | |
12 | <p> |
|
12 | <p> | |
13 | ${_('Below is a 2048 bit generated SSH RSA key.')}<br/>${_('If you use older systems please try to generate a')} <a href="${h.current_route_path(request, private_format='legacy')}">${_('legacy format')}</a> ssh key.<br/> |
|
13 | ${_('Below is a 2048 bit generated SSH RSA key.')}<br/>${_('If you use older systems please try to generate a')} <a href="${h.current_route_path(request, private_format='legacy')}">${_('legacy format')}</a> ssh key.<br/> | |
14 | ${_('If You wish to use it to access RhodeCode via the SSH please save the private key and click `Use this generated key` at the bottom.')} |
|
14 | ${_('If You wish to use it to access RhodeCode via the SSH please save the private key and click `Use this generated key` at the bottom.')} | |
15 | </p> |
|
15 | </p> | |
16 | <h4>${_('Private key')}</h4> |
|
16 | <h4>${_('Private key')}</h4> | |
17 | <pre> |
|
17 | <pre> | |
18 | # Save the below content as |
|
18 | # Save the below content as | |
19 | # Windows: /Users/{username}/.ssh/id_rsa_rhodecode_access_priv.key |
|
19 | # Windows: /Users/{username}/.ssh/id_rsa_rhodecode_access_priv.key | |
20 | # macOS: /Users/{yourname}/.ssh/id_rsa_rhodecode_access_priv.key |
|
20 | # macOS: /Users/{yourname}/.ssh/id_rsa_rhodecode_access_priv.key | |
21 | # Linux: /home/{username}/.ssh/id_rsa_rhodecode_access_priv.key |
|
21 | # Linux: /home/{username}/.ssh/id_rsa_rhodecode_access_priv.key | |
22 |
|
22 | |||
23 | # Change permissions to 0600 to make it secure, and usable. |
|
23 | # Change permissions to 0600 to make it secure, and usable. | |
24 | e.g chmod 0600 /home/{username}/.ssh/id_rsa_rhodecode_access_priv.key |
|
24 | e.g chmod 0600 /home/{username}/.ssh/id_rsa_rhodecode_access_priv.key | |
25 | </pre> |
|
25 | </pre> | |
26 |
|
26 | |||
27 | <div> |
|
27 | <div> | |
28 | <textarea style="height: 300px">${c.private}</textarea> |
|
28 | <textarea style="height: 300px">${c.private}</textarea> | |
29 | </div> |
|
29 | </div> | |
30 | <br/> |
|
30 | <br/> | |
31 |
|
31 | |||
32 | <h4>${_('Public key')}</h4> |
|
32 | <h4>${_('Public key')}</h4> | |
33 | <pre> |
|
33 | <pre> | |
34 | # Save the below content as |
|
34 | # Save the below content as | |
35 | # Windows: /Users/{username}/.ssh/id_rsa_rhodecode_access_pub.key |
|
35 | # Windows: /Users/{username}/.ssh/id_rsa_rhodecode_access_pub.key | |
36 | # macOS: /Users/{yourname}/.ssh/id_rsa_rhodecode_access_pub.key |
|
36 | # macOS: /Users/{yourname}/.ssh/id_rsa_rhodecode_access_pub.key | |
37 | # Linux: /home/{username}/.ssh/id_rsa_rhodecode_access_pub.key |
|
37 | # Linux: /home/{username}/.ssh/id_rsa_rhodecode_access_pub.key | |
38 | </pre> |
|
38 | </pre> | |
39 |
|
39 | |||
40 | <input type="text" value="${c.public}" class="large text" size="100"/> |
|
40 | <input type="text" value="${c.public}" class="large text" size="100"/> | |
41 | <p> |
|
41 | <p style="padding-top: 10px"> | |
42 | % if hasattr(c, 'target_form_url'): |
|
42 | % if hasattr(c, 'target_form_url'): | |
43 | <a href="${c.target_form_url}">${_('Use this generated key')}.</a> |
|
43 | <a class="btn btn-primary" href="${c.target_form_url}">${_('Use this generated key')}.</a> | |
44 | % else: |
|
44 | % else: | |
45 | <a href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id, _query=dict(default_key=c.public))}">${_('Use this generated key')}.</a> |
|
45 | <a class="btn btn-primary" href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id, _query=dict(default_key=c.public))}">${_('Use this generated key')}.</a> | |
46 | % endif |
|
46 | % endif | |
47 | ${_('Confirmation required on the next screen')}. |
|
47 | ${_('Confirmation required on the next screen')}. | |
48 | </p> |
|
48 | </p> | |
49 | % else: |
|
49 | % else: | |
50 | <h2> |
|
50 | <h2> | |
51 | ${_('SSH key generator has been disabled.')} |
|
51 | ${_('SSH key generator has been disabled.')} | |
52 | </h2> |
|
52 | </h2> | |
53 | % endif |
|
53 | % endif | |
54 | </div> |
|
54 | </div> | |
55 | </div> |
|
55 | </div> | |
56 |
|
56 | |||
57 | <script> |
|
57 | <script> | |
58 |
|
58 | |||
59 | $(document).ready(function(){ |
|
59 | $(document).ready(function(){ | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | }); |
|
62 | }); | |
63 | </script> |
|
63 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now