Index: /issm/trunk/cron/report.sh
===================================================================
--- /issm/trunk/cron/report.sh	(revision 1604)
+++ /issm/trunk/cron/report.sh	(revision 1605)
@@ -7,8 +7,8 @@
 cat nightly.log | grep 'package: cielo_serial'  | grep -v "not supported yet" > cielo_serial.log
 cat nightly.log | grep 'package: cielo_parallel'| grep -v "not supported yet" > cielo_parallel.log
-cat nightly.log | grep NIGHTLYRUNTERMINATEDCORRECTLY > check.log
-cat nightly.log | grep ERROR | grep -v "PETSC ERROR" > errors.log
-cat nightly.log | grep SUCCESS > success.log
-cat errors.log success.log > tests.log
+cat nightly.log | grep 'NIGHTLYRUNTERMINATEDCORRECTLY'                        > check.log
+cat nightly.log | grep 'ERROR'                  | grep -v "PETSC ERROR"       > errors.log
+cat nightly.log | grep 'SUCCESS'                                              > success.log
+cat errors.log success.log                                                    > tests.log
 
 #create some variables
@@ -26,101 +26,80 @@
 fi
 
+#style
+H1_STYLE='width="800px" cellpadding="20"'
+H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"'
+
+H2_STYLE='width="840px" cellpadding="20"'
+H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"'
+
+TABLE_STYLE='width="820px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
+TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14; font-weight: normal;" align="left"'
+
+BODY_STYLE='width="820px"'
+BODY_FONT="style=\"color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;\""
+
+NOTEST_STYLE='width="650px"'
+NOTEST_FONT='style="color:#FF0000; font-family:Arial, Verdana, Tahoma; font-size:14px;" align="left"'
+
+FOOTER_STYLE='width="800px"  cellpadding="10"'
+FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'
+
 #build report.html
 
-#first: header
-cat << END > header.html
-<style type="text/css">
-	<!--
-	.issmbody {
-		margin: auto;
-		width:800px;
-		background: none;
-		color: #404040;
-		font-family: Arial, Verdana, Tahoma;
-		font-size: 14px;
-		font-weight: normal;
-		text-align: left;
-		}
+#first: summary
+cat << END > summary.html
+<div align="center">
+<table $H1_STYLE><tr><td $H1_FONT>ISSM Nightly run report</td></tr></table>
 
