5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>API Keys › Patrons › Koha</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>
38 [% IF fresh_api_key %]
39 [%# A fresh api key was generated, display the secret, only once %]
41 <span class="alert">Make sure to copy your API secret now. You won’t be able to see it again!</span>
44 <span class="label">Description: </span>
45 [% fresh_api_key.description | html %]
48 <span class="label">Client ID: </span>
49 [% fresh_api_key.client_id | html %]
52 <span class="label">Secret: </span>
53 [% fresh_api_key.plain_text_secret | html %]
59 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
60 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
61 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
62 <input type="hidden" name="op" value="generate" />
63 <fieldset class="brief">
64 <legend>Generate new client id/secret pair</legend>
67 <label for="description">Description: </label>
68 <input type="text" name="description" />
69 <input type="submit" value="Save" />
70 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
77 [% IF api_keys.count %]
79 <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>
87 <th class="noExport">Actions</th>
91 [% FOREACH key IN api_keys %]
93 <td>[% key.description | html %]</td>
94 <td>[% key.client_id | html %]</td>
95 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
97 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
98 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
99 <input type="hidden" name="key" value="[% key.id | html %]" />
100 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
101 <input type="hidden" name="op" value="delete" />
102 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
104 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
105 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
106 <input type="hidden" name="key" value="[% key.id | html %]" />
107 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
109 <input type="hidden" name="op" value="revoke" />
110 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
112 <input type="hidden" name="op" value="activate" />
113 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
122 <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>
126 </div> <!-- /.col-sm-10.col-sm-push-2 -->
128 <div class="col-sm-2 col-sm-pull-10">
130 [% INCLUDE 'circ-menu.inc' %]
132 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
133 </div> <!-- /.row -->
136 [% MACRO jsinclude BLOCK %]
137 [% INCLUDE 'str/members-menu.inc' %]
138 [% Asset.js("js/members-menu.js") | $raw %]
140 $(document).ready(function(){
141 $(".delete").on("click", function(e){
142 return confirmDelete(_("Are you sure you want to delete this key?"));
148 [% INCLUDE 'intranet-bottom.inc' %]