<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- Project Notebook XSLT translator stylesheet.

     Project Tasks page - generates projissues.html

     This is a *very rough* first cut at translating the Project Notebook
     XML document into HTML automatically.
-->

<xsl:output method="html" indent="yes" media-type="text/html"/>

<xsl:include href="shared.xsl" /> <!-- shared definitions for I/S Project -->

<xsl:template match="/project">
    <HTML xmlns="http://www.w3.org/TR/xhtml1/transitional">

    <xsl:call-template name="head-element">
        <xsl:with-param name="title"><xsl:value-of select="@name"/> -- Tasks</xsl:with-param>
    </xsl:call-template>

    <xsl:element name="BODY" use-attribute-sets="body-attrs">

    <xsl:call-template name="title-block">
        <xsl:with-param name="title">Project Tasks</xsl:with-param>
        <xsl:with-param name="subtitle"><xsl:value-of select="/project/@name"/></xsl:with-param>
    </xsl:call-template>

    <TABLE BORDER="0" CELLSPACING="3" CELLPADDING="3" WIDTH="100%">

       <xsl:call-template name="title-row"/>

       <!-- Table row with nothing but a horizontal rule -->
       <TR><TD COLSPAN="2"><P><HR/></P></TD></TR>


       <!-- XXX maybe it would look better to put each task in its own
           toplevel table row, labelled TASK or some such; when all the
           significant content of hte page is in one table row like this
           the top-level table becomes pretty pointless. -->

       <TR>
         <xsl:element name="TH" use-attribute-sets="left-column">
            <STRONG>Tasks</STRONG>
         </xsl:element>
         <TD VALIGN="top">
           <xsl:for-each select="task">
             <xsl:if test="position() > 1"><P/></xsl:if>
             <TABLE BORDER="2" CELLPADDING="2" WIDTH="100%">
                <TR>
                   <!--
                   <TD NOWRAP="true" WIDTH="14%"><P ALIGN="right"/> <BR/></TD>
                   <TD NOWRAP="true" WIDTH="26%"><P ALIGN="right"/> <BR/></TD>
                    -->
                   <TD NOWRAP="true" ROWSPAN="2" WIDTH="14%" ALIGN="center">
                      <B>Owner</B>
                   </TD>
                   <TD WIDTH="26%" ROWSPAN="2"  ALIGN="center">
                      <B>Completion</B>
                   </TD>
                   <TD COLSPAN="3" WIDTH="60%" BGCOLOR="#CCCCCC" ALIGN="center">
                      <B>Estimate of Effort</B>
                   </TD>
                </TR>
                <TR BGCOLOR="{$boxcolor}">
                   <TD WIDTH="20%"  ALIGN="center">
                      <B>Optimistic</B>
                   </TD>
                   <TD WIDTH="20%" ALIGN="center">
                      <B>Likely</B>
                   </TD>
                   <TD WIDTH="20%" ALIGN="center">
                      <B>Pessimistic</B>
                   </TD>
                </TR>
                <TR>
                   <TD WIDTH="14%">
                     <xsl:value-of select="@owner"/><BR/>
                   </TD>
                   <TD WIDTH="26%">
                     <xsl:value-of select="@completion"/><BR/>
                   </TD>
                   <TD WIDTH="20%">
                     <xsl:value-of select="@effort-optimistic"/><BR/>
                   </TD>
                   <TD WIDTH="20%">
                     <xsl:value-of select="@effort-likely"/><BR/>
                   </TD>
                   <TD WIDTH="20%">
                     <xsl:value-of select="@effort-pessimistic"/><BR/>
                   </TD>
                </TR>
                <TR>
                  <TD COLSPAN="5">
                    <B>Task:</B> <xsl:apply-templates select="*|text()"/>
                  </TD>
                </TR>
             </TABLE>
           </xsl:for-each>
         </TD>
       </TR>

    </TABLE>
         
    <xsl:call-template name="trailer-block"/>

    </xsl:element> <!-- /body -->
    </HTML>
</xsl:template>

</xsl:stylesheet>
