5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Patrons › API Keys</title>
7 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="pat_apikeys" class="pat">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'patron-search.inc' %]
13 <div id="breadcrumbs">
14 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
16 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
18 API Keys for [% INCLUDE 'patron-title.inc' %]
21 <div id="doc3" class="yui-t2">
25 [% INCLUDE 'members-toolbar.inc' %]
27 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
28 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
29 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
30 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
31 <input type="hidden" name="op" value="generate" />
32 <fieldset class="brief">
33 <legend>Generate new client id/secret pair</legend>
36 <label for="description">Description: </label>
37 <input type="text" name="description" />
38 <input type="submit" value="Save" />
39 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
46 [% IF api_keys && api_keys.size > 0 %]
48 <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>
61 [% FOREACH key IN api_keys %]
63 <td>[% key.description | html %]</td>
64 <td>[% key.client_id | html %]</td>
65 <td>[% key.secret | html %]</td>
66 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
68 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
69 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
70 <input type="hidden" name="key" value="[% key.id | html %]" />
71 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
72 <input type="hidden" name="op" value="delete" />
73 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
75 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
76 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
77 <input type="hidden" name="key" value="[% key.id | html %]" />
78 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
80 <input type="hidden" name="op" value="revoke" />
81 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
83 <input type="hidden" name="op" value="activate" />
84 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
93 <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>
99 [% INCLUDE 'circ-menu.inc' %]
103 [% MACRO jsinclude BLOCK %]
104 [% INCLUDE 'str/members-menu.inc' %]
105 [% Asset.js("js/members-menu.js") | $raw %]
107 $(document).ready(function(){
108 $(".delete").on("click", function(e){
109 return confirmDelete(_("Are you sure you want to delete this key?"));
115 [% INCLUDE 'intranet-bottom.inc' %]