<!--                                                                  -->
<!--  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="contractListLayout">
    <div class="section">
			<xsl:if test="count(PayorList/Payor) &gt; 1">
				<xsl:call-template name="payorSelectForm" />	
			</xsl:if>
			<xsl:call-template name="listNav" />
			<xsl:choose>
				<xsl:when test="count(ArtistContract) = 0">
					<p>No contracts are available under this heading.</p>
				</xsl:when>
				<xsl:otherwise>
					<xsl:call-template name="contractListAlpha" />
					<xsl:call-template name="listNav" />
				</xsl:otherwise>
			</xsl:choose>
		</div>
	</xsl:template>

	<xsl:template name="payorSelectForm">
    <div class="listSelect">
      <form action="artist_contract" method="get">
				<input type="hidden" name="page" value="{Params/page}" />
        <input type="hidden" name="c" value="list" />
        Now Viewing:
        <select name="payor">
          <option value="">All Payors</option>
          <xsl:for-each select="PayorList/Payor">
            <option value="{PayorID}">
							<xsl:if test="PayorID = /Root/Params/payor">
								<xsl:attribute name="selected">selected</xsl:attribute>
							</xsl:if>
							<xsl:value-of select="Name" />
						</option>
          </xsl:for-each>
        </select>
        <input type="submit" name="go" value="Go" />
      </form>
    </div>
  </xsl:template>

	<xsl:template name="contractListAlpha">
      <table class="textChart hiOn">
        <tr>
          <th class="rowLeft">Contract Title</th>
					<th>Artist</th>
          <th>Contract&#160;ID</th>
          <th>Payor</th>
          <th>Payee</th>
					<xsl:if test="/Root/Access/rps/artist_contract/edit = 1">
	          <th class="editCol">Edit</th>
					</xsl:if>
        </tr>
        <xsl:for-each select="ArtistContract">
					<xsl:call-template name="artistContractRow" />
        </xsl:for-each>
      </table>
  </xsl:template>

</xsl:stylesheet>
