Owen Leonard
a674c45716
This patch updates several patron templates so that they use the new WRAPPER for displaying breadcrumbs. To test, apply the patch and test each page and its variations. Breadcrumbs should look correct, and each link should be correct. - Patron details -> - Accounting -> Transactions - Transaction details - Check the details of a debit and a credit - More -> - Manage API keys (must have RESTOAuth2ClientCredentials preference enabled) - Delete (with a patron who has checkouts) - Discharge Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
147 lines
7.3 KiB
Text
147 lines
7.3 KiB
Text
[% USE raw %]
|
||
[% USE Koha %]
|
||
[% USE Asset %]
|
||
[% SET footerjs = 1 %]
|
||
[% INCLUDE 'doc-head-open.inc' %]
|
||
<title>API Keys › Patrons › Koha</title>
|
||
[% INCLUDE 'doc-head-close.inc' %]
|
||
</head>
|
||
<body id="pat_apikeys" class="pat">
|
||
[% WRAPPER 'header.inc' %]
|
||
[% INCLUDE 'patron-search-header.inc' %]
|
||
[% END %]
|
||
|
||
[% WRAPPER 'sub-header.inc' %]
|
||
[% WRAPPER breadcrumbs %]
|
||
[% WRAPPER breadcrumb_item %]
|
||
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
|
||
[% END %]
|
||
[% WRAPPER breadcrumb_item %]
|
||
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
|
||
[% END %]
|
||
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
||
<span>API keys</span>
|
||
[% END %]
|
||
[% END #/ WRAPPER breadcrumbs %]
|
||
[% END #/ WRAPPER sub-header.inc %]
|
||
|
||
<div class="main container-fluid">
|
||
<div class="row">
|
||
<div class="col-sm-10 col-sm-push-2">
|
||
<main>
|
||
|
||
[% INCLUDE 'members-toolbar.inc' %]
|
||
|
||
<h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
|
||
|
||
[% IF fresh_api_key %]
|
||
[%# A fresh api key was generated, display the secret, only once %]
|
||
<div class="rows">
|
||
<span class="alert">Make sure to copy your API secret now. You won’t be able to see it again!</span>
|
||
<ol>
|
||
<li>
|
||
<span class="label">Description: </span>
|
||
[% fresh_api_key.description | html %]
|
||
</li>
|
||
<li>
|
||
<span class="label">Client ID: </span>
|
||
[% fresh_api_key.client_id | html %]
|
||
</li>
|
||
<li>
|
||
<span class="label">Secret: </span>
|
||
[% fresh_api_key.plain_text_secret | html %]
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
[% END %]
|
||
|
||
<form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
|
||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||
<input type="hidden" name="op" value="generate" />
|
||
<fieldset class="brief">
|
||
<legend>Generate new client id/secret pair</legend>
|
||
<ol>
|
||
<li>
|
||
<label for="description">Description: </label>
|
||
<input type="text" name="description" />
|
||
<input type="submit" class="btn btn-primary" value="Save" />
|
||
<a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
|
||
</li>
|
||
</ol>
|
||
</fieldset>
|
||
</form>
|
||
|
||
<div id="keys">
|
||
[% IF api_keys.count %]
|
||
<p>
|
||
<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>
|
||
</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Description</th>
|
||
<th>Client ID</th>
|
||
<th>Active</th>
|
||
<th class="noExport">Actions</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
[% FOREACH key IN api_keys %]
|
||
<tr>
|
||
<td>[% key.description | html %]</td>
|
||
<td>[% key.client_id | html %]</td>
|
||
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
|
||
<td>
|
||
<form action="/cgi-bin/koha/members/apikeys.pl" method="post">
|
||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||
<input type="hidden" name="key" value="[% key.id | html %]" />
|
||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||
<input type="hidden" name="op" value="delete" />
|
||
<button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
|
||
</form>
|
||
<form action="/cgi-bin/koha/members/apikeys.pl" method="post">
|
||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||
<input type="hidden" name="key" value="[% key.id | html %]" />
|
||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||
[% IF key.active %]
|
||
<input type="hidden" name="op" value="revoke" />
|
||
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
|
||
[% ELSE %]
|
||
<input type="hidden" name="op" value="activate" />
|
||
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
|
||
[% END %]
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
[% END %]
|
||
</tbody>
|
||
</table>
|
||
[% ELSE %]
|
||
<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>
|
||
[% END %]
|
||
</div>
|
||
</main>
|
||
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
||
|
||
<div class="col-sm-2 col-sm-pull-10">
|
||
<aside>
|
||
[% INCLUDE 'circ-menu.inc' %]
|
||
</aside>
|
||
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
||
</div> <!-- /.row -->
|
||
|
||
|
||
[% MACRO jsinclude BLOCK %]
|
||
[% INCLUDE 'str/members-menu.inc' %]
|
||
[% Asset.js("js/members-menu.js") | $raw %]
|
||
<script>
|
||
$(document).ready(function(){
|
||
$(".delete").on("click", function(e){
|
||
return confirmDelete(_("Are you sure you want to delete this key?"));
|
||
});
|
||
});
|
||
</script>
|
||
[% END %]
|
||
|
||
[% INCLUDE 'intranet-bottom.inc' %]
|