##// END OF EJS Templates
auth-tokens: improve UI.
marcink -
r3391:d889da9e default
parent child Browse files
Show More
@@ -1130,10 +1130,10 b' class UserApiKeys(Base, BaseModel):'
1130 1130
1131 1131 def _get_scope(self):
1132 1132 if self.repo:
1133 return repr(self.repo)
1133 return 'Repository: {}'.format(self.repo.repo_name)
1134 1134 if self.repo_group:
1135 return repr(self.repo_group) + ' (recursive)'
1136 return 'global'
1135 return 'RepositoryGroup: {} (recursive)'.format(self.repo_group.group_name)
1136 return 'Global'
1137 1137
1138 1138 @property
1139 1139 def scope_humanized(self):
@@ -5,31 +5,32 b''
5 5 <div class="panel-body">
6 6 <div class="apikeys_wrap">
7 7 <p>
8 ${_('Each token can have a role. Token with a role can be used only in given context, '
8 ${_('Authentication tokens can be used to interact with the API, or VCS-over-http. '
9 'Each token can have a role. Token with a role can be used only in given context, '
9 10 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')}
10 11 </p>
11 12 <table class="rctable auth_tokens">
12 13 <tr>
13 14 <th>${_('Token')}</th>
14 <th>${_('Scope')}</th>
15 15 <th>${_('Description')}</th>
16 16 <th>${_('Role')}</th>
17 <th>${_('Repository Scope')}</th>
17 18 <th>${_('Expiration')}</th>
18 19 <th>${_('Action')}</th>
19 20 </tr>
20 21 %if c.user_auth_tokens:
21 22 %for auth_token in c.user_auth_tokens:
22 <tr class="${'expired' if auth_token.expired else ''}">
23 <tr class="${('expired' if auth_token.expired else '')}">
23 24 <td class="truncate-wrap td-authtoken">
24 25 <div class="user_auth_tokens truncate autoexpand">
25 26 <code>${auth_token.api_key}</code>
26 27 </div>
27 28 </td>
28 <td class="td">${auth_token.scope_humanized}</td>
29 29 <td class="td-wrap">${auth_token.description}</td>
30 30 <td class="td-tags">
31 31 <span class="tag disabled">${auth_token.role_humanized}</span>
32 32 </td>
33 <td class="td">${auth_token.scope_humanized}</td>
33 34 <td class="td-exp">
34 35 %if auth_token.expires == -1:
35 36 ${_('never')}
@@ -92,6 +93,7 b''
92 93 </div>
93 94 </div>
94 95 </div>
96
95 97 <script>
96 98 $(document).ready(function(){
97 99
@@ -5,27 +5,32 b''
5 5 <div class="panel-body">
6 6 <div class="apikeys_wrap">
7 7 <p>
8 ${_('Each token can have a role. Token with a role can be used only in given context, '
8 ${_('Authentication tokens can be used to interact with the API, or VCS-over-http. '
9 'Each token can have a role. Token with a role can be used only in given context, '
9 10 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')}
10 11 </p>
11 12 <table class="rctable auth_tokens">
12 13 <tr>
13 14 <th>${_('Token')}</th>
14 <th>${_('Scope')}</th>
15 15 <th>${_('Description')}</th>
16 16 <th>${_('Role')}</th>
17 <th>${_('Repository Scope')}</th>
17 18 <th>${_('Expiration')}</th>
18 19 <th>${_('Action')}</th>
19 20 </tr>
20 21 %if c.user_auth_tokens:
21 22 %for auth_token in c.user_auth_tokens:
22 <tr class="${'expired' if auth_token.expired else ''}">
23 <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td>
24 <td class="td">${auth_token.scope_humanized}</td>
23 <tr class="${('expired' if auth_token.expired else '')}">
24 <td class="truncate-wrap td-authtoken">
25 <div class="user_auth_tokens truncate autoexpand">
26 <code>${auth_token.api_key}</code>
27 </div>
28 </td>
25 29 <td class="td-wrap">${auth_token.description}</td>
26 30 <td class="td-tags">
27 31 <span class="tag disabled">${auth_token.role_humanized}</span>
28 32 </td>
33 <td class="td">${auth_token.scope_humanized}</td>
29 34 <td class="td-exp">
30 35 %if auth_token.expires == -1:
31 36 ${_('never')}
General Comments 0
You need to be logged in to leave comments. Login now