Bug 28704: Library MARCOrgCode field needs maxlength attribute
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / oai_sets.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>
6     [% IF ( op_new ) %]
7          Add a new OAI set &rsaquo; [% END %]
8     OAI sets configuration &rsaquo; Administration &rsaquo; Koha
9 </title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="admin_oai_sets" class="admin">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'prefs-admin-search.inc' %]
16
17 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18     <ol>
19         <li>
20             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21         </li>
22         <li>
23             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
24         </li>
25
26         [% IF ( op_new ) %]
27             <li>
28                 <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a>
29             </li>
30             <li>
31                 <a href="#" aria-current="page">
32                     Add a new OAI set
33                 </a>
34             </li>
35
36         [% ELSIF ( op_mod ) %]
37             <li>
38                 <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a>
39             </li>
40             <li>
41                 <a href="#" aria-current="page">
42                     Edit OAI set '[% spec | html %]'
43                 </a>
44             </li>
45
46         [% ELSE %]
47             <li>
48                 <a href="#" aria-current="page">
49                     OAI sets configuration
50                 </a>
51             </li>
52         [% END %]
53     </ol>
54 </nav>
55
56 <div class="main container-fluid">
57     <div class="row">
58         <div class="col-sm-10 col-sm-push-2">
59             <main>
60
61         [% IF ( op_new || op_mod ) %]
62             <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl" class="validated">
63             [% IF ( op_new ) %]
64                 <h2>Add a new OAI set</h2>
65                 <input type="hidden" name="op" value="savenew" />
66             [% ELSIF ( op_mod ) %]
67                 <h2>Edit OAI set '[% spec | html %]'</h2>
68                     <input type="hidden" name="op" value="savemod" />
69                     <input type="hidden" name="id" value="[% id | html %]" />
70             [% END %]
71                 <fieldset id="oaidetails" class="rows">
72                     <ol>
73                         <li>
74                             <label for="spec" class="required">setSpec: </label>
75                             <input type="text" id="spec" name="spec" value="[% spec | html %]" required="required" class="required" />
76                             <span class="required">Required</span>
77                         </li>
78                         <li>
79                             <label for="name" class="required">setName: </label>
80                             <input type="text" id="name" name="name" value="[% name | html %]" required="required" class="required" />
81                             <span class="required">Required</span>
82                         </li>
83                         [% FOREACH desc IN descriptions %]
84                             <li>
85                                 <label>setDescription: </label>
86                                 <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description | html %]</textarea>
87                                 <a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>
88                             </li>
89                         [% END %]
90                         <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>
91
92                     </ol>
93                 </fieldset>
94                 <fieldset class="action">
95                     <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
96                 </fieldset>
97             </form>
98         [% ELSE %]
99
100         <div id="toolbar" class="btn-toolbar">
101             <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>
102         </div>
103
104         <h2>OAI sets</h2>
105         [% IF sets_loop %]
106             <table>
107                 <thead>
108                     <tr>
109                         <th>setSpec</th>
110                         <th>setName</th>
111                         <th>setDescriptions</th>
112                         <th>&nbsp;</th>
113                     </tr>
114                 </thead>
115                 <tbody>
116                     [% FOREACH set IN sets_loop %]
117                         <tr>
118                             <td>[% set.spec | html %]</td>
119                             <td>[% set.name | html %]</td>
120                             <td>
121                                 [% IF set.descriptions %]
122                                     <ul>
123                                         [% FOREACH desc IN set.descriptions %]
124                                             <li>[% desc.description | html %]</li>
125                                         [% END %]
126                                     </ul>
127                                 [% ELSE %]
128                                     <em>No descriptions</em>
129                                 [% END %]
130                             </td>
131                             <td>
132                               <div class="btn-group dropup">
133                                 <a class="btn btn-default btn-xs dropdown-toggle" id="oaisetsactions[% set.id | html %]" role="button" data-toggle="dropdown" href="#">
134                                   Actions <b class="caret"></b></a>
135                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="oaisetsactions[% set.id | html %]">
136                                   <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>
137                                   <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>
138                                   <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>
139                                 </ul>
140                               </div>
141                             </td>
142                         </tr>
143                     [% END %]
144                 </tbody>
145             </table>
146         [% ELSE %]
147             <div class="dialog message"><p>There are no sets defined.</p></div>
148         [% END %]
149         [% END %]
150
151             </main>
152         </div> <!-- /.col-sm-10.col-sm-push-2 -->
153
154         <div class="col-sm-2 col-sm-pull-10">
155             <aside>
156                 [% INCLUDE 'admin-menu.inc' %]
157             </aside>
158         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
159      </div> <!-- /.row -->
160
161 [% MACRO jsinclude BLOCK %]
162     [% Asset.js("js/admin-menu.js") | $raw %]
163     <script>
164         function newDescField() {
165             $("#adddescription").before(
166                 '<li><label>' + _("setDescription: ") + '</label>' +
167                 '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
168                 '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i>' + _(" Remove") + '</a>' +
169                 '</li>'
170             );
171         }
172
173         function delDescField(minusButton) {
174             var li = minusButton.parent('li');
175             $(li).remove();
176         }
177
178         function confirmDelete() {
179           return confirm(_("Are you sure you want to delete this OAI set?"));
180         }
181
182         $(document).ready(function() {
183             $(".delete_oai_set").on("click",function(){
184                 return confirmDelete();
185             });
186
187             $("body").on("click", ".remove_description", function(e){
188                 e.preventDefault();
189                 delDescField($(this));
190             });
191
192             $(".add_description").on("click", function(e){
193                 e.preventDefault();
194                 newDescField();
195             });
196
197         });
198     </script>
199 [% END %]
200 [% INCLUDE 'intranet-bottom.inc' %]