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>
30 [% IF fresh_api_key %]
31 [%# A fresh api key was generated, display the secret, only once %]
33 <span class="alert">Make sure to copy your API secret now. You won’t be able to see it again!</span>
36 <span class="label">Description: </span>
37 [% fresh_api_key.description | html %]
40 <span class="label">Client ID: </span>
41 [% fresh_api_key.client_id | html %]
44 <span class="label">Secret: </span>
45 [% fresh_api_key.plain_text_secret | html %]
51 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
52 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
53 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
54 <input type="hidden" name="op" value="generate" />
55 <fieldset class="brief">
56 <legend>Generate new client id/secret pair</legend>
59 <label for="description">Description: </label>
60 <input type="text" name="description" />
61 <input type="submit" value="Save" />
62 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
69 [% IF api_keys && api_keys.size > 0 %]
71 <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>
83 [% FOREACH key IN api_keys %]
85 <td>[% key.description | html %]</td>
86 <td>[% key.client_id | html %]</td>
87 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
89 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
90 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
91 <input type="hidden" name="key" value="[% key.id | html %]" />
92 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
93 <input type="hidden" name="op" value="delete" />
94 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
96 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
97 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
98 <input type="hidden" name="key" value="[% key.id | html %]" />
99 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
101 <input type="hidden" name="op" value="revoke" />
102 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
104 <input type="hidden" name="op" value="activate" />
105 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
114 <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>
118 </div> <!-- /.col-sm-10.col-sm-push-2 -->
120 <div class="col-sm-2 col-sm-pull-10">
122 [% INCLUDE 'circ-menu.inc' %]
124 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125 </div> <!-- /.row -->
128 [% MACRO jsinclude BLOCK %]
129 [% INCLUDE 'str/members-menu.inc' %]
130 [% Asset.js("js/members-menu.js") | $raw %]
132 $(document).ready(function(){
133 $(".delete").on("click", function(e){
134 return confirmDelete(_("Are you sure you want to delete this key?"));
140 [% INCLUDE 'intranet-bottom.inc' %]