##// END OF EJS Templates
auth-tokens: show all available roles for the builtin token....
marcink -
r1272:35c9ce2a default
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,102 +1,106 b''
1 <div class="panel panel-default">
1 <div class="panel panel-default">
2 <div class="panel-heading">
2 <div class="panel-heading">
3 <h3 class="panel-title">${_('Authentication Tokens')}</h3>
3 <h3 class="panel-title">${_('Authentication Tokens')}</h3>
4 </div>
4 </div>
5 <div class="panel-body">
5 <div class="panel-body">
6 <p>
6 <p>
7 ${_('Built-in tokens can be used to authenticate with all possible options.')}<br/>
7 ${_('Built-in tokens can be used to authenticate with all possible options.')}<br/>
8 ${_('Each token can have a role. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations.')}
8 ${_('Each token can have a role. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations.')}
9 </p>
9 </p>
10 <table class="rctable auth_tokens">
10 <table class="rctable auth_tokens">
11 <tr>
11 <tr>
12 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${c.user.api_key}</code></div></td>
12 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${c.user.api_key}</code></div></td>
13 <td class="td-buttons">
13 <td class="td-tags">
14 <span class="btn btn-mini btn-info disabled">${_('Built-in')}</span>
14 <span class="tag disabled">${_('Built-in')}</span>
15 </td>
15 </td>
16 <td class="td-buttons">
16 <td class="td-tags">
17 <span class="btn btn-mini btn-info disabled">all</span>
17 % for token in c.user.builtin_token_roles:
18 <span class="tag disabled">
19 ${token}
20 </span>
21 % endfor
18 </td>
22 </td>
19 <td class="td-exp">${_('expires')}: ${_('never')}</td>
23 <td class="td-exp">${_('expires')}: ${_('never')}</td>
20 <td class="td-action">
24 <td class="td-action">
21 ${h.secure_form(url('my_account_auth_tokens'),method='delete')}
25 ${h.secure_form(url('my_account_auth_tokens'),method='delete')}
22 ${h.hidden('del_auth_token',c.user.api_key)}
26 ${h.hidden('del_auth_token',c.user.api_key)}
23 ${h.hidden('del_auth_token_builtin',1)}
27 ${h.hidden('del_auth_token_builtin',1)}
24 <button class="btn-link btn-danger" type="submit"
28 <button class="btn-link btn-danger" type="submit"
25 onclick="return confirm('${_('Confirm to reset this auth token: %s') % c.user.api_key}');">
29 onclick="return confirm('${_('Confirm to reset this auth token: %s') % c.user.api_key}');">
26 <i class="icon-refresh"></i>
30 <i class="icon-refresh"></i>
27 ${_('Reset')}
31 ${_('Reset')}
28 </button>
32 </button>
29 ${h.end_form()}
33 ${h.end_form()}
30 </td>
34 </td>
31 </tr>
35 </tr>
32 %if c.user_auth_tokens:
36 %if c.user_auth_tokens:
33 %for auth_token in c.user_auth_tokens:
37 %for auth_token in c.user_auth_tokens:
34 <tr class="${'expired' if auth_token.expired else ''}">
38 <tr class="${'expired' if auth_token.expired else ''}">
35 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td>
39 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td>
36 <td class="td-wrap">${auth_token.description}</td>
40 <td class="td-wrap">${auth_token.description}</td>
37 <td class="td-buttons">
41 <td class="td-tags">
38 <span class="btn btn-mini btn-info disabled">${auth_token.role_humanized}</span>
42 <span class="tag disabled">${auth_token.role_humanized}</span>
39 </td>
43 </td>
40 <td class="td-exp">
44 <td class="td-exp">
41 %if auth_token.expires == -1:
45 %if auth_token.expires == -1:
42 ${_('expires')}: ${_('never')}
46 ${_('expires')}: ${_('never')}
43 %else:
47 %else:
44 %if auth_token.expired:
48 %if auth_token.expired:
45 ${_('expired')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
49 ${_('expired')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
46 %else:
50 %else:
47 ${_('expires')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
51 ${_('expires')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
48 %endif
52 %endif
49 %endif
53 %endif
50 </td>
54 </td>
51 <td class="td-action">
55 <td class="td-action">
52 ${h.secure_form(url('my_account_auth_tokens'),method='delete')}
56 ${h.secure_form(url('my_account_auth_tokens'),method='delete')}
53 ${h.hidden('del_auth_token',auth_token.api_key)}
57 ${h.hidden('del_auth_token',auth_token.api_key)}
54 <button class="btn btn-link btn-danger" type="submit"
58 <button class="btn btn-link btn-danger" type="submit"
55 onclick="return confirm('${_('Confirm to remove this auth token: %s') % auth_token.api_key}');">
59 onclick="return confirm('${_('Confirm to remove this auth token: %s') % auth_token.api_key}');">
56 ${_('Delete')}
60 ${_('Delete')}
57 </button>
61 </button>
58 ${h.end_form()}
62 ${h.end_form()}
59 </td>
63 </td>
60 </tr>
64 </tr>
61 %endfor
65 %endfor
62 %else:
66 %else:
63 <tr><td><div class="ip">${_('No additional auth token specified')}</div></td></tr>
67 <tr><td><div class="ip">${_('No additional auth token specified')}</div></td></tr>
64 %endif
68 %endif
65 </table>
69 </table>
66
70
67 <div class="user_auth_tokens">
71 <div class="user_auth_tokens">
68 ${h.secure_form(url('my_account_auth_tokens'), method='post')}
72 ${h.secure_form(url('my_account_auth_tokens'), method='post')}
69 <div class="form form-vertical">
73 <div class="form form-vertical">
70 <!-- fields -->
74 <!-- fields -->
71 <div class="fields">
75 <div class="fields">
72 <div class="field">
76 <div class="field">
73 <div class="label">
77 <div class="label">
74 <label for="new_email">${_('New authentication token')}:</label>
78 <label for="new_email">${_('New authentication token')}:</label>
75 </div>
79 </div>
76 <div class="input">
80 <div class="input">
77 ${h.text('description', placeholder=_('Description'))}
81 ${h.text('description', placeholder=_('Description'))}
78 ${h.select('lifetime', '', c.lifetime_options)}
82 ${h.select('lifetime', '', c.lifetime_options)}
79 ${h.select('role', '', c.role_options)}
83 ${h.select('role', '', c.role_options)}
80 </div>
84 </div>
81 </div>
85 </div>
82 <div class="buttons">
86 <div class="buttons">
83 ${h.submit('save',_('Add'),class_="btn")}
87 ${h.submit('save',_('Add'),class_="btn")}
84 ${h.reset('reset',_('Reset'),class_="btn")}
88 ${h.reset('reset',_('Reset'),class_="btn")}
85 </div>
89 </div>
86 </div>
90 </div>
87 </div>
91 </div>
88 ${h.end_form()}
92 ${h.end_form()}
89 </div>
93 </div>
90 </div>
94 </div>
91 </div>
95 </div>
92 <script>
96 <script>
93 $(document).ready(function(){
97 $(document).ready(function(){
94 var select2Options = {
98 var select2Options = {
95 'containerCssClass': "drop-menu",
99 'containerCssClass': "drop-menu",
96 'dropdownCssClass': "drop-menu-dropdown",
100 'dropdownCssClass': "drop-menu-dropdown",
97 'dropdownAutoWidth': true
101 'dropdownAutoWidth': true
98 };
102 };
99 $("#lifetime").select2(select2Options);
103 $("#lifetime").select2(select2Options);
100 $("#role").select2(select2Options);
104 $("#role").select2(select2Options);
101 });
105 });
102 </script>
106 </script>
@@ -1,103 +1,107 b''
1 <div class="panel panel-default">
1 <div class="panel panel-default">
2 <div class="panel-heading">
2 <div class="panel-heading">
3 <h3 class="panel-title">${_('Authentication Access Tokens')}</h3>
3 <h3 class="panel-title">${_('Authentication Access Tokens')}</h3>
4 </div>
4 </div>
5 <div class="panel-body">
5 <div class="panel-body">
6 <div class="apikeys_wrap">
6 <div class="apikeys_wrap">
7 <table class="rctable auth_tokens">
7 <table class="rctable auth_tokens">
8 <tr>
8 <tr>
9 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${c.user.api_key}</code></div></td>
9 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${c.user.api_key}</code></div></td>
10 <td class="td-tags">
10 <td class="td-tags">
11 <span class="tag disabled">${_('Built-in')}</span>
11 <span class="tag disabled">${_('Built-in')}</span>
12 </td>
12 </td>
13 <td class="td-tags">
13 <td class="td-tags">
14 <span class="tag disabled">all</span>
14 % for token in c.user.builtin_token_roles:
15 <span class="tag disabled">
16 ${token}
17 </span>
18 % endfor
15 </td>
19 </td>
16 <td class="td-exp">${_('expires')}: ${_('never')}</td>
20 <td class="td-exp">${_('expires')}: ${_('never')}</td>
17 <td class="td-action">
21 <td class="td-action">
18 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id),method='delete')}
22 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id),method='delete')}
19 ${h.hidden('del_auth_token',c.user.api_key)}
23 ${h.hidden('del_auth_token',c.user.api_key)}
20 ${h.hidden('del_auth_token_builtin',1)}
24 ${h.hidden('del_auth_token_builtin',1)}
21 <button class="btn btn-link btn-danger" type="submit"
25 <button class="btn btn-link btn-danger" type="submit"
22 onclick="return confirm('${_('Confirm to reset this auth token: %s') % c.user.api_key}');">
26 onclick="return confirm('${_('Confirm to reset this auth token: %s') % c.user.api_key}');">
23 ${_('Reset')}
27 ${_('Reset')}
24 </button>
28 </button>
25 ${h.end_form()}
29 ${h.end_form()}
26 </td>
30 </td>
27 </tr>
31 </tr>
28 %if c.user_auth_tokens:
32 %if c.user_auth_tokens:
29 %for auth_token in c.user_auth_tokens:
33 %for auth_token in c.user_auth_tokens:
30 <tr class="${'expired' if auth_token.expired else ''}">
34 <tr class="${'expired' if auth_token.expired else ''}">
31 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td>
35 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td>
32 <td class="td-wrap">${auth_token.description}</td>
36 <td class="td-wrap">${auth_token.description}</td>
33 <td class="td-tags">
37 <td class="td-tags">
34 <span class="tag">${auth_token.role_humanized}</span>
38 <span class="tag">${auth_token.role_humanized}</span>
35 </td>
39 </td>
36 <td class="td-exp">
40 <td class="td-exp">
37 %if auth_token.expires == -1:
41 %if auth_token.expires == -1:
38 ${_('expires')}: ${_('never')}
42 ${_('expires')}: ${_('never')}
39 %else:
43 %else:
40 %if auth_token.expired:
44 %if auth_token.expired:
41 ${_('expired')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
45 ${_('expired')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
42 %else:
46 %else:
43 ${_('expires')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
47 ${_('expires')}: ${h.age_component(h.time_to_utcdatetime(auth_token.expires))}
44 %endif
48 %endif
45 %endif
49 %endif
46 </td>
50 </td>
47 <td>
51 <td>
48 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id),method='delete')}
52 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id),method='delete')}
49 ${h.hidden('del_auth_token',auth_token.api_key)}
53 ${h.hidden('del_auth_token',auth_token.api_key)}
50 <button class="btn btn-link btn-danger" type="submit"
54 <button class="btn btn-link btn-danger" type="submit"
51 onclick="return confirm('${_('Confirm to remove this auth token: %s') % auth_token.api_key}');">
55 onclick="return confirm('${_('Confirm to remove this auth token: %s') % auth_token.api_key}');">
52 ${_('Delete')}
56 ${_('Delete')}
53 </button>
57 </button>
54 ${h.end_form()}
58 ${h.end_form()}
55 </td>
59 </td>
56 </tr>
60 </tr>
57 %endfor
61 %endfor
58 %else:
62 %else:
59 <tr><td><div class="ip">${_('No additional auth tokens specified')}</div></td></tr>
63 <tr><td><div class="ip">${_('No additional auth tokens specified')}</div></td></tr>
60 %endif
64 %endif
61 </table>
65 </table>
62 </div>
66 </div>
63
67
64 <div class="user_auth_tokens">
68 <div class="user_auth_tokens">
65 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id), method='put')}
69 ${h.secure_form(url('edit_user_auth_tokens', user_id=c.user.user_id), method='put')}
66 <div class="form form-vertical">
70 <div class="form form-vertical">
67 <!-- fields -->
71 <!-- fields -->
68 <div class="fields">
72 <div class="fields">
69 <div class="field">
73 <div class="field">
70 <div class="label">
74 <div class="label">
71 <label for="new_email">${_('New auth token')}:</label>
75 <label for="new_email">${_('New auth token')}:</label>
72 </div>
76 </div>
73 <div class="input">
77 <div class="input">
74 ${h.text('description', class_='medium', placeholder=_('Description'))}
78 ${h.text('description', class_='medium', placeholder=_('Description'))}
75 ${h.select('lifetime', '', c.lifetime_options)}
79 ${h.select('lifetime', '', c.lifetime_options)}
76 ${h.select('role', '', c.role_options)}
80 ${h.select('role', '', c.role_options)}
77 </div>
81 </div>
78 </div>
82 </div>
79 <div class="buttons">
83 <div class="buttons">
80 ${h.submit('save',_('Add'),class_="btn btn-small")}
84 ${h.submit('save',_('Add'),class_="btn btn-small")}
81 ${h.reset('reset',_('Reset'),class_="btn btn-small")}
85 ${h.reset('reset',_('Reset'),class_="btn btn-small")}
82 </div>
86 </div>
83 </div>
87 </div>
84 </div>
88 </div>
85 ${h.end_form()}
89 ${h.end_form()}
86 </div>
90 </div>
87 </div>
91 </div>
88 </div>
92 </div>
89
93
90 <script>
94 <script>
91 $(document).ready(function(){
95 $(document).ready(function(){
92 $("#lifetime").select2({
96 $("#lifetime").select2({
93 'containerCssClass': "drop-menu",
97 'containerCssClass': "drop-menu",
94 'dropdownCssClass': "drop-menu-dropdown",
98 'dropdownCssClass': "drop-menu-dropdown",
95 'dropdownAutoWidth': true
99 'dropdownAutoWidth': true
96 });
100 });
97 $("#role").select2({
101 $("#role").select2({
98 'containerCssClass': "drop-menu",
102 'containerCssClass': "drop-menu",
99 'dropdownCssClass': "drop-menu-dropdown",
103 'dropdownCssClass': "drop-menu-dropdown",
100 'dropdownAutoWidth': true
104 'dropdownAutoWidth': true
101 });
105 });
102 })
106 })
103 </script>
107 </script>
General Comments 0
You need to be logged in to leave comments. Login now