<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:template name="statementRunList">
        <xsl:call-template name="statementRuns" />
    </xsl:template>

    <xsl:template name="statementRuns">
        <div class="ArtistList">
            <table class="Table Table-with-highlight">
                <thead>
                    <tr class="Table-row Table-row-header">
                        <th class="Table-col"># of Statements</th>
                        <th class="Table-col">Start Date</th>
                        <th class="Table-col">End Date</th>
                        <th class="Table-col">Run Started</th>
                        <th class="Table-col">Run Finish</th>
                        <th class="Table-col">Created By</th>
                        <th class="Table-col">Status</th>
                    </tr>
                </thead>
                <tbody>
                    <xsl:for-each select="ArtistRunList/ArtistRun">
                        <tr class="Table-row Table-row-data">
                            <td class="Table-col">
                                <a>
                                    <xsl:if test="Status != 0">
                                        <xsl:attribute name="href">?c=show&amp;ArtistRunID=<xsl:value-of select="ArtistRunID" /></xsl:attribute>
                                    </xsl:if>
                                    <xsl:value-of select="count(ArtistStatementList/ArtistStatement)" />
                                </a>
                            </td>
                            <td class="Table-col"><xsl:value-of select="StartDate" /></td>
                            <td class="Table-col"><xsl:value-of select="EndDate" /></td>
                            <td class="Table-col"><xsl:value-of select="StartTime" /></td>
                            <td class="Table-col"><xsl:value-of select="EndTime" /></td>
                            <td class="Table-col"><xsl:value-of select="CreatedBy" /></td>
                            <td class="Table-col">
                                <xsl:if test="Status = 0">Running</xsl:if>
                                <xsl:if test="Status = 1">Complete</xsl:if>
                                <xsl:if test="Status = 2">Commited</xsl:if>
                            </td>
                        </tr>
                    </xsl:for-each>
                    <xsl:if test="not(ArtistRunList/ArtistRun)">
                        <tr><td colspan="7" class="rowLeft"><p>No artist royalty runs have been created.</p></td></tr>
                    </xsl:if>
                </tbody>
            </table>
        </div>
    </xsl:template>

</xsl:stylesheet>

