Bug 24786: (QA follow-up) String fix
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / oai_sets.tt
blob943d7aac81d0c3d601184aba15cbaf7c50b7dfc3
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; [% IF ( op_new ) %]OAI sets configuration &rsaquo; Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
9 <body id="admin_oai_sets" class="admin">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( op_new ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Add a new OAI set[% ELSIF ( op_mod ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Edit OAI set '[% spec | html %]'[% ELSE %] OAI sets configuration[% END %]</div>
15 <div class="main container-fluid">
16     <div class="row">
17         <div class="col-sm-10 col-sm-push-2">
18             <main>
20         [% IF ( op_new || op_mod ) %]
21             <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl" class="validated">
22             [% IF ( op_new ) %]
23                 <h2>Add a new OAI set</h2>
24                 <input type="hidden" name="op" value="savenew" />
25             [% ELSIF ( op_mod ) %]
26                 <h2>Edit OAI set '[% spec | html %]'</h2>
27                     <input type="hidden" name="op" value="savemod" />
28                     <input type="hidden" name="id" value="[% id | html %]" />
29             [% END %]
30                 <fieldset id="oaidetails" class="rows">
31                     <ol>
32                         <li>
33                             <label for="spec" class="required">setSpec: </label>
34                             <input type="text" id="spec" name="spec" value="[% spec | html %]" required="required" class="required" />
35                             <span class="required">Required</span>
36                         </li>
37                         <li>
38                             <label for="name" class="required">setName: </label>
39                             <input type="text" id="name" name="name" value="[% name | html %]" required="required" class="required" />
40                             <span class="required">Required</span>
41                         </li>
42                         [% FOREACH desc IN descriptions %]
43                             <li>
44                                 <label>setDescription: </label>
45                                 <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description | html %]</textarea>
46                                 <a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>
47                             </li>
48                         [% END %]
49                         <li id="adddescription"><span class="label">&nbsp;</span><a href="#" class="add_description"><i class="fa fa-fw fa-plus"></i> Add description</a></li>
51                     </ol>
52                 </fieldset>
53                 <fieldset class="action">
54                     <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
55                 </fieldset>
56             </form>
57         [% ELSE %]
59         <div id="toolbar" class="btn-toolbar">
60             <a class="btn btn-default" id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new"><i class="fa fa-plus"></i> New set</a>
61         </div>
63         <h2>OAI sets</h2>
64         [% IF sets_loop %]
65             <table>
66                 <thead>
67                     <tr>
68                         <th>setSpec</th>
69                         <th>setName</th>
70                         <th>setDescriptions</th>
71                         <th>&nbsp;</th>
72                     </tr>
73                 </thead>
74                 <tbody>
75                     [% FOREACH set IN sets_loop %]
76                         <tr>
77                             <td>[% set.spec | html %]</td>
78                             <td>[% set.name | html %]</td>
79                             <td>
80                                 [% IF set.descriptions %]
81                                     <ul>
82                                         [% FOREACH desc IN set.descriptions %]
83                                             <li>[% desc.description | html %]</li>
84                                         [% END %]
85                                     </ul>
86                                 [% ELSE %]
87                                     <em>No descriptions</em>
88                                 [% END %]
89                             </td>
90                             <td>
91                               <div class="btn-group dropup">
92                                 <a class="btn btn-default btn-xs dropdown-toggle" id="oaisetsactions[% set.id | html %]" role="button" data-toggle="dropdown" href="#">
93                                   Actions <b class="caret"></b></a>
94                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="oaisetsactions[% set.id | html %]">
95                                   <li><a href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&amp;id=[% set.id | uri %]"><i class="fa fa-fw fa-pencil"></i> Edit</a></li>
96                                   <li><a class="delete_oai_set" href="/cgi-bin/koha/admin/oai_sets.pl?op=del&amp;id=[% set.id | html %]"><i class="fa fa-fw fa-trash"></i> Delete</a></li>
97                                   <li><a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id | uri %]"><i class="fa fa-fw fa-info"></i> Define mappings</a></li>
98                                 </ul>
99                               </div>
100                             </td>
101                         </tr>
102                     [% END %]
103                 </tbody>
104             </table>
105         [% ELSE %]
106             <div class="dialog message"><p>There are no sets defined.</p></div>
107         [% END %]
108         [% END %]
110             </main>
111         </div> <!-- /.col-sm-10.col-sm-push-2 -->
113         <div class="col-sm-2 col-sm-pull-10">
114             <aside>
115                 [% INCLUDE 'admin-menu.inc' %]
116             </aside>
117         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
118      </div> <!-- /.row -->
120 [% MACRO jsinclude BLOCK %]
121     [% Asset.js("js/admin-menu.js") | $raw %]
122     <script>
123         function newDescField() {
124             $("#adddescription").before(
125                 '<li><label>' + _("setDescription: ") + '</label>' +
126                 '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
127                 '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i>' + _(" Remove") + '</a>' +
128                 '</li>'
129             );
130         }
132         function delDescField(minusButton) {
133             var li = minusButton.parent('li');
134             $(li).remove();
135         }
137         function confirmDelete() {
138           return confirm(_("Are you sure you want to delete this OAI set?"));
139         }
141         $(document).ready(function() {
142             $(".delete_oai_set").on("click",function(){
143                 return confirmDelete();
144             });
146             $("body").on("click", ".remove_description", function(e){
147                 e.preventDefault();
148                 delDescField($(this));
149             });
151             $(".add_description").on("click", function(e){
152                 e.preventDefault();
153                 newDescField();
154             });
156         });
157     </script>
158 [% END %]
159 [% INCLUDE 'intranet-bottom.inc' %]