<!--                                                                  -->
<!--  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">
        <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="Table Table-with-highlight">
                <thead>
                    <tr class="Table-row Table-row-header">
                        <xsl:if test="Params/_inline">
                            <th class="Table-col">Select</th>
                        </xsl:if>
                        <th class="Table-col">Name</th>
                        <th class="Table-col Table-col-amount">Retail Price</th>
                        <th class="Table-col Table-col-amount">Wholesale Price</th>
                        <xsl:if test="not(Params/_inline)">
                            <th class="Table-col Table-col-icon">Edit</th>
                        </xsl:if>
                    </tr>
                </thead>
                <tbody>
                    <xsl:for-each select="Price">
                        <tr class="Table-row Table-row-data">
                            <td class="Table-col">
                                <xsl:value-of select="Name" />
                            </td>
                            <td class="Table-col Table-col-amount">
                                <xsl:value-of select="/Root/Client/Locale/CurrencyFormat/Symbol" />
                                <xsl:value-of select="Retail" />
                            </td>
                            <td class="Table-col Table-col-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="Table-col Table-col-icon">
                                    <a href="price?c=edit&amp;PriceID={PriceID}">
                                        <xsl:call-template name="icon">
                                            <xsl:with-param name="type" select="'edit'" />
                                            <xsl:with-param name="role" select="'action'" />
                                        </xsl:call-template>
                                    </a>
                                </td>
                            </xsl:if>
                        </tr>
                    </xsl:for-each>
                </tbody>
            </table>
            <xsl:if test="Params/_inline">
                <script type="text/javascript">window.matchCollection = matchCollection;</script>
            </xsl:if>
        </xsl:if>
    </xsl:template>

</xsl:stylesheet>
