﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:include href="GenericTemplates/DisplayTemplate.xslt" />

    <xsl:template match="/">
        <!--<a id="linkFacebook" class="link" target="_blank" onclick="generateShortURL('{normalize-space($FaceBookSrc)}{normalize-space(ItemID)}&amp;Ref=FB-U{normalize-space($UserID)}',{normalize-space(ItemID)},'/desktopmodules/communities/Publication.aspx','FB');" >
      <img src="{normalize-space($TemplateURL)}web/images/facebook.png" alt="Follow us on Facebook!"
          width="16" height="16" hspace="3" border="0" align="absmiddle"/>
    </a>-->
        <!--<div id="div_Templates" style="margin-left:220px;margin-right:10px;">-->
        <div id="div_Templates">
            <xsl:for-each select="TemplateAdmin/Item[LifeSpaceID = 0  and PublicYN = 'True' and Status='Active' and PublishedYN = 'True']">
                <xsl:call-template name="DisplayLinkedTemplates">
                    <xsl:with-param name="ItemID" select="normalize-space(ItemID)"></xsl:with-param>
                    <xsl:with-param name="Name" select="normalize-space(ItemName)"></xsl:with-param>
                    <xsl:with-param name="Description" select="normalize-space(Description)"></xsl:with-param>
                    <xsl:with-param name="ImageUrl" select="normalize-space(ImageURL)"></xsl:with-param>
                    <xsl:with-param name="HostName" select="normalize-space(../HostName)"></xsl:with-param>
                    <xsl:with-param name="FaceBookSrc" select="normalize-space(../FaceBookSrc)"></xsl:with-param>
                    <xsl:with-param name="TwitterSrc" select="normalize-space(../TwitterSrc)"></xsl:with-param>
                    <xsl:with-param name="UserID" select="normalize-space(../UserID)"></xsl:with-param>
                    <xsl:with-param name="TemplateURL" select="normalize-space(../TemplateURL)"></xsl:with-param>
                    <xsl:with-param name="RefValue" select="''"></xsl:with-param>
                    <xsl:with-param name="PromoteKey" select="PromoteKey"></xsl:with-param>
                </xsl:call-template>
            </xsl:for-each>
            <xsl:for-each select="TemplateAdmin/LifeSpace/Item">
                <xsl:variable name="LifeSpaceID" select="ID"></xsl:variable>
                <xsl:variable name="LifeSpace" select="Name"></xsl:variable>
                <xsl:if test ="count(../../Item[LifeSpaceID = $LifeSpaceID  and PublicYN = 'True' and Status='Active' and PublishedYN = 'True']) &gt; 0">
                    <div id="div_Item_{normalize-space($LifeSpaceID)}_Templates">
                        <div id="div_Item_{normalize-space($LifeSpaceID)}_Templates_Header"
                             style="text-align:left;margin-bottom:20px;"
                             class="onmouseover seperatorLine label link"
                             onclick="return expandCollapseByGroup('div_Item_{normalize-space($LifeSpaceID)}_Templates_Content');">
                            <span style="text-align:left">
                                <xsl:value-of select="$LifeSpace"/>
                            </span>
                        </div>
                        <div id="div_Item_{normalize-space($LifeSpaceID)}_Templates_Content"  style="display:block;">
                            <xsl:for-each select="../../Item[LifeSpaceID = $LifeSpaceID  and PublicYN = 'True' and Status='Active' and PublishedYN = 'True']">
                                <xsl:call-template name="DisplayLinkedTemplates">
                                    <xsl:with-param name="ItemID" select="normalize-space(ItemID)"></xsl:with-param>
                                    <xsl:with-param name="Name" select="normalize-space(ItemName)"></xsl:with-param>
                                    <xsl:with-param name="Description" select="normalize-space(Description)"></xsl:with-param>
                                    <xsl:with-param name="ImageUrl" select="normalize-space(ImageURL)"></xsl:with-param>
                                    <xsl:with-param name ="HostName" select="normalize-space(../HostName)"></xsl:with-param>
                                    <xsl:with-param name ="FaceBookSrc" select="normalize-space(../FaceBookSrc)"></xsl:with-param>
                                    <xsl:with-param name="TwitterSrc" select="normalize-space(../TwitterSrc)"></xsl:with-param>
                                    <xsl:with-param name ="UserID" select="normalize-space(../UserID)"></xsl:with-param>
                                    <xsl:with-param name ="TemplateURL" select="normalize-space(../TemplateURL)"></xsl:with-param>
                                    <xsl:with-param name="RefValue" select="''"></xsl:with-param>
                                    <xsl:with-param name="PromoteKey" select="PromoteKey"></xsl:with-param>
                                </xsl:call-template>
                            </xsl:for-each>
                        </div>
                    </div>
                </xsl:if>
            </xsl:for-each>
            <!--<xsl:for-each select="TemplateAdmin/Item">
                <xsl:call-template name="DisplayLinkedTemplates">
                    <xsl:with-param name="ItemID" select="normalize-space(ItemID)"></xsl:with-param>
                    <xsl:with-param name="Name" select="normalize-space(ItemName)"></xsl:with-param>
                    <xsl:with-param name="Description" select="normalize-space(Description)"></xsl:with-param>
                    <xsl:with-param name="ImageUrl" select="normalize-space(ImageURL)"></xsl:with-param>
                    <xsl:with-param name ="HostName" select="normalize-space(../HostName)"></xsl:with-param>
                    <xsl:with-param name ="FaceBookSrc" select="normalize-space(../FaceBookSrc)"></xsl:with-param>
                    <xsl:with-param name="TwitterSrc" select="normalize-space(../TwitterSrc)"></xsl:with-param>
                    <xsl:with-param name ="UserID" select="normalize-space(../UserID)"></xsl:with-param>
                    <xsl:with-param name ="TemplateURL" select="normalize-space(../TemplateURL)"></xsl:with-param>
                    <xsl:with-param name="RefValue" select="''"></xsl:with-param>
                </xsl:call-template>
            </xsl:for-each>-->
        </div>
    </xsl:template>
</xsl:stylesheet>
