Bug 21578: Terminology changes in patron's account section (staff)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / apikeys.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Patrons &rsaquo; API Keys</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9 <body id="pat_apikeys" class="pat">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'patron-search.inc' %]
12
13 <div id="breadcrumbs">
14     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
15     &rsaquo;
16     <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
17     &rsaquo;
18     API Keys for [% INCLUDE 'patron-title.inc' %]
19 </div>
20
21 <div id="doc3" class="yui-t2">
22     <div id="bd">
23         <div id="yui-main">
24             <div class="yui-b">
25                 [% INCLUDE 'members-toolbar.inc' %]
26
27                 <h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
28                 <form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
29                     <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
30                     <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
31                     <input type="hidden" name="op" value="generate" />
32                     <fieldset class="brief">
33                         <legend>Generate new client id/secret pair</legend>
34                         <ol>
35                             <li>
36                                 <label for="description">Description: </label>
37                                 <input type="text" name="description" />
38                                 <input type="submit" value="Save" />
39                                 <a href="#" class="cancel toggle_element" data-element="#add-api-key">Cancel</a>
40                             </li>
41                         </ol>
42                     </fieldset>
43                 </form>
44
45                 <div id="keys">
46                     [% IF api_keys && api_keys.size > 0 %]
47                         <p>
48                             <button class="btn btn-default btn-xs 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>
49                         </p>
50                         <table>
51                             <thead>
52                                 <tr>
53                                     <th>Description</th>
54                                     <th>Client ID</th>
55                                     <th>Secret</th>
56                                     <th>Active</th>
57                                     <th>Actions</th>
58                                 </tr>
59                             </thead>
60                             <tbody>
61                                 [% FOREACH key IN api_keys %]
62                                     <tr>
63                                         <td>[% key.description | html %]</td>
64                                         <td>[% key.client_id | html %]</td>
65                                         <td>[% key.secret | html %]</td>
66                                         <td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
67                                         <td>
68                                             <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
69                                                 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
70                                                 <input type="hidden" name="key" value="[% key.id | html %]" />
71                                                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
72                                                 <input type="hidden" name="op" value="delete" />
73                                                 <button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash"></i> Delete</button>
74                                             </form>
75                                             <form action="/cgi-bin/koha/members/apikeys.pl" method="post">
76                                                 <input type="hidden" name="patron_id" value="[% patron.id | html %]" />
77                                                 <input type="hidden" name="key" value="[% key.id | html %]" />
78                                                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
79                                                 [% IF key.active %]
80                                                     <input type="hidden" name="op" value="revoke" />
81                                                     <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-remove"></i> Revoke</button>
82                                                 [% ELSE %]
83                                                     <input type="hidden" name="op" value="activate" />
84                                                     <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-play"></i> Activate</button>
85                                                 [% END %]
86                                             </form>
87                                         </td>
88                                     </tr>
89                                 [% END %]
90                             </tbody>
91                         </table>
92                     [% ELSE %]
93                         <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>
94                     [% END %]
95                 </div>
96             </div>
97         </div>
98         <div class="yui-b">
99             [% INCLUDE 'circ-menu.inc' %]
100         </div>
101     </div>
102
103 [% MACRO jsinclude BLOCK %]
104     [% INCLUDE 'str/members-menu.inc' %]
105     [% Asset.js("js/members-menu.js") | $raw %]
106     <script>
107         $(document).ready(function(){
108             $(".delete").on("click", function(e){
109                 return confirmDelete(_("Are you sure you want to delete this key?"));
110             });
111         });
112     </script>
113 [% END %]
114
115 [% INCLUDE 'intranet-bottom.inc' %]