Lines 27-33
Link Here
|
27 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
27 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
28 |
<input type="hidden" name="op" value="generate" /> |
28 |
<input type="hidden" name="op" value="generate" /> |
29 |
<fieldset class="brief"> |
29 |
<fieldset class="brief"> |
30 |
<legend>Generate new key</legend> |
30 |
<legend>Generate new client id/secret pair</legend> |
31 |
<ol> |
31 |
<ol> |
32 |
<li> |
32 |
<li> |
33 |
<label for="description">Description: </label> |
33 |
<label for="description">Description: </label> |
Lines 42-54
Link Here
|
42 |
<div id="keys"> |
42 |
<div id="keys"> |
43 |
[% IF api_keys && api_keys.size > 0 %] |
43 |
[% IF api_keys && api_keys.size > 0 %] |
44 |
<p> |
44 |
<p> |
45 |
<button class="btn btn-default btn-xs toggle_element" type="submit" id="show-api-form" data-element="#add-api-key"><i class="fa fa-plus"></i> Generate a new key</button> |
45 |
<button class="btn btn-default btn-xs toggle_element" type="submit" id="show-api-form" data-element="#add-api-key"><i class="fa fa-plus"></i> Generate a new client id/key pair</button> |
46 |
</p> |
46 |
</p> |
47 |
<table> |
47 |
<table> |
48 |
<thead> |
48 |
<thead> |
49 |
<tr> |
49 |
<tr> |
50 |
<th>Description</th> |
50 |
<th>Description</th> |
51 |
<th>Key</th> |
51 |
<th>Client ID</th> |
|
|
52 |
<th>Secret</th> |
52 |
<th>Active</th> |
53 |
<th>Active</th> |
53 |
<th>Actions</th> |
54 |
<th>Actions</th> |
54 |
</tr> |
55 |
</tr> |
Lines 57-74
Link Here
|
57 |
[% FOREACH key IN api_keys %] |
58 |
[% FOREACH key IN api_keys %] |
58 |
<tr> |
59 |
<tr> |
59 |
<td>[% key.description %]</td> |
60 |
<td>[% key.description %]</td> |
60 |
<td>[% key.value %]</td> |
61 |
<td>[% key.client_id %]</td> |
|
|
62 |
<td>[% key.secret %]</td> |
61 |
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td> |
63 |
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td> |
62 |
<td> |
64 |
<td> |
63 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
65 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
64 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
66 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
65 |
<input type="hidden" name="key" value="[% key.value %]" /> |
67 |
<input type="hidden" name="key" value="[% key.id %]" /> |
66 |
<input type="hidden" name="op" value="delete" /> |
68 |
<input type="hidden" name="op" value="delete" /> |
67 |
<button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button> |
69 |
<button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button> |
68 |
</form> |
70 |
</form> |
69 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
71 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
70 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
72 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
71 |
<input type="hidden" name="key" value="[% key.value %]" /> |
73 |
<input type="hidden" name="key" value="[% key.id %]" /> |
72 |
[% IF key.active %] |
74 |
[% IF key.active %] |
73 |
<input type="hidden" name="op" value="revoke" /> |
75 |
<input type="hidden" name="op" value="revoke" /> |
74 |
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button> |
76 |
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button> |
Lines 83-89
Link Here
|
83 |
</tbody> |
85 |
</tbody> |
84 |
</table> |
86 |
</table> |
85 |
[% ELSE %] |
87 |
[% ELSE %] |
86 |
<div class="dialog message">No keys defined for the current patron. <a href="#" class="toggle_element" data-element="#add-api-key" id="show-api-form"><i class="fa fa-plus"></i> Generate a new key</div> |
88 |
<div class="dialog message">No keys defined for the current patron. <a href="#" class="toggle_element" data-element="#add-api-key" id="show-api-form"><i class="fa fa-plus"></i> Generate a new client id/secret pair</div> |
87 |
[% END %] |
89 |
[% END %] |
88 |
</div> |
90 |
</div> |
89 |
</div> |
91 |
</div> |