[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Admin › OAI set mappings</title>
+<title>Koha › Administration › OAI sets › OAI set mappings</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
- // Some JS
+ $("#mappingform").submit(function(){
+ hideDialogBox();
+ });
+ $("#ORbutton").live("click", function(){
+ newCondition();
+ return false;
+ });
+ $(".clear-field").live("click",function(e){
+ clearRow(e.target);
+ });
});
function newCondition() {
$("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
$(tr).parent('tbody').append(clone);
}
-
+function clearRow(link){
+ var tr = $(link).parent().parent();
+ var found = tr.find('#ORbutton');
+ if( found.length ){
+ tr.find('input[type="text"]').attr("value","");
+ } else {
+ tr.find('input[type="text"]').attr("value","").end().hide();
+ }
+}
function hideDialogBox() {
$('div.dialog').remove();
}
-
-function returnToSetsPage() {
- window.location.href = "/cgi-bin/koha/admin/oai_sets.pl";
-}
//]]>
</script>
</head>
[% 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> › <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets</a> › <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
<div id="doc3" class="yui-t2">
<div id="yui-main">
<div class="yui-b">
[% IF ( mappings_saved ) %]
- <div class="dialog">
- <p>Mappings have been saved</p>
+ <div class="dialog message">
+ <h4>Mappings have been saved</h4>
<p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
</div>
[% END %]
<h1>Mappings for set '[% setName %]' ([% setSpec %])</h1>
[% UNLESS ( mappings ) %]
- <p class="warning">Warning: no mappings defined for this set</p>
+ <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
[% END %]
- <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" onsubmit="hideDialogBox();">
+ <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
<table id="mappings">
<thead>
<tr>
<th> </th>
<th>Value</th>
<th> </th>
+ <th> </th>
</tr>
</thead>
<tbody>
<td><input type="text" name="marcvalue" value="[% mapping.marcvalue %]" /></td>
<td style="text-align:center">
[% IF ( loop.last ) %]
- <input type="button" id="ORbutton" value="OR" onclick="newCondition()"/>
+ <input type="button" id="ORbutton" value="OR" title="Add another condition" />
[% ELSE %]
OR
[% END %]
</td>
+ <td><a class="clear-field" href="#">Clear</a></td>
</tr>
[% END %]
[% ELSE %]
<td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
<td>is equal to</td>
<td><input type="text" name="marcvalue" /></td>
- <td><input type="button" id="ORbutton" value="OR" onclick="newCondition()"/></td>
+ <td><input type="button" id="ORbutton" value="OR" /></td>
+ <td><a class="clear-field" href="#">Clear</a></td>
</tr>
[% END %]
</tbody>
</table>
- <p class="hint">Hint: to delete a line, empty at least one of the text fields in this line</p>
<input type="hidden" name="id" value="[% id %]" />
<input type="hidden" name="op" value="save" />
<fieldset class="action">
- <input type="submit" value="Save" />
- <input type="button" value="Cancel" onclick="returnToSetsPage();" />
+ <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
</fieldset>
</form>
[% 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>'
);
}
}
$(document).ready(function() {
- // Some JS
+ new YAHOO.widget.Button("newoaiset");
});
//]]>
</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="http://localhost:8888/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> › Add a new OAI set[% ELSIF ( op_mod ) %]<a href="http://localhost:8888/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>
+ [% IF ( op_new || op_mod ) %]
<form method="post" action="/cgi-bin/koha/admin/oai_sets.pl">
+ [% 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 %]" />
+ </li>
+ <li>
+ <label for="name" class="required">setName: </label>
+ <input type="text" id="name" name="name" value="[% name %]" />
+ </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">
+ <ul class="toolbar">
+ <li><a id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new">New set</a></li>
+ </ul></div>
+
+ <h2>OAI sets</h2>
[% IF sets_loop %]
<table>
<thead>
</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>