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 [% WRAPPER breadcrumbs %]
16 [% WRAPPER breadcrumb_item %]
17 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
19 [% WRAPPER breadcrumb_item %]
20 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
22 [% WRAPPER breadcrumb_item bc_active= 1 %]
25 [% END #/ WRAPPER breadcrumbs %]
26 [% END #/ WRAPPER sub-header.inc %]
28 <div class="main container-fluid">
30 <div class="col-sm-10 col-sm-push-2">
33 [% INCLUDE 'members-toolbar.inc' %]
35 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
37 [% IF fresh_api_key %]
38 [%# A fresh api key was generated, display the secret, only once %]
39 <div class="dialog message">Make sure to copy your API secret now. You won’t be able to see it again!</div>
40 <div class="page-section rows">
43 <span class="label">Description: </span>
44 [% fresh_api_key.description | html %]
47 <span class="label">Client ID: </span>
48 [% fresh_api_key.client_id | html %]
51 <span class="label">Secret: </span>
52 [% fresh_api_key.plain_text_secret | html %]
58 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
59 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
60 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
61 <input type="hidden" name="op" value="generate" />
62 <fieldset class="brief">
63 <legend>Generate new client id/secret pair</legend>
66 <label for="description">Description: </label>
67 <input type="text" name="description" />
68 <input type="submit" class="btn btn-primary" value="Save" />
69 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
75 [% IF api_keys.count %]
76 <div class="page-section" id="keys">
78 <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>
86 <th class="noExport">Actions</th>
90 [% FOREACH key IN api_keys %]
92 <td>[% key.description | html %]</td>
93 <td>[% key.client_id | html %]</td>
94 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
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 %]" />
100 <input type="hidden" name="op" value="delete" />
101 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
103 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
104 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
105 <input type="hidden" name="key" value="[% key.id | html %]" />
106 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
108 <input type="hidden" name="op" value="revoke" />
109 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
111 <input type="hidden" name="op" value="activate" />
112 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
120 </div> <!-- /#keys.page-section -->
122 <div class="dialog message">
123 <p>No keys defined for the current patron.</p>
125 <a href="#" class="btn btn-default toggle_element" data-element="#add-api-key" id="show-api-form">
126 <i class="fa fa-plus"></i>
127 <span>Generate a new client id/secret pair</span>
131 [% END # /IF api_keys.count %]
133 </div> <!-- /.col-sm-10.col-sm-push-2 -->
135 <div class="col-sm-2 col-sm-pull-10">
137 [% INCLUDE 'circ-menu.inc' %]
139 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
140 </div> <!-- /.row -->
143 [% MACRO jsinclude BLOCK %]
144 [% INCLUDE 'str/members-menu.inc' %]
145 [% Asset.js("js/members-menu.js") | $raw %]
147 $(document).ready(function(){
148 $(".delete").on("click", function(e){
149 return confirmDelete(_("Are you sure you want to delete this key?"));
155 [% INCLUDE 'intranet-bottom.inc' %]