|
Lines 1-4
Link Here
|
| 1 |
[% USE Koha %] |
1 |
[% USE Koha %] |
|
|
2 |
[% SET footerjs = 1 %] |
| 2 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
| 3 |
<title>Koha › Patrons › API Keys</title> |
4 |
<title>Koha › Patrons › API Keys</title> |
| 4 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
|
Lines 8-87
Link Here
|
| 8 |
[% INCLUDE 'patron-search.inc' %] |
9 |
[% INCLUDE 'patron-search.inc' %] |
| 9 |
|
10 |
|
| 10 |
<div id="breadcrumbs"> |
11 |
<div id="breadcrumbs"> |
| 11 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
12 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
| 12 |
› |
13 |
› |
| 13 |
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> |
14 |
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> |
| 14 |
› |
15 |
› |
| 15 |
API Keys for [% INCLUDE 'patron-title.inc' %] |
16 |
API Keys for [% INCLUDE 'patron-title.inc' %] |
| 16 |
</div> |
17 |
</div> |
| 17 |
|
18 |
|
| 18 |
<div id="doc3" class="yui-t2"> |
19 |
<div id="doc3" class="yui-t2"> |
| 19 |
<div id="bd"> |
20 |
<div id="bd"> |
| 20 |
<div id="yui-main"> |
21 |
<div id="yui-main"> |
| 21 |
<div class="yui-b"> |
22 |
<div class="yui-b"> |
| 22 |
[% INCLUDE 'members-toolbar.inc' %] |
23 |
[% INCLUDE 'members-toolbar.inc' %] |
| 23 |
|
24 |
|
| 24 |
<h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1> |
25 |
<h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1> |
| 25 |
<div> |
26 |
<form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none"> |
| 26 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
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 |
<label for="description">Description: </label> |
30 |
<legend>Generate new key</legend> |
| 30 |
<input type="text" name="description"> |
31 |
<ol> |
| 31 |
<button class="btn btn-default btn-sm" type="submit"><i class="fa fa-plus"></i> Generate a new key</span></button> |
32 |
<li> |
| 32 |
</form> |
33 |
<label for="description">Description: </label> |
| 33 |
</div> |
34 |
<input type="text" name="description" /> |
| 34 |
|
35 |
<input type="submit" value="Save" /> |
| 35 |
<br/> |
36 |
<a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a> |
|
|
37 |
</li> |
| 38 |
</ol> |
| 39 |
</fieldset> |
| 40 |
</form> |
| 36 |
|
41 |
|
| 37 |
<div id="keys"> |
42 |
<div id="keys"> |
| 38 |
[% IF api_keys && api_keys.size > 0 %] |
43 |
[% IF api_keys && api_keys.size > 0 %] |
| 39 |
<table> |
44 |
<p> |
| 40 |
<thead> |
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> |
| 41 |
<tr> |
46 |
</p> |
| 42 |
<th>Description</th> |
47 |
<table> |
| 43 |
<th>Key</th> |
48 |
<thead> |
| 44 |
<th>Active</th> |
49 |
<tr> |
| 45 |
<th>Actions</th> |
50 |
<th>Description</th> |
| 46 |
</tr> |
51 |
<th>Key</th> |
| 47 |
</thead> |
52 |
<th>Active</th> |
| 48 |
<tbody> |
53 |
<th>Actions</th> |
| 49 |
[% FOREACH key IN api_keys %] |
54 |
</tr> |
| 50 |
<tr> |
55 |
</thead> |
| 51 |
<td>[% key.description %]</td> |
56 |
<tbody> |
| 52 |
<td>[% key.value %]</td> |
57 |
[% FOREACH key IN api_keys %] |
| 53 |
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td> |
58 |
<tr> |
| 54 |
<td> |
59 |
<td>[% key.description %]</td> |
| 55 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
60 |
<td>[% key.value %]</td> |
| 56 |
<input type="hidden" name="patron_id" value="[% patron.id %]"> |
61 |
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td> |
| 57 |
<input type="hidden" name="key" value="[% key.value %]"> |
62 |
<td> |
| 58 |
<input type="hidden" name="op" value="delete"> |
63 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
| 59 |
<button class="btn btn-default btn-sm" type="submit">Delete</button> |
64 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
| 60 |
</form> |
65 |
<input type="hidden" name="key" value="[% key.value %]" /> |
| 61 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
66 |
<input type="hidden" name="op" value="delete" /> |
| 62 |
<input type="hidden" name="patron_id" value="[% patron.id %]"> |
67 |
<button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button> |
| 63 |
<input type="hidden" name="key" value="[% key.value %]"> |
68 |
</form> |
| 64 |
[% IF key.active %] |
69 |
<form action="/cgi-bin/koha/members/apikeys.pl" method="post"> |
| 65 |
<input type="hidden" name="op" value="revoke"> |
70 |
<input type="hidden" name="patron_id" value="[% patron.id %]" /> |
| 66 |
<button class="btn btn-default btn-sm" type="submit">Revoke</button> |
71 |
<input type="hidden" name="key" value="[% key.value %]" /> |
| 67 |
[% ELSE %] |
72 |
[% IF key.active %] |
| 68 |
<input type="hidden" name="op" value="activate"> |
73 |
<input type="hidden" name="op" value="revoke" /> |
| 69 |
<button class="btn btn-default btn-sm" type="submit">Activate</button> |
74 |
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button> |
| 70 |
[% END %] |
75 |
[% ELSE %] |
| 71 |
</form> |
76 |
<input type="hidden" name="op" value="activate" /> |
| 72 |
</td> |
77 |
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button> |
| 73 |
</tr> |
78 |
[% END %] |
| 74 |
[% END %] |
79 |
</form> |
| 75 |
</tbody> |
80 |
</td> |
| 76 |
</table> |
81 |
</tr> |
| 77 |
[% ELSE %] |
82 |
[% END %] |
| 78 |
<span class="warn">No keys defined for the current patron.</span> |
83 |
</tbody> |
| 79 |
[% END %] |
84 |
</table> |
|
|
85 |
[% 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> |
| 87 |
[% END %] |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
<div class="yui-b"> |
| 92 |
[% INCLUDE 'circ-menu.inc' %] |
| 80 |
</div> |
93 |
</div> |
| 81 |
</div> |
|
|
| 82 |
</div> |
| 83 |
<div class="yui-b"> |
| 84 |
[% INCLUDE 'circ-menu.inc' %] |
| 85 |
</div> |
94 |
</div> |
| 86 |
</div> |
95 |
|
|
|
96 |
[% MACRO jsinclude BLOCK %] |
| 97 |
<script> |
| 98 |
$(document).ready(function(){ |
| 99 |
$(".delete").on("click", function(e){ |
| 100 |
return confirmDelete(_("Are you sure you want to delete this key?")); |
| 101 |
}); |
| 102 |
}); |
| 103 |
</script> |
| 104 |
[% END %] |
| 105 |
|
| 87 |
[% INCLUDE 'intranet-bottom.inc' %] |
106 |
[% INCLUDE 'intranet-bottom.inc' %] |