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 [% WRAPPER 'header.inc' %]
11 [% INCLUDE 'patron-search-header.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
24 <a href="#" aria-current="page">
25 API Keys for [% INCLUDE 'patron-title.inc' %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 [% INCLUDE 'members-toolbar.inc' %]
39 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
41 [% IF fresh_api_key %]
42 [%# A fresh api key was generated, display the secret, only once %]
44 <span class="alert">Make sure to copy your API secret now. You won’t be able to see it again!</span>
47 <span class="label">Description: </span>
48 [% fresh_api_key.description | html %]
51 <span class="label">Client ID: </span>
52 [% fresh_api_key.client_id | html %]
55 <span class="label">Secret: </span>
56 [% fresh_api_key.plain_text_secret | html %]
62 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
63 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
64 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
65 <input type="hidden" name="op" value="generate" />
66 <fieldset class="brief">
67 <legend>Generate new client id/secret pair</legend>
70 <label for="description">Description: </label>
71 <input type="text" name="description" />
72 <input type="submit" value="Save" />
73 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
80 [% IF api_keys.count %]
82 <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>
90 <th class="noExport">Actions</th>
94 [% FOREACH key IN api_keys %]
96 <td>[% key.description | html %]</td>
97 <td>[% key.client_id | html %]</td>
98 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
100 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
101 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
102 <input type="hidden" name="key" value="[% key.id | html %]" />
103 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
104 <input type="hidden" name="op" value="delete" />
105 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
107 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
108 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
109 <input type="hidden" name="key" value="[% key.id | html %]" />
110 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
112 <input type="hidden" name="op" value="revoke" />
113 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
115 <input type="hidden" name="op" value="activate" />
116 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
125 <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>
129 </div> <!-- /.col-sm-10.col-sm-push-2 -->
131 <div class="col-sm-2 col-sm-pull-10">
133 [% INCLUDE 'circ-menu.inc' %]
135 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
136 </div> <!-- /.row -->
139 [% MACRO jsinclude BLOCK %]
140 [% INCLUDE 'str/members-menu.inc' %]
141 [% Asset.js("js/members-menu.js") | $raw %]
143 $(document).ready(function(){
144 $(".delete").on("click", function(e){
145 return confirmDelete(_("Are you sure you want to delete this key?"));
151 [% INCLUDE 'intranet-bottom.inc' %]