Bug 6440: Implement OAI-PMH Sets
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / oai_sets.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Admin &rsaquo; OAI Sets</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5 //<![CDATA[
6 function newDescField() {
7     $("#descriptionlist").append(
8         '<li>' +
9         '<textarea style="vertical-align:middle" name="description"></textarea>' +
10         '<a style="cursor:pointer" onclick="delDescField(this)">&nbsp;&times;</a>' +
11         '</li>'
12     );
13 }
14
15 function delDescField(minusButton) {
16     var li = $(minusButton).parent('li');
17     $(li).remove();
18 }
19
20 $(document).ready(function() {
21     // Some JS
22 });
23 //]]>
24 </script>
25 </head>
26
27 <body>
28 [% INCLUDE 'header.inc' %]
29 [% INCLUDE 'cat-search.inc' %]
30
31 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Admin</a> &rsaquo; OAI Sets</div>
32
33 <div id="doc3" class="yui-t2">
34
35 <div id="bd">
36   <div id="yui-main">
37     <div class="yui-b">
38       <h1>OAI Sets Configuration</h1>
39
40         [% IF op_new %]
41             <h2>Add a new set</h2>
42             <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
43                 <input type="hidden" name="op" value="savenew" />
44                 <fieldset>
45                     <label for="spec">setSpec</label>
46                     <input type="text" id="spec" name="spec" />
47                     <br />
48                     <label for="name">setName</label>
49                     <input type="text" id="name" name="name" />
50                     <br />
51                     <label>setDescriptions</label>
52                     <ul id="descriptionlist">
53                     </ul>
54                     <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
55                 </fieldset>
56                 <input type="submit" value="Save" />
57                 <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
58             </form>
59         [% ELSE %][% IF op_mod %]
60             <h2>Modify set '[% spec %]'</h2>
61             <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
62                 <input type="hidden" name="op" value="savemod" />
63                 <input type="hidden" name="id" value="[% id %]" />
64                 <fieldset>
65                     <label for="spec">setSpec</label>
66                     <input type="text" id="spec" name="spec" value="[% spec %]" />
67                     <br />
68                     <label for="name">setName</label>
69                     <input type="text" id="name" name="name" value="[% name %]" />
70                     <br />
71                     <label>setDescriptions</label>
72                     <ul id="descriptionlist">
73                         [% FOREACH desc IN descriptions %]
74                             <li>
75                                 <textarea style="vertical-align:middle" name="description">[% desc.description %]</textarea>
76                                 <a style="cursor:pointer" onclick="delDescField(this)">&nbsp;&times;</a>
77                             </li>
78                         [% END %]
79                     </ul>
80                     <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
81                 </fieldset>
82                 <input type="submit" value="Save" />
83                 <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
84             </form>
85         [% END %]
86         [% END %]
87
88         <h2>List of sets</h2>
89         [% UNLESS ( op_new ) %]
90             <a href="/cgi-bin/koha/admin/oai_sets.pl?op=new">Add a new set</a>
91         [% END %]
92         [% IF sets_loop %]
93             <table>
94                 <thead>
95                     <tr>
96                         <th>setSpec</th>
97                         <th>setName</th>
98                         <th>setDescriptions</th>
99                         <th>Action</th>
100                     </tr>
101                 </thead>
102                 <tbody>
103                     [% FOREACH set IN sets_loop %]
104                         <tr>
105                             <td>[% set.spec %]</td>
106                             <td>[% set.name %]</td>
107                             <td>
108                                 [% IF set.descriptions %]
109                                     <ul>
110                                         [% FOREACH desc IN set.descriptions %]
111                                             <li>[% desc.description %]</li>
112                                         [% END %]
113                                     </ul>
114                                 [% ELSE %]
115                                     <em>No descriptions</em>
116                                 [% END %]
117                             </td>
118                             <td>
119                                 <a href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&id=[% set.id %]">Modify</a>
120                                 |
121                                 <a href="/cgi-bin/koha/admin/oai_sets.pl?op=del&id=[% set.id %]">Delete</a>
122                                 |
123                                 <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id %]">Define mappings</a>
124                             </td>
125                         </tr>
126                     [% END %]
127                 </tbody>
128             </table>
129         [% ELSE %]
130             <p>There is no set defined.</p>
131         [% END %]
132
133
134     </div>
135   </div>
136   <div class="yui-b">
137     [% INCLUDE 'admin-menu.inc' %]
138   </div>
139 </div>
140 [% INCLUDE 'intranet-bottom.inc' %]