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