<!--                                                                  -->
<!--  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="priceSearchLayout">
    <xsl:call-template name="searchResults" />
    <xsl:call-template name="buttons" />
  </xsl:template>

  <xsl:template name="searchResults">
    <div class="section" id="priceList">
      <xsl:call-template name="successMessageGeneral">
        <xsl:with-param name="successMessage">
          <xsl:if test="Messages/Message/Code = 'form_submit_success'">Price successfully created!</xsl:if>
          <xsl:if test="Messages/Message/Code = 'delete_success'">Price successfully deleted!</xsl:if>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:if test="count(Price) = 0">
        <p>No prices have been created.</p>
      </xsl:if>
      <xsl:if test="count(Price) != 0">
        <table class="textChart hiOn">
          <tr>
            <xsl:if test="Params/_inline">
              <th class="selectCol">Select</th>
            </xsl:if>
            <th>Name</th>
            <th class="amount">Retail Price</th>
            <th class=" amount">Wholesale Price</th>
            <xsl:if test="not(Params/_inline)">
              <th class="actionsCol">Actions</th>
            </xsl:if>
          </tr>
          <xsl:for-each select="Price">
            <tr class="row{position() mod 2}">
              <td>
                <xsl:value-of select="Name" />
              </td>
              <td class="amount">
                <xsl:value-of select="/Root/Client/Locale/CurrencyFormat/Symbol" /><xsl:value-of select="Retail" />
              </td>
              <td class="amount">
                <xsl:value-of select="/Root/Client/Locale/CurrencyFormat/Symbol" /><xsl:value-of select="Wholesale" />
              </td>
              <xsl:if test="not(/Root/Params/_inline)">
                <td class="actionsCol">
                  <a href="price?c=edit&amp;PriceID={PriceID}">Edit </a>
                </td>
              </xsl:if>
            </tr>
          </xsl:for-each>
        </table>
        <xsl:if test="Params/_inline">
          <script type="text/javascript">
            window.matchCollection = matchCollection;
          </script>
        </xsl:if>
      </xsl:if>
    </div>
  </xsl:template>

</xsl:stylesheet>

