4 [% PROCESS 'i18n.inc' %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% FILTER collapse %]
8 [% t("API Keys") | html %] ›
9 [% t("Patrons") | html %] ›
10 [% t("Koha") | html %]
12 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="pat_apikeys" class="pat">
15 [% WRAPPER 'header.inc' %]
16 [% INCLUDE 'patron-search-header.inc' %]
19 [% WRAPPER 'sub-header.inc' %]
20 [% WRAPPER breadcrumbs %]
21 [% WRAPPER breadcrumb_item %]
22 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
24 [% WRAPPER breadcrumb_item %]
25 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
27 [% WRAPPER breadcrumb_item bc_active= 1 %]
30 [% END #/ WRAPPER breadcrumbs %]
31 [% END #/ WRAPPER sub-header.inc %]
33 <div class="main container-fluid">
35 <div class="col-sm-10 col-sm-push-2">
38 [% INCLUDE 'members-toolbar.inc' %]
40 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
42 [% IF fresh_api_key %]
43 [%# A fresh api key was generated, display the secret, only once %]
44 <div class="dialog message">Make sure to copy your API secret now. You won’t be able to see it again!</div>
45 <div class="page-section rows">
48 <span class="label">Description: </span>
49 [% fresh_api_key.description | html %]
52 <span class="label">Client ID: </span>
53 [% fresh_api_key.client_id | html %]
56 <span class="label">Secret: </span>
57 [% fresh_api_key.plain_text_secret | html %]
63 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
64 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
65 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
66 <input type="hidden" name="op" value="generate" />
67 <fieldset class="brief">
68 <legend>Generate new client id/secret pair</legend>
71 <label for="description">Description: </label>
72 <input type="text" name="description" />
73 <input type="submit" class="btn btn-primary" value="Save" />
74 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
80 [% IF api_keys.count %]
81 <div class="page-section" id="keys">
83 <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>
91 <th class="noExport">Actions</th>
95 [% FOREACH key IN api_keys %]
97 <td>[% key.description | html %]</td>
98 <td>[% key.client_id | html %]</td>
99 <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
101 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
102 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
103 <input type="hidden" name="key" value="[% key.id | html %]" />
104 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
105 <input type="hidden" name="op" value="delete" />
106 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash-can"></i> Delete</button>
108 <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
109 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
110 <input type="hidden" name="key" value="[% key.id | html %]" />
111 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
113 <input type="hidden" name="op" value="revoke" />
114 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-times"></i> Revoke</button>
116 <input type="hidden" name="op" value="activate" />
117 <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
125 </div> <!-- /#keys.page-section -->
127 <div class="dialog message">
128 <p>No keys defined for the current patron.</p>
130 <a href="#" class="btn btn-default toggle_element" data-element="#add-api-key" id="show-api-form">
131 <i class="fa fa-plus"></i>
132 <span>Generate a new client id/secret pair</span>
136 [% END # /IF api_keys.count %]
138 </div> <!-- /.col-sm-10.col-sm-push-2 -->
140 <div class="col-sm-2 col-sm-pull-10">
142 [% INCLUDE 'circ-menu.inc' %]
144 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
145 </div> <!-- /.row -->
148 [% MACRO jsinclude BLOCK %]
149 [% INCLUDE 'str/members-menu.inc' %]
150 [% Asset.js("js/members-menu.js") | $raw %]
152 $(document).ready(function(){
153 $(".delete").on("click", function(e){
154 return confirmDelete(_("Are you sure you want to delete this key?"));
160 [% INCLUDE 'intranet-bottom.inc' %]