<!--                                                                  -->
<!--  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="tracksNoLicensesLayout">
        <div class="AuditReport" id="auditReport">
            <h2 class="AuditReport-header">
                Tracks Not 100% Licensed
                <xsl:call-template name="helpIcon">
                    <xsl:with-param name="tip">
                        Lists tracks which have less than a 100% total licensed share
                    </xsl:with-param>
                </xsl:call-template>
            </h2>
            <xsl:call-template name="reportHeading">
                <xsl:with-param name="showMechSwitcher" select="'true'" />
                <xsl:with-param name="showDownloadLink">
                    <xsl:choose>
                        <xsl:when test="Report/Track">
                            <xsl:text>true</xsl:text>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:text>false</xsl:text>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:with-param>
            </xsl:call-template>
            <xsl:choose>
                <xsl:when test="Report/Track">
                    <xsl:call-template name="tracksNoLicensesTable" />
                    <xsl:call-template name="reportFooter" />
                </xsl:when>
                <xsl:otherwise>
                    <section class="Table-empty-results Table-empty-results-no-header">
                        <p>No tracks without licenses were found.</p>
                    </section>
                </xsl:otherwise>
            </xsl:choose>

            <xsl:call-template name="backToStatementsHome" />
        </div>
    </xsl:template>

    <xsl:template name="tracksNoLicensesTable">
        <table class="Table Table-with-highlight">
            <thead>
                <tr class="Table-row Table-row-header">
                    <th class="Table-col">Label</th>
                    <th class="Table-col">Catalog&#160;#</th>
                    <th class="Table-col">Album&#160;Title</th>
                    <th class="Table-col">Artist</th>
                    <th class="Table-col Table-col-amount">Track&#160;#</th>
                    <th class="Table-col">Track&#160;Name</th>
                    <th class="Table-col">Product&#160;Type</th>
                    <th class="Table-col">Region</th>
                    <th class="Table-col Table-col-amount">%&#160;Unlicensed</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="Report/Track">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col"><xsl:value-of select="LabelName" /></td>
                        <td class="Table-col"><xsl:value-of select="CatalogNumber" /></td>
                        <td class="Table-col">
                            <a href="/rps/catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
                        </td>
                        <td class="Table-col"><xsl:value-of select="TrackArtistName" /></td>
                        <td class="Table-col Table-col-amount"><xsl:value-of select="TrackNumber" /></td>
                        <td class="Table-col">
                            <a href="/rps/track?c=show&amp;TrackID={TrackID}"><xsl:value-of select="TrackTitle" /></a>
                        </td>
                        <td class="Table-col">
                            <xsl:choose>
                                <xsl:when test="normalize-space(ProductTypeID)">
                                    <xsl:variable name="productTypeID" select="ProductTypeID" />
                                    <xsl:value-of select="/Root/TypeList/Type[ProductTypeID = $productTypeID]/Description" />
                                </xsl:when>
                                <xsl:otherwise>All</xsl:otherwise>
                            </xsl:choose>
                        </td>
                        <td class="Table-col"><xsl:value-of select="RegionName" /></td>
                        <td class="Table-col Table-col-amount"><xsl:value-of select="ShareUnlicensed" />%</td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>


</xsl:stylesheet>
