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