From: Chris D. <chr...@us...> - 2004-07-25 21:45:56
|
Update of /cvsroot/stepmania/stepmania/Themes/default/Other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25608 Modified Files: Profile Style.xsl Log Message: fix div by 0 if no CaloriesBurned entries Index: Profile Style.xsl =================================================================== RCS file: /cvsroot/stepmania/stepmania/Themes/default/Other/Profile Style.xsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- Profile Style.xsl 20 Jul 2004 07:13:07 -0000 1.6 +++ Profile Style.xsl 25 Jul 2004 21:45:47 -0000 1.7 @@ -1002,41 +1002,43 @@ </xsl:with-param> </xsl:call-template> - <hr/> + <xsl:if test="$Cals > 0"> + <hr/> - <h2>By Week</h2> - <xsl:variable name="firstDateJulian"> - <xsl:call-template name="calculate-julian-day2"> - <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[1]/@Date" /> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="lastDateJulian"> - <xsl:call-template name="calculate-julian-day2"> - <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[last()]/@Date" /> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="lastDateDayOfWeek"> - <xsl:call-template name="calculate-day-of-the-week2"> - <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[last()]/@Date" /> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="lastDateJulianRoundedToWeek" select="$lastDateJulian - $lastDateDayOfWeek" /> - <table> - <tr> - <td></td> - <td>Sun</td> - <td>Mon</td> - <td>Tue</td> - <td>Wed</td> - <td>Thu</td> - <td>Fri</td> - <td>Sat</td> - </tr> - <xsl:call-template name="PrintWeeksRecursive"> - <xsl:with-param name="beginDayJulian" select="$lastDateJulianRoundedToWeek" /> - <xsl:with-param name="stopDayJulian" select="$firstDateJulian" /> - </xsl:call-template> - </table> + <h2>By Week</h2> + <xsl:variable name="firstDateJulian"> + <xsl:call-template name="calculate-julian-day2"> + <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[1]/@Date" /> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="lastDateJulian"> + <xsl:call-template name="calculate-julian-day2"> + <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[last()]/@Date" /> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="lastDateDayOfWeek"> + <xsl:call-template name="calculate-day-of-the-week2"> + <xsl:with-param name="date" select="/Stats/CalorieData/CaloriesBurned[last()]/@Date" /> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="lastDateJulianRoundedToWeek" select="$lastDateJulian - $lastDateDayOfWeek" /> + <table> + <tr> + <td></td> + <td>Sun</td> + <td>Mon</td> + <td>Tue</td> + <td>Wed</td> + <td>Thu</td> + <td>Fri</td> + <td>Sat</td> + </tr> + <xsl:call-template name="PrintWeeksRecursive"> + <xsl:with-param name="beginDayJulian" select="$lastDateJulianRoundedToWeek" /> + <xsl:with-param name="stopDayJulian" select="$firstDateJulian" /> + </xsl:call-template> + </table> + </xsl:if> </xsl:with-param> </xsl:call-template> |