Index: branches/0.4/web/addons/job_monarch/templates/search.tpl
===================================================================
--- branches/0.4/web/addons/job_monarch/templates/search.tpl	(revision 711)
+++ branches/0.4/web/addons/job_monarch/templates/search.tpl	(revision 776)
@@ -86,5 +86,5 @@
   </TD>
   <TD>
-  <INPUT TYPE="TEXT" NAME="id" VALUE="{id_value}">
+  <INPUT TYPE="TEXT" NAME="id" VALUE="{$id_value}">
   </TD>
 
@@ -97,5 +97,5 @@
   </TD>
   <TD>
-  <INPUT TYPE="TEXT" NAME="owner" VALUE="{owner_value}">
+  <INPUT TYPE="TEXT" NAME="owner" VALUE="{$owner_value}">
   </TD>
 
@@ -104,5 +104,5 @@
   </TD>
   <TD>
-  <INPUT TYPE="TEXT" NAME="queue" VALUE="{queue_value}">
+  <INPUT TYPE="TEXT" NAME="queue" VALUE="{$queue_value}">
   </TD>
 
@@ -111,5 +111,5 @@
   </TD>
   <TD>
-  <INPUT TYPE="TEXT" NAME="name" VALUE="{name_value}">
+  <INPUT TYPE="TEXT" NAME="name" VALUE="{$name_value}">
   </TD>
 
@@ -127,6 +127,6 @@
   </TD>
   <TD>
-  <INPUT TYPE="HIDDEN" NAME="start_from_time" VALUE="{start_from_value}">
-  <INPUT TYPE="TEXT" NAME="start_from_pick" VALUE="{start_from_value}" DISABLED="TRUE"> 
+  <INPUT TYPE="HIDDEN" NAME="start_from_time" VALUE="{$start_from_value}">
+  <INPUT TYPE="TEXT" NAME="start_from_pick" VALUE="{$start_from_value}" DISABLED="TRUE"> 
   <A HREF="javascript:show_calendar('document.archive_search_form.start_from_pick', document.archive_search_form.start_from_pick.value );">
   <IMG SRC="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a> 
@@ -138,6 +138,6 @@
   </TD>
   <TD>
-  <INPUT TYPE="HIDDEN" NAME="start_to_time" VALUE="{start_to_value}">
-  <INPUT TYPE="TEXT" NAME="start_to_pick" VALUE="{start_to_value}" DISABLED="TRUE">
+  <INPUT TYPE="HIDDEN" NAME="start_to_time" VALUE="{$start_to_value}">
+  <INPUT TYPE="TEXT" NAME="start_to_pick" VALUE="{$start_to_value}" DISABLED="TRUE">
   <a href="javascript:show_calendar('document.archive_search_form.start_to_pick', document.archive_search_form.start_to_pick.value );"> 
   <img src="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a> 
@@ -159,6 +159,6 @@
   </TD>
   <TD>
-  <INPUT TYPE="HIDDEN" NAME="end_from_time" VALUE="{end_from_value}">
-  <INPUT TYPE="TEXT" NAME="end_from_pick" VALUE="{end_from_value}" DISABLED="TRUE"> 
+  <INPUT TYPE="HIDDEN" NAME="end_from_time" VALUE="{$end_from_value}">
+  <INPUT TYPE="TEXT" NAME="end_from_pick" VALUE="{$end_from_value}" DISABLED="TRUE"> 
   <A HREF="javascript:show_calendar('document.archive_search_form.end_from_pick', document.archive_search_form.end_from_pick.value );">
   <IMG SRC="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a> 
@@ -171,6 +171,6 @@
   </TD>
   <TD>
-  <INPUT TYPE="HIDDEN" NAME="end_to_time" VALUE="{end_to_value}">
-  <INPUT TYPE="TEXT" NAME="end_to_pick" VALUE="{end_to_value}" DISABLED="TRUE">
+  <INPUT TYPE="HIDDEN" NAME="end_to_time" VALUE="{$end_to_value}">
+  <INPUT TYPE="TEXT" NAME="end_to_pick" VALUE="{$end_to_value}" DISABLED="TRUE">
   <a href="javascript:show_calendar('document.archive_search_form.end_to_pick', document.archive_search_form.end_to_pick.value );"> 
   <img src="cal.gif" width="16" height="16" border="0" title="Click to select a date/time" alt="Click to select a date/time"></a> 
@@ -195,10 +195,11 @@
 
 </TABLE>
-{form_error_msg}<BR><BR>
-<!-- START BLOCK : search_results -->
-
-<INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{sortby}">
-<INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{sortorder}">
-<INPUT TYPE="HIDDEN" NAME="filterorder" VALUE="{order}">
+{$form_error_msg}<BR><BR>
+
+{if "$search_results" == " yes" }
+
+<INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{$sortby}">
+<INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{$sortorder}">
+<INPUT TYPE="HIDDEN" NAME="filterorder" VALUE="{$order}">
 
 <TABLE WIDTH="100%" CELLPADDING="2" CELLSPACING="2" BORDER=0>
@@ -210,11 +211,11 @@
 <TH><B><A HREF="#" onClick="setSort( 'name' )" ALT="Jobname" TITLE="Jobname">Name</A></B></TH>
 <TH><B><A HREF="#" onClick="setSort( 'req_cpu' )" ALT="Requested CPU Time (walltime)" TITLE="Requested CPU Time (walltime)">Req. CPU time</A></B></TH>
