Index: trunk/gsdl/bin/script/build
===================================================================
--- trunk/gsdl/bin/script/build	(revision 1506)
+++ trunk/gsdl/bin/script/build	(revision 1507)
@@ -130,4 +130,8 @@
 	
 	foreach $download_dir (@download) {
+
+	    # remove any leading or trailing whitespace from filenames (just in case)
+	    $download_dir =~ s/^\s+//;
+	    $download_dir =~ s/\s+$//;
 	    
 	    if ($download_dir =~ /^http:\/\//) {
@@ -141,4 +145,5 @@
 		# is a file or directory on the local file system.
 		$download_dir =~ s/^file:(\/\/)?//;
+		$download_dir =~ s/^\s+//; # may be whitespace between "file://" and the rest
 		
 		if (-e $download_dir) {
@@ -152,5 +157,5 @@
 		    &append_file ($out, "$outfile.download");
 		} else {
-		    print $out "WARNING: $download_dir does not exist\n";
+		    print $out "WARNING: '$download_dir' does not exist\n";
 		}
 	    }
@@ -184,7 +189,5 @@
 	} else {
 	    # no import or archives
-	    print $out "build: ERROR: The $collection collection has no import\n";
-	    print $out "       or archives data. Try downloading an unbuilt version\n";
-	    print $out "       of the collection from www.nzdl.org\n";
+	    print $out "build: ERROR: The $collection collection has no import or archives data.\n";
 	    &final_out (1) if $use_out;
 	    die "\n";
Index: trunk/gsdl/macros/collect.dm
===================================================================
--- trunk/gsdl/macros/collect.dm	(revision 1506)
+++ trunk/gsdl/macros/collect.dm	(revision 1507)
@@ -9,7 +9,7 @@
 # this is just like the _gsimage_ macro but it calls the check_submit() javascript
 # function instead of linking directly to the page (_1_ argument isn't used)
-_gsjimage_ {<a href="javascript:check\_submit('_4_');" onMouseover="roll('_4_',1);" onMouseOut="roll('_4_',0);"><img
+_gsjimage_ {<a href="javascript:check\_submit('_4_');" onMouseover="roll('_4_',1);" onMouseOut="roll('_4_',0);" target=_top><img
 name="_4_" src="_2_" onLoad="gbutton(this,'_3_');" border=0 alt="_5_"></a>}
-_gsjimage_ [v=1] {<a href="javascript:check\_submit('_4_');">_5_</a><br>}
+_gsjimage_ [v=1] {<a href="javascript:check\_submit('_4_');" target=_top>_5_</a><br>}
 
 # _gstimage_ is also similar to _gsimage_ but is used where buttons occur in a sub-frame and
@@ -546,11 +546,11 @@
 
 <h4>Input source:</h4>
-_typeselect_(1,file)<input type=text name="bc1inputdir1" value="_cgiargbc1inputdir1_" size=60>
+<nobr>_typeselect_(1,file)<input type=text name="bc1inputdir1" value="_cgiargbc1inputdir1_" size=60></nobr>
 <br>
-_typeselect_(2,http)<input type=text name="bc1inputdir2" value="_cgiargbc1inputdir2_" size=60>
+<nobr>_typeselect_(2,http)<input type=text name="bc1inputdir2" value="_cgiargbc1inputdir2_" size=60></nobr>
 <br>
-_typeselect_(3,ftp)<input type=text name="bc1inputdir3" value="_cgiargbc1inputdir3_" size=60>
+<nobr>_typeselect_(3,ftp)<input type=text name="bc1inputdir3" value="_cgiargbc1inputdir3_" size=60></nobr>
 <br>
-_typeselect_(4,file)<input type=text name="bc1inputdir4" value="_cgiargbc1inputdir4_" size=60>
+<nobr>_typeselect_(4,file)<input type=text name="bc1inputdir4" value="_cgiargbc1inputdir4_" size=60></nobr>
 <br>
 <font color="#909090">
@@ -675,5 +675,20 @@
 _bildcontent_ {
 <html>
-<frameset rows="*,150" border=0>
+<head>
+<script>
+<!--
+function check\_submit (gotopage) \{
+  var form = document.collectorform;
+  form.cp.value = gotopage;
+  form.submit();
+\}
+// -->
+</script>
+<form name="collectorform" method=post action="_gwcgi_">
+<input type=hidden name="e" value="_decodedcompressedoptions_">
+<input type=hidden name="cp" value="_cgiargcp_">
+</head>
+
+<frameset rows="*,160" border=0>
   <noframes><body bgcolor="#ffffff">
   <p>You must have a frame enabled browser to obtain feedback
@@ -702,4 +717,5 @@
 
 # header overridden to allow base target to be set
+# also no page banner to maximise what we can fit in the frame without scrolling
 _bildframe1header_ {_cgihead_
 <html>
@@ -711,5 +727,5 @@
 <body bgcolor="\#ffffff" text="\#000000" link="\#006666" 
       alink="\#cc9900" vlink="\#666633" background="_httpiconchalk_">
-_startspacer__pagebanner_
+_startspacer_
 }
 _bildframe1header_[v=1] {_cgihead_
@@ -722,13 +738,6 @@
 <body bgcolor="\#ffffff" text="\#000000" link="\#006666" 
       alink="\#cc9900" vlink="\#666633" background="_httpiconchalk_">
-_pagebanner_
-}
-_bildframe1scriptextra_ {
-function check\_submit (gotopage) \{
-  var form = document.collectorform;
-  form.cp.value = gotopage;
-  form.submit();
-\}
-}
+}
+_bildframe1scriptextra_ {}
 _bildframe1content_ {
 <form name="collectorform" method=post action="_gwcgi_">
@@ -781,4 +790,5 @@
 <input type=hidden name="e" value="_decodedcompressedoptions_">
 <input type=hidden name="cp" value="_cgiargcp_">
+</form>
 <center>
 <table width=_pagewidth_>
@@ -798,5 +808,4 @@
 </td></tr>
 </table></center>
-</form>
 }
 
@@ -854,6 +863,4 @@
 _bilddonescriptextra_ {}
 _bilddonecontent_ {
-<form name="collectorform" method=post action="_gwcgi_">
-<input type=hidden name="e" value="_decodedcompressedoptions_">
 <center>
 <table width=_pagewidth_>
@@ -867,5 +874,4 @@
 </td></tr>
 </table></center>
-</form>
 }
 
@@ -878,8 +884,16 @@
 _htmlhead_(background="_httpiconchalk_")_startspacer_
 }
-_bildfailscriptextra_ {}
+_bildfailscriptextra_ {
+function check\_submit (gotopage) \{
+  var form = document.collectorform;
+  form.cp.value = gotopage;
+  form.submit();
+\}
+}
 _bildfailcontent_ {
 <form name="collectorform" method=post action="_gwcgi_">
 <input type=hidden name="e" value="_decodedcompressedoptions_">
+<input type=hidden name="cp" value="_cgiargcp_">
+</form>
 <center>
 <table width=_pagewidth_>
@@ -888,7 +902,11 @@
 <br> The build log contains the following:
 <p>_faillog_
-</td></tr>
-</table></center>
-</form>
+
+<p><center>
+_collectorbar_
+</center>
+
+</td></tr>
+</table></center>
 }
 
Index: trunk/gsdl/src/recpt/collectoraction.cpp
===================================================================
--- trunk/gsdl/src/recpt/collectoraction.cpp	(revision 1506)
+++ trunk/gsdl/src/recpt/collectoraction.cpp	(revision 1507)
@@ -350,5 +350,5 @@
   }
   
