[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Admin › OAI sets</title>
+<title>Koha › Administration › [% IF ( op_new ) %]OAI sets configuration › Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
function newDescField() {
- $("#descriptionlist").append(
- '<li>' +
- '<textarea style="vertical-align:middle" name="description"></textarea>' +
- '<a style="cursor:pointer" onclick="delDescField(this)"> ×</a>' +
+ $("#adddescription").before(
+ '<li><label>setDescription: </label>' +
+ '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
+ '<a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>' +
'</li>'
);
}
$(li).remove();
}
+function confirmDelete() {
+ return confirm(_("Are you sure you want to delete this OAI set?"));
+}
+
$(document).ready(function() {
- // Some JS
+ $(".delete_oai_set").on("click",function(){
+ return confirmDelete();
+ });
});
//]]>
</script>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Admin</a> › OAI sets</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( op_new ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> › Add a new OAI set[% ELSIF ( op_mod ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> › Modify OAI set '[% spec %]'[% ELSE %] OAI sets configuration[% END %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
- <h1>OAI sets configuration</h1>
-
- [% IF op_new %]
- <h2>Add a new set</h2>
- <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
+ [% IF ( op_new || op_mod ) %]
+ <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl" class="validated">
+ [% IF ( op_new ) %]
+ <h2>Add a new OAI set</h2>
<input type="hidden" name="op" value="savenew" />
- <fieldset>
- <label for="spec">setSpec</label>
- <input type="text" id="spec" name="spec" />
- <br />
- <label for="name">setName</label>
- <input type="text" id="name" name="name" />
- <br />
- <label>setDescriptions</label>
- <ul id="descriptionlist">
- </ul>
- <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
- </fieldset>
- <input type="submit" value="Save" />
- <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
- </form>
- [% ELSE %][% IF op_mod %]
- <h2>Modify set '[% spec %]'</h2>
- <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
- <input type="hidden" name="op" value="savemod" />
- <input type="hidden" name="id" value="[% id %]" />
- <fieldset>
- <label for="spec">setSpec</label>
- <input type="text" id="spec" name="spec" value="[% spec %]" />
- <br />
- <label for="name">setName</label>
- <input type="text" id="name" name="name" value="[% name %]" />
- <br />
- <label>setDescriptions</label>
- <ul id="descriptionlist">
+ [% ELSIF ( op_mod ) %]
+ <h2>Modify OAI set '[% spec %]'</h2>
+ <input type="hidden" name="op" value="savemod" />
+ <input type="hidden" name="id" value="[% id %]" />
+ [% END %]
+ <fieldset id="oaidetails" class="rows">
+ <ol>
+ <li>
+ <label for="spec" class="required">setSpec: </label>
+ <input type="text" id="spec" name="spec" value="[% spec %]" required="required" class="required" />
+ <span class="required">Required</span>
+ </li>
+ <li>
+ <label for="name" class="required">setName: </label>
+ <input type="text" id="name" name="name" value="[% name %]" required="required" class="required" />
+ <span class="required">Required</span>
+ </li>
[% FOREACH desc IN descriptions %]
<li>
- <textarea style="vertical-align:middle" name="description">[% desc.description %]</textarea>
- <a style="cursor:pointer" onclick="delDescField(this)"> ×</a>
+ <label>setDescription: </label>
+ <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description %]</textarea>
+ <a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>
</li>
[% END %]
- </ul>
- <a style="cursor:pointer" onclick='newDescField()'>Add description</a>
+ <li id="adddescription"><span class="label"> </span><a class="clone-field" href="#" onclick='newDescField(); return false;'>Add description</a></li>
+
+ </ol>
+ </fieldset>
+ <fieldset class="action">
+ <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
</fieldset>
- <input type="submit" value="Save" />
- <input type="button" value="Cancel" onclick="window.location.href = '/cgi-bin/koha/admin/oai_sets.pl'" />
</form>
- [% END %]
- [% END %]
+ [% ELSE %]
- <h2>List of sets</h2>
- [% UNLESS ( op_new ) %]
- <a href="/cgi-bin/koha/admin/oai_sets.pl?op=new">Add a new set</a>
- [% END %]
+ <div id="toolbar" class="btn-toolbar">
+ <a class="btn btn-small" id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new"><i class="fa fa-plus"></i> New set</a>
+ </div>
+
+ <h2>OAI sets</h2>
[% IF sets_loop %]
<table>
<thead>
<th>setSpec</th>
<th>setName</th>
<th>setDescriptions</th>
- <th>Action</th>
+ <th> </th>
</tr>
</thead>
<tbody>
[% END %]
</td>
<td>
- <a href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&id=[% set.id %]">Modify</a>
- |
- <a href="/cgi-bin/koha/admin/oai_sets.pl?op=del&id=[% set.id %]">Delete</a>
- |
- <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id %]">Define mappings</a>
+ <div class="dropdown">
+ <a class="btn btn-mini dropdown-toggle" id="oaisetsactions[% set.id %]" role="button" data-toggle="dropdown" href="#">
+ Actions <b class="caret"></b></a>
+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="oaisetsactions[% set.id %]">
+ <li><a href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&id=[% set.id %]"><i class="fa fa-pencil"></i> Modify</a></li>
+ <li><a class="delete_oai_set" href="/cgi-bin/koha/admin/oai_sets.pl?op=del&id=[% set.id %]"><i class="fa fa-trash"></i> Delete</a></li>
+ <li><a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id %]"><i class="fa fa-info"></i> Define mappings</a></li>
+ </ul>
+ </div>
</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
- <p>There is no set defined.</p>
+ <div class="dialog message"><p>There are no sets defined.</p></div>
+ [% END %]
[% END %]
-
</div>
</div>