Improving the formatting of the "add to shelf" pop-up. Changing the way the list of existing shelves is passed to the template so that the "existing shelves" option can be hidden if there are no existing shelves.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Owen Leonard 2007-10-29 13:54:08 -05:00 committed by Joshua Ferraro
parent 86d64812f2
commit be09e12860
2 changed files with 24 additions and 19 deletions

View file

@ -2,7 +2,7 @@
<title>Koha &rsaquo; Add to Virtual Shelf</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<style type="text/css">
#custom-doc { width:38.46em;*width:37.53em;min-width:500px; margin: auto; text-align:left; }
#custom-doc { width:34.62em;*width:33.78em;min-width:450px; margin:auto; margin-top: .4em;text-align:left; }
</style>
</head>
<body>
@ -11,42 +11,44 @@
<div id="bd">
<h1>Add
<h3>Add
<i><!-- TMPL_VAR NAME="title" --></i>
<!-- TMPL_IF NAME="author" -->
by <!-- TMPL_VAR NAME="author" -->
<!-- /TMPL_IF --> to a virtual shelf
</h1>
</h3>
<form name="f1" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<!-- TMPL_IF NAME="CGIvirtualshelves" --><form name="f1" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<b>Select an existing shelf</b>
<p>
<label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIvirtualshelves" -->
</p>
<fieldset class="rows">
<legend>Select an existing shelf</legend>
<ol>
<li><label>Choose shelf</label><!-- TMPL_VAR NAME="CGIvirtualshelves" --></li>
</ol>
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="submit" value="Add to virtual shelf" class="submit" />
<fieldset class="action"><input type="submit" value="Save" class="submit" /></fieldset>
</fieldset>
</form>
<p>...or...</p>
<h4>...or...</h4><!-- /TMPL_IF -->
<form name="f2" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<b>Add to a new shelf:</b>
<p>
<fieldset class="rows"><legend>Add to a new shelf:</legend>
<ol><li>
<label for="newvirtualshelf">
Shelf name:
</label>
<input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
</p>
<p>
</li>
<li>
<label for="category">Category:</label>
<select name="category" id="category">
<option value="1">Private</option>
<option value="2">Public</option>
<option value="3">Free</option>
</select>
</p>
<input type="submit" value="Add to virtual shelf" class="submit" />
</li></ol>
<fieldset class="action"><input type="submit" value="Save" class="submit" /></fieldset> </fieldset>
</form>
</div>

View file

@ -100,7 +100,7 @@ else { # this shelf doesn't already exist.
push( @shelvesloop, $element );
$shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
}
if(@shelvesloop gt 0){
my $CGIvirtualshelves = CGI::scrolling_list(
-name => 'shelfnumber',
-values => \@shelvesloop,
@ -109,12 +109,15 @@ else { # this shelf doesn't already exist.
-tabindex => '',
-multiple => 0
);
$template->param(
CGIvirtualshelves => $CGIvirtualshelves,
);
}
$template->param(
biblionumber => $biblionumber,
title => $biblios[0]->{'title'},
author => $biblios[0]->{'author'},
CGIvirtualshelves => $CGIvirtualshelves,
);
output_html_with_http_headers $query, $cookie, $template->output;