-  if (current_page == "bildstatus") {
+  if (current_page == "bildstatus" || current_page == "bildcancel") {
     // if .final file exists then build has finished
     text_t fbld = filename_cat (gsdlhome, "tmp", args["bc1tmp"], args["bc1dirname"] + ".bld.final");
@@ -589,5 +589,6 @@
   if (enabled) {
     text_t gsmacro = "_gsimage_";
-    if (thispage == "info" || thispage == "srce" || thispage == "conf") {
+    if (thispage == "info" || thispage == "srce" || thispage == "conf" || 
+	thispage == "bildcancel" || thispage == "bildfail") {
       gsmacro = "_gsjimage_";
     } else if (type == "view") {
@@ -683,5 +684,4 @@
     fullnamemenu.push_back ('>');
     fullnamemenu += fullnames[i];
-    if (write_protected[i]) fullnamemenu += " <b>(write protected)</b>";
     fullnamemenu.push_back ('\n');
     
@@ -805,4 +805,5 @@
 
   if (collector_page == "new") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "green", "info", true);
     collectorbar += "<td>_icongreyarrow_</td>\n";
@@ -816,4 +817,5 @@
 
   } else if (collector_page == "info") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "yellow", "info", false);
     collectorbar += "<td>_icongreyarrow_</td>\n";
@@ -825,7 +827,8 @@
     collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "grey", "view", false);
-    collectorbar += "</tr><tr><td align=center>_icongreyuparrow_</td><td colspan=8></td>\n";
+    collectorbar += "</tr><tr><td></td><td align=center>_icongreyuparrow_</td><td colspan=8></td>\n";
 
   } else if (collector_page == "srce") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     if (esrce == 1) {
       // if we came from the "change an existing collection" page previous button(s)
@@ -843,7 +846,8 @@
     collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "grey", "view", false);
-    collectorbar += "</tr><tr><td colspan=2></td><td align=center>_icongreyuparrow_</td><td colspan=6></td>\n";
+    collectorbar += "</tr><tr><td colspan=3></td><td align=center>_icongreyuparrow_</td><td colspan=6></td>\n";
 
   } else if (collector_page == "conf") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     // disable appropriate buttons if we came from "change an existing collection"
     // page
@@ -865,7 +869,8 @@
     collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "grey", "view", false);
-    collectorbar += "</tr><tr><td colspan=4></td><td align=center>_icongreyuparrow_</td><td colspan=4></td>\n";
+    collectorbar += "</tr><tr><td colspan=5></td><td align=center>_icongreyuparrow_</td><td colspan=4></td>\n";
 
   } else if (collector_page == "bilddone") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     // all previous buttons grey after build was completed
     collectorbar += get_button (collector_page, "grey", "info", false);
@@ -878,7 +883,8 @@
     collectorbar += "<td>_icongreyarrow_</td>\n";
     collectorbar += get_button (collector_page, "green", "view", true);
-    collectorbar += "</tr><tr><td colspan=6></td><td align=center>_icongreyuparrow_</td><td colspan=2></td>\n";
-
-  } else if (collector_page == "bildcancel") {
+    collectorbar += "</tr><tr><td colspan=7></td><td align=center>_icongreyuparrow_</td><td colspan=2></td>\n";
+
+  } else if (collector_page == "bildcancel" || collector_page == "bildfail") {
+    collectorbar += "<td>_icongreyarrow_</td>\n";
     // disable appropriate buttons if we came from "change an existing collection"
     // page
@@ -973,6 +979,7 @@
   }
   
-  if (collector_page == "bildcancel") {
-    // cancel the build
+  if (collector_page == "bildcancel" || collector_page == "bildfail") {
+    // cancel the build (we'll also use the cancel_build script to tidy
+    // up if the build failed)
     gsdl_cancel_build (args, logout);
   }
