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