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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
22 <a href="#" aria-current="page">
23 API Keys for [% INCLUDE 'patron-title.inc' %]
29 <div class="main container-fluid">
31 <div class="col-sm-10 col-sm-push-2">
34 [% INCLUDE 'members-toolbar.inc' %]
36 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
37 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
38 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
39 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
40 <input type="hidden" name="op" value="generate" />
41 <fieldset class="brief">
42 <legend>Generate new client id/secret pair</legend>
45 <label for="description">Description: </label>
46 <input type="text" name="description" />
47 <input type="submit" value="Save" />
48 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
55 [% IF api_keys && api_keys.size > 0 %]
57 <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>
66 <th class="noExport">Actions</th>
70 [% FOREACH key IN api_keys %]
72 <td>[% key.description | html %]</td>
73 <td>[% key.client_id | html %]</td>
74 <td>[% key.secret | html %]</td>
75 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
77 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
78 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
79 <input type="hidden" name="key" value="[% key.id | html %]" />
80 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
81 <input type="hidden" name="op" value="delete" />
82 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
84 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
85 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
86 <input type="hidden" name="key" value="[% key.id | html %]" />
87 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
89 <input type="hidden" name="op" value="revoke" />
90 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
92 <input type="hidden" name="op" value="activate" />
93 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
102 <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>
106 </div> <!-- /.col-sm-10.col-sm-push-2 -->
108 <div class="col-sm-2 col-sm-pull-10">
110 [% INCLUDE 'circ-menu.inc' %]
112 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
113 </div> <!-- /.row -->
116 [% MACRO jsinclude BLOCK %]
117 [% INCLUDE 'str/members-menu.inc' %]
118 [% Asset.js("js/members-menu.js") | $raw %]
120 $(document).ready(function(){
121 $(".delete").on("click", function(e){
122 return confirmDelete(_("Are you sure you want to delete this key?"));
128 [% INCLUDE 'intranet-bottom.inc' %]