-<!-- START BLOCK : column_header_req_mem -->
+{if "$column_header_req_mem" == "yes"}
 <TH><B><A HREF="#" onClick="setSort( 'req_mem' )" ALT="Requested Memory" TITLE="Requested Memory">Req. Memory</A></B></TH>
-<!-- END BLOCK : column_header_req_mem -->
+{/if}
 <TH><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">N</A>/<A HREF="#" onClick="setSort( 'cpus' )" ALT="Processors" TITLE="Processors">P</A></B></TH>
-<!-- START BLOCK : column_header_nodes -->
+{if "$column_header_nodes" == "yes"}
 <TH><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">Nodes</A></B></TH>
-<!-- END BLOCK : column_header_nodes -->
+{/if}
 <TH><B><A HREF="#" onClick="setSort( 'start' )">Started</A></B></TH>
 <TH><B><A HREF="#" onClick="setSort( 'finished' )">Finished</A></B></TH>
@@ -222,36 +223,36 @@
 </TR>
 
-<!-- START BLOCK : node -->
-  <TR CLASS="{nodeclass}">
-    <TD><A HREF="#" onClick="setFilter( 'id', '{id}' )">{id}</A></TD>
-    <TD><A HREF="#" onClick="setFilter( 'state', '{state}' )">{state}</A></TD>
-    <TD><A HREF="#" onClick="setFilter( 'owner', '{owner}' )">{owner}</A></TD>
-    <TD><A HREF="#" onClick="setFilter( 'queue', '{queue}' )">{queue}</A></TD>
-    <TD ALT="{fulljobname}" TITLE="{fulljobname}">
-<!-- START BLOCK : jobname_hint_start -->
+{loop $node}
+  <TR CLASS="{$nodeclass}">
+    <TD><A HREF="#" onClick="setFilter( 'id', '{$id}' )">{$id}</A></TD>
+    <TD><A HREF="#" onClick="setFilter( 'state', '{$state}' )">{$state}</A></TD>
+    <TD><A HREF="#" onClick="setFilter( 'owner', '{$owner}' )">{$owner}</A></TD>
+    <TD><A HREF="#" onClick="setFilter( 'queue', '{$queue}' )">{$queue}</A></TD>
+    <TD ALT="{$fulljobname}" TITLE="{$fulljobname}">
+{if "$jobname_hint_start" == "yes"}
     <FONT CLASS="jobname_hint">
-<!-- END BLOCK : jobname_hint_start -->
-    {name}
-<!-- START BLOCK : jobname_hint_end -->
+{/if}
+    {$name}
+{if "$jobname_hint_end" == "yes"}
     </FONT>
-<!-- END BLOCK : jobname_hint_end -->
+{/if}
     </TD>
-    <TD>{req_cpu}</TD>
-<!-- START BLOCK : column_req_mem -->
-    <TD>{req_memory}</TD>
-<!-- END BLOCK : column_req_mem -->
-    <TD>{nodes}/{cpus}</TD>
-<!-- START BLOCK : column_nodes -->
-    <TD>{nodes_hostnames}</TD>
-<!-- END BLOCK : column_nodes -->
-    <TD>{started}</TD>
-    <TD>{finished}</TD>
-    <TD>{runningtime}</TD>
+    <TD>{$req_cpu}</TD>
+{if "$column_req_mem" == "yes"}
+    <TD>{$req_memory}</TD>
+{/if}
+    <TD>{$nodes}/{$cpus}</TD>
+{if "$column_req_mem" == "yes"}
+    <TD>{$nodes_hostnames}</TD>
+{/if}
+    <TD>{$started}</TD>
+    <TD>{$finished}</TD>
+    <TD>{$runningtime}</TD>
   </TR>
-<!-- END BLOCK : node -->
+{/loop}
 </TABLE>
 </CENTER>
 
-<!-- START BLOCK : showhosts -->
+{if "$showhosts" == "yes" }
 <TABLE BORDER="0" WIDTH="100%">
 <TR>
@@ -259,12 +260,12 @@
   <FONT SIZE="-1">
   Show Hosts:
-  yes<INPUT type=radio name="sh" value="1" OnClick="archive_search_form.submit();" {checked1}>
-  no<INPUT type=radio name="sh" value="0" OnClick="archive_search_form.submit();" {checked0}>
+  yes<INPUT type=radio name="sh" value="1" OnClick="archive_search_form.submit();" {$checked1}>
+  no<INPUT type=radio name="sh" value="0" OnClick="archive_search_form.submit();" {$checked0}>
   </FONT>
   |
-  job <strong>{id}</strong> metric <strong>{metric}</strong>
+  job <strong>{$id}</strong> metric <strong>{$metric}</strong>
   |
    <FONT SIZE="-1">
-   Columns&nbsp;&nbsp;{cols_menu}
+   Columns&nbsp;&nbsp;{$cols_menu}
    </FONT><BR>
   </TD>
@@ -276,7 +277,7 @@
 <TABLE>
 <TR>
-<!-- START BLOCK : sorted_list -->
-{metric_image}{br}
-<!-- END BLOCK : sorted_list -->
+{loop $sorted_list}
+{$metric_image}{$br}
+{/loop}
 </TR>
 </TABLE>
@@ -284,5 +285,5 @@
 </CENTER>
 
-<!-- END BLOCK : showhosts -->
-<!-- END BLOCK : search_results -->
+{/if}
+{/if}
 </CENTER>
