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 class="main container-fluid">
23 <div class="col-sm-10 col-sm-push-2">
26 [% INCLUDE 'members-toolbar.inc' %]
28 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
29 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
30 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
31 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
32 <input type="hidden" name="op" value="generate" />
33 <fieldset class="brief">
34 <legend>Generate new client id/secret pair</legend>
37 <label for="description">Description: </label>
38 <input type="text" name="description" />
39 <input type="submit" value="Save" />
40 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
47 [% IF api_keys && api_keys.size > 0 %]
49 <button class="btn btn-default 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>
62 [% FOREACH key IN api_keys %]
64 <td>[% key.description | html %]</td>
65 <td>[% key.client_id | html %]</td>
66 <td>[% key.secret | html %]</td>
67 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
69 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
70 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
71 <input type="hidden" name="key" value="[% key.id | html %]" />
72 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
73 <input type="hidden" name="op" value="delete" />
74 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
76 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
77 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
78 <input type="hidden" name="key" value="[% key.id | html %]" />
79 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
81 <input type="hidden" name="op" value="revoke" />
82 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
84 <input type="hidden" name="op" value="activate" />
85 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
94 <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>
98 </div> <!-- /.col-sm-10.col-sm-push-2 -->
100 <div class="col-sm-2 col-sm-pull-10">
102 [% INCLUDE 'circ-menu.inc' %]
104 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
105 </div> <!-- /.row -->
108 [% MACRO jsinclude BLOCK %]
109 [% INCLUDE 'str/members-menu.inc' %]
110 [% Asset.js("js/members-menu.js") | $raw %]
112 $(document).ready(function(){
113 $(".delete").on("click", function(e){
114 return confirmDelete(_("Are you sure you want to delete this key?"));
120 [% INCLUDE 'intranet-bottom.inc' %]