﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">

    <xsl:import href="../TemplateDetailTemplate.xslt"/>
    <xsl:import href="../TemplateDetailItems.xslt"/>
    <xsl:import href="../TemplateDetailTopics.xslt"/>
    <xsl:import href="AddTemplateSummary.xslt"/>


    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>
        <xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
        <xsl:variable name="BrandID" select="AjaxRequest/BrandID"></xsl:variable>
        <xsl:variable name="CommunityAdmin" select="AjaxRequest/CommunityAdmin"></xsl:variable>
        <xsl:variable name="TemplateItemID" select="AjaxRequest/Params/ItemID"></xsl:variable>
        <xsl:variable name="ImageURL" select="AjaxRequest/TemplateDetailForClients/TemplateImage/Item"></xsl:variable>
        <xsl:variable name="TemplateRoles" select="AjaxRequest/Roles/."></xsl:variable>
        <xsl:variable name="PermissionList" select="AjaxRequest/Permissions/."></xsl:variable>
        <xsl:variable name="ShareITList" select="AjaxRequest/ShareITRecords/."></xsl:variable>
        <xsl:variable name="CommunityItemID" select="AjaxRequest/TemplateDetailItems/Template/CommunityItemID"></xsl:variable>
      <xsl:variable name="PortalItemID" select="AjaxRequest/PortalItemID"></xsl:variable>


        <xsl:call-template name="Portal_MyServicesTemplateDetail">
            <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
            <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
            <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
            <xsl:with-param name="CommunityAdmin" select="$CommunityAdmin"></xsl:with-param>
            <xsl:with-param name="TemplateItemID" select="$TemplateItemID"></xsl:with-param>
            <xsl:with-param name="ImageURL" select="$ImageURL"></xsl:with-param>
            <xsl:with-param name="TemplateRoles" select="$TemplateRoles"></xsl:with-param>
            <xsl:with-param name="PermissionList" select="$PermissionList"></xsl:with-param>
            <xsl:with-param name="ShareITList" select="$ShareITList"></xsl:with-param>
            <xsl:with-param name="CommunityItemID" select="$CommunityItemID"></xsl:with-param>
          <xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
        </xsl:call-template>
    </xsl:template>


    <xsl:template name="Portal_MyServicesTemplateDetail">
        <xsl:param name="HostName" select="'N/A'"></xsl:param>
        <xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
        <xsl:param name="BrandID" select="'N/A'"></xsl:param>
        <xsl:param name="CommunityAdmin" select="'N/A'"></xsl:param>
        <xsl:param name="TemplateItemID" select="'N/A'"></xsl:param>
        <xsl:param name="ImageURL" select="'N/A'"></xsl:param>
        <xsl:param name="TemplateRoles" select="'N/A'"></xsl:param>
        <xsl:param name="PermissionList" select="'N/A'"></xsl:param>
        <xsl:param name="ShareITList" select="'N/A'"></xsl:param>
        <xsl:param name="CommunityItemID" select="'N/A'"></xsl:param>
      <xsl:param name="PortalItemID" select="'N/A'"></xsl:param>



        <div align="right">
            <span class="link"
                  onClick="return LoadCoachInfoWizard('LoadMyServices','{$BrandID}','divClientPortalOperations_Container');">[X]</span>
        </div>
        <div class="link seperatorLine" style="margin-bottom:10px;font-size:16px;background-color:rgb(217, 217, 217)">Service Template Details</div>
        <div id="div_TemplateDetail" boxed="0">
            <!--<xsl:choose>
                <xsl:when test="$CommunityAdmin = 1">-->                   
                        <xsl:call-template name="TemplateDetailTemplate">
                            <xsl:with-param name="TemplateItemID" select="$TemplateItemID"></xsl:with-param>
                            <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
                            <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                            <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                            <xsl:with-param name="PermissionList" select="$PermissionList"></xsl:with-param>
                            <xsl:with-param name="ShareITList" select="$ShareITList"></xsl:with-param>
                        </xsl:call-template>                  
                <!--</xsl:when>
                <xsl:otherwise>
                    <xsl:call-template name="TemplateDetailTemplateForClients">
                        <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
                        <xsl:with-param name ="TemplateURL" select="$TemplateURL"></xsl:with-param>
                        <xsl:with-param name="TemplateItemID" select="$TemplateItemID"></xsl:with-param>
                        <xsl:with-param name="ImageURL" select="$ImageURL"></xsl:with-param>
                    </xsl:call-template>
                </xsl:otherwise>
            </xsl:choose>-->
        </div>
        <div class="link seperatorLine" style="font-size:16px;margin-top:10px;background-color:rgb(217, 217, 217)">Topics or Milestones</div>
        <div id="div_TemplateDetailTopics" boxed="0">
            <xsl:call-template name="TemplateDetailTopics">
                <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                <xsl:with-param name ="TemplateURL" select="$TemplateURL"></xsl:with-param>
            </xsl:call-template>
            <div style="margin-top:10px;">
                <xsl:call-template name="AddTemplateSummary">
                    <xsl:with-param name="TemplateItemID" select="$TemplateItemID"></xsl:with-param>
                    <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                </xsl:call-template>
            </div>
        </div>
        <div class="link seperatorLine" style="margin-top:10px;font-size:16px;background-color:rgb(217, 217, 217)">Items</div>
        <div id="div_TemplateDetailItems" boxed="0">
            <xsl:call-template name="TemplateDetailItems">
                <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
                <xsl:with-param name ="TemplateURL" select="$TemplateURL"></xsl:with-param>
                <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                <xsl:with-param name="TemplateRoles" select="$TemplateRoles"></xsl:with-param>
                <xsl:with-param name="CommunityItemID" select="$CommunityItemID"></xsl:with-param>
              <xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
            </xsl:call-template>
        </div>
    </xsl:template>

</xsl:stylesheet>
