﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="AddBrandStoreProfile.xslt"/>

    <xsl:template match="/">
        <xsl:variable name="BrandID" select="normalize-space(BrandStore/BrandID)"></xsl:variable>
        <xsl:variable name="TimeStamp" select="normalize-space(BrandStore/TimeStamp)"></xsl:variable>
        <xsl:variable name="IsCommunityAdmin" select="normalize-space(BrandSchedule/IsCommunityAdmin)"></xsl:variable>
        <div style="padding-left:10px;padding-right:10px;padding-top:2px;padding-bottom:2px; background-color:White;">
            <div id="divBrandProfile_Store">
                <xsl:choose>
                    <xsl:when test="$BrandID = -1">
                        <xsl:if test ="BrandStore/PermissionID = 4 or $IsCommunityAdmin = 1">
                        <div id="divAddBrandProfile_AddBrandStore" style="width:100%;display:block;">
                            <input type="button" value="Add Store Item" class="button"
                                   onclick="Brand_SectionEdit('divAddBrandProfile_AddBrandStore','divBrandProfileOperations');"></input>
                        </div>
                        </xsl:if>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:call-template name="AddBrandStoreProfile">
                            <xsl:with-param name="Title" select="normalize-space(BrandStore/SectionTitle)"></xsl:with-param>
                            <xsl:with-param name="SectionHTML" select="normalize-space(BrandStore/SectionHTML)"></xsl:with-param>
                            <xsl:with-param name="SectionSummary" select="normalize-space(BrandStore/SectionSummary)"></xsl:with-param>

                            <xsl:with-param name="BrandID" select="normalize-space(BrandStore/BrandID)"></xsl:with-param>
                            <xsl:with-param name="BrandTabID" select="normalize-space(BrandStore/BrandTabID)"></xsl:with-param>

                        </xsl:call-template>
                    </xsl:otherwise>
                </xsl:choose>
            </div>
            <div id="divBrandProfileOperations" class="divEdit">
                <xsl:choose>
                    <xsl:when test="$BrandID = -1">
                        <div>
                            <table class="tableMaster">
                                <tr>
                                    <td colspan="2" style="text-align:right">
                                        <span onclick="CloseWindow('divBrandProfileOperations'); closeBrandEditMode();" class="labelHeader link" style="color: Black">
                                            [X]
                                        </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:15%">
                                        <span class="labelSize10">
                                            Title:
                                        </span>
                                    </td>
                                    <td style="width:85%">
                                        <input type="text" id="txtTitle" style="width:100%;" class="text" maxlength="50"></input>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:15%">
                                        <span class="labelSize10" >
                                            Section HTML:
                                        </span>
                                    </td>
                                    <td style="width:85%">
                                        <textarea rows="10" id="txtSectionHTML_{$TimeStamp}" style="width:100%; height:350px;" class="textAreaBox mceEditor">
                                        </textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:15%">
                                        <span class="labelSize10" >
                                            Summary:
                                        </span>
                                    </td>
                                    <td style="width:85%">
                                        <textarea rows="4" id="txtSummary" style="width:100%;" class="textAreaBox">
                                        </textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td style="padding-top: 10px; padding-bottom: 10px;">
                                        <input type="button" value="Save" class="button" onclick="BrandStore_addBrandProfile({BrandStore/ActualBrandID}, 4, 1, 1,'Store' , 'txtTitle', 'txtSectionHTML_{$TimeStamp}', 'txtSummary', 'divBrandProfile_Store');"/>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </xsl:when>
                    <xsl:otherwise>
                    </xsl:otherwise>
                </xsl:choose>
            </div>
        </div>
    </xsl:template>
</xsl:stylesheet>
