Bug 13618: Add html filters to all the variables
[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>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>
8
9 <body id="admin_oai_sets" class="admin">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
12
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>
14
15 <div id="doc3" class="yui-t2">
16
17 <div id="bd">
18   <div id="yui-main">
19     <div class="yui-b">
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>
50
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 %]
58
59         <div id="toolbar" class="btn-toolbar">
60             <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>
61         </div>
62
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="dropdown">
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 | html %]"><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 | html %]"><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 %]
109
110     </div>
111   </div>
112   <div class="yui-b">
113     [% INCLUDE 'admin-menu.inc' %]
114   </div>
115 </div>
116
117 [% MACRO jsinclude BLOCK %]
118     [% Asset.js("js/admin-menu.js") | $raw %]
119     <script type="text/javascript">
120         function newDescField() {
121             $("#adddescription").before(
122                 '<li><label>' + _("setDescription: ") + '</label>' +
123                 '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
124                 '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i>' + _(" Remove") + '</a>' +
125                 '</li>'
126             );
127         }
128
129         function delDescField(minusButton) {
130             var li = minusButton.parent('li');
131             $(li).remove();
132         }
133
134         function confirmDelete() {
135           return confirm(_("Are you sure you want to delete this OAI set?"));
136         }
137
138         $(document).ready(function() {
139             $(".delete_oai_set").on("click",function(){
140                 return confirmDelete();
141             });
142
143             $("body").on("click", ".remove_description", function(e){
144                 e.preventDefault();
145                 delDescField($(this));
146             });
147
148             $(".add_description").on("click", function(e){
149                 e.preventDefault();
150                 newDescField();
151             });
152
153         });
154     </script>
155 [% END %]
156 [% INCLUDE 'intranet-bottom.inc' %]