Bug 8935 - transport cost matrix could be prettier

Correcting the template so that it follows established
interface patterns and coding guidelines:

- Form contents in a fieldset
- Submit button in a fieldset with class "action" and
  with a "Cancel" link.
- Errors displayed in a <div class="dialog alert">
  (no custom error classes necessary).
- Valid markup.
- No JavaScript errors (to that end, the patch removes a
  call to a non-existent function, show_transport_cost_matrix)

http://bugs.koha-community.org/show_bug.cgi?id=8936
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
still works as expected and is much more visually appealing.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Owen Leonard 2012-10-17 12:35:28 -04:00 committed by Paul Poulain
parent 492dd7dc7f
commit af68717016

View file

@ -38,18 +38,11 @@ function form_submit (f) {
$(f).find('input:disabled').removeAttr("disabled");
return true;
}
$(document).ready(function() {
show_transport_cost_matrix([% IF UseTransportCostMatrix %]true[% ELSE %]false[% END %]);
});
//]]>
</script>
<style type="text/css">
.disabled-transfer {
background-color: red;
}
.errors {
color: red;
background-color: #FF8888;
}
</style>
@ -69,30 +62,34 @@ $(document).ready(function() {
Defining transport costs between libraries
</h1>
[% IF ( WARNING_transport_cost_matrix_off ) %]
<div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, Transport Cost Matrix is not being used. Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
<div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, the transport cost matrix is not being used. Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
[% END %]
<div class="container">
<form method="post" action="?" onSubmit="return form_submit(this);">
[% IF ( errors ) %]<div class="dialog alert">
<h4>There were problems with your submission</h4>
<ul>
[% FOR e IN errors %]
<li>[% e %]</li>
[% END %]
</ul>
</div>[% END %]
<form method="post" action="?" onsubmit="return form_submit(this);">
<input type="hidden" name="op" value="set-cost-matrix" />
<div id="transport-cost-matrix">
<fieldset id="transport-cost-matrix">
<div class="help">
<p>Costs are decimal values between some arbitrary maximum value (e.g. 1 or 100) and 0 which is the minimum (no) cost.</p>
<p>Red cells signify no transfer allowed.</p>
<p>Click on individual cells to edit.</p>
</div>
<ul class="errors" %]>
[% FOR e IN errors %]
<li>[% e %]</li>
[% END %]
</ul>
<table>
<tr>
<th>From \ To</th>
[% FOR b IN branchloop %]
<th>[% b.name %]</th>
[% END %]
<tr>
</tr>
[% FOR bf IN branchfromloop %]
<tr>
<th>[% bf.name %]</th>
@ -118,12 +115,13 @@ $(document).ready(function() {
</tr>
[% END %]
</table>
</div>
<input type="submit" value="Save" class="submit" />
</fieldset>
<fieldset class="action">
<input type="submit" value="Save" class="submit" /> <a href="/cgi-bin/koha/admin/transport-cost-matrix.pl" class="cancel">Cancel</a>
</fieldset>
</form>
</div>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'admin-menu.inc' %]
</div>