-	.issmh1 {
-		margin:2em auto;
-		width:800px;
-		background: none;
-		color: #6495ed;
-		font-family: Arial, Verdana, Tahoma;
-		font-size: 35px;
-		font-weight: bold;
-		text-align: center;
-		}
-
-	.issmh2 {
-		margin:1.5em auto 1em auto;
-		width:800px;
-		background: transparent;
-		color: #6495ed;
-		font-family: Arial, Verdana, Tahoma;
-		font-weight: bold;
-		font-size: 28px;
-		text-align: left;
-		}
-
-	.issmfooter {
-		margin:auto;
-		width:800px;
-		background: none;
-		color: #404040;
-		font-family: Arial, Verdana, Tahoma;
-		font-size: 12px;
-		font-weight: normal;
-		text-align: center;
-		}
-
-	.issmcomment {
-		padding:4px;
-		margin:0 auto;
-		width:800px;
-		border:1px dashed #000000;
-		text-align: left;
-		font-family: Arial, Verdana, Tahoma;
-		font-size: 14px;
-		color: #404040;
-		background-color:#ffffdd}
-	-->
-</style>
-<div class="issmh1">ISSM Nightly run report</div>
-<br>
-END
-
-#then: summary
-cat << END > summary.html
-<div class="issmcomment">
-date: $TODAY<br>
-host: $HOST_NAME<br>
-OS:   $OS<br>
-release: $ISSM_RELEASE<br>
-total elapsed time: $ELAPSED_TOTAL<br>
-installation elapsed time: $ELAPSED_INSTAL<br>
-runs elapsed time: $ELAPSED_RUN<br>
-<br>
-status: $(if [ $(echo $IS_INSTALL) = 0 ];
+<table $TABLE_STYLE>
+<tr> 
+<td $TABLE_FONT>host: $HOST_NAME</td>
+<td $TABLE_FONT>date: $TODAY</td>
+</tr>
+<tr>
+<td $TABLE_FONT>OS: $OS</td>
+<td $TABLE_FONT>total elapsed time: $ELAPSED_TOTAL</td>
+</tr>
+<tr>
+<td $TABLE_FONT>release: $ISSM_RELEASE</td>
+<td $TABLE_FONT>installation elapsed time: $ELAPSED_INSTAL</td>
+</tr>
+<tr>
+$(#print status
+if [ $(echo $IS_INSTALL) = 0 ];
 then
 	#installation failed, end of report
-	echo "<span style=\"color:#FF0000\">installation failed</span></div>"
+	echo "<td $TABLE_FONT>status: <span style=\"color:#FF0000\">installation failed</span></td>"
+	echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>"
+	echo "</tr>"
+	echo "</table>"
 	rm check.log errors.log success.log tests.log
 else
+	#installation successful. Did we go to the end?
+
 	if [ $(echo $IS_END) = 0 ];
 	then
-		echo "<span style=\"color:#FF0000\">stopped before the end</span>"
+		echo "<td $TABLE_FONT>status: <span style=\"color:#FFA500\">stopped before the end</span></td>"
 	else
-		echo "all test desks have been run"
+		echo "<td $TABLE_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td>"
 	fi
-	echo "<br>"
-	echo "number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)<br>"
-	echo "number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';rm success.log tests.log)</div>"
-	echo "<br>"
-	echo "<hr width=\"900px\">"
+	echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>"
+	echo "</tr>"
+	echo "<tr>"
+	echo "<td $TABLE_FONT>number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)</td>"
+	echo "<td $TABLE_FONT>  </td>"
+	echo "</tr>"
+	echo "<tr>"
+	echo "<td $TABLE_FONT>number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm success.log tests.log)</td>"
+	echo "<td $TABLE_FONT>  </td>"
+	echo "</tr>"
+	echo "</table>"
+
+	#draw a line and clean up
+	echo "<br><hr width=\"900px\">"
 	rm check.log
 fi) 
 END
+
 
 #report content
@@ -131,19 +110,20 @@
 
 	#enter title
-	if [ $package == "macayeal" ]; then
-		echo "<div class=\"issmh2\">MacAyeal package</div>"
+	if [ $package == "macayeal" ];
+	then
+		echo "<table $H2_STYLE><tr><td $H2_FONT>Macayeal package</td></tr></table>"
 	fi
-	if [ $package == "ice" ]; then
-		echo "<div class=\"issmh2\">Ice package</div>"
+	if [ $package == "ice" ];
+	then
+		echo "<table $H2_STYLE><tr><td $H2_FONT>Ice package</td></tr></table>"
 	fi
-	if [ $package == "cielo_serial" ]; then
-		echo "<div class=\"issmh2\">Cielo Serial package</div>"
+	if [ $package == "cielo_serial" ];
+	then
+		echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo serial package</td></tr></table>"
 	fi
-	if [ $package == "cielo_parallel" ]; then
-		echo "<div class=\"issmh2\">Cielo Parallel package</div>"
+	if [ $package == "cielo_parallel" ];
+	then
+		echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo parallel package</td></tr></table>"
 	fi
-
-	#Print division
-	echo "<div class=\"issmbody\">"
 
 	#check that at least one Test exists
@@ -151,10 +131,10 @@
 
 		#No Test: use a table to fix entourage bug.
-		echo "<table width=\"20%\" style=\"color:#FF0000; font-size:14px;\"><tr><td align=\"center\">No test found.</td></tr></table>"
+		echo "<table $NOTEST_STYLE><tr><td $NOTEST_FONT>No test found.</td></tr></table>"
 
 	else
 
-		echo "<table cellspacing=\"-1\" width=\"100%\" style=\"font-family: Arial, Verdana, Tahoma; color: #404040;\">"
-		echo "<tr> <th style=\"font-size:14px;\">Result</th> <th style=\"font-size:14px;\">Tolerance</th> <th style=\"font-size:14px;\">Test</th>  <th style=\"font-size:14px;\">Solution</th> <th style=\"font-size:14px;\">Field</th> </tr>"
+		echo "<table $BODY_STYLE cellspacing=\"-1\">"
+		echo "<tr> <th $BODY_FONT>Result</th> <th $BODY_FONT>Tolerance</th> <th $BODY_FONT>Test</th>  <th $BODY_FONT>Solution</th> <th $BODY_FONT>Field</th> </tr>"
 
 		# go through the lines of $package.log
@@ -173,7 +153,10 @@
 				color="bgcolor=#ffdddd";
 			fi
+			FONT=$(echo "$BODY_FONT $color")
 
 			#build html corresponding line
-			cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk '/line'$COUNTER'o/ {printf("<td '$color' style=\"font-size:14px;\">%s</td><td '$color' style=\"font-size:14px;\"> %s%s%s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td>",$2,$4,$5,$6,$8,$10,$14);}';
+			cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk -v FONT="$FONT" '
+			/line'$COUNTER'o/ { printf("<td %s>%s</td><td %s> %s%s%s</td><td %s> %s</td><td %s> %s</td><td %s> %s</td>",FONT,$2,FONT,$4,$5,$6,FONT,$8,FONT,$10,FONT,$14);}
+			';
 			echo "</tr>"
 		done
@@ -182,6 +165,5 @@
 	fi
 
-	#Print end division and remove log file
-	echo "</div>"
+	#remove log file
 	rm $package.log
 
@@ -198,5 +180,6 @@
 cat << END > footer.html
 <br>
-<div class="issmfooter"><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</div>
+<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
+</div>
 END
 
@@ -204,8 +187,8 @@
 if [ $(echo $IS_INSTALL) = 1 ];
 then
-	cat header.html summary.html content.html footer.html > report.html
-	rm  header.html summary.html content.html footer.html
+	cat summary.html content.html footer.html > report.html
+	rm  summary.html content.html footer.html
 else
-	cat header.html summary.html footer.html > report.html
-	rm  header.html summary.html footer.html
+	cat summary.html footer.html > report.html
+	rm  summary.html footer.html
 fi
