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