﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:import href="../Version_2_0/ModuleHeaders.xslt"/>

    <xsl:template match="/">
        <xsl:variable name="ItemID" select="normalize-space(AjaxRequest/Params/ItemID)" />
        <xsl:variable name="TemplateURL" select="normalize-space(AjaxRequest/TemplateURL)"/>
        <xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"/>                     

        <xsl:variable name="CommunitesCount">
            <xsl:if test="normalize-space(AjaxRequest/CommunitiesCount) &gt; 0">
                <xsl:value-of select="normalize-space(AjaxRequest/CommunitiesCount)"></xsl:value-of>                   
            </xsl:if>
        </xsl:variable>

        <xsl:variable name="NotificationCount">
            <xsl:if test="normalize-space(AjaxRequest/NotificationCount) &gt; 0">
                <xsl:value-of select="normalize-space(AjaxRequest/NotificationCount)"></xsl:value-of>
            </xsl:if>
        </xsl:variable>

        <xsl:variable name="GoalCount">
            <xsl:if test="normalize-space(AjaxRequest/GoalCount) &gt; 0">
                <xsl:value-of select="normalize-space(AjaxRequest/GoalCount)"></xsl:value-of>
            </xsl:if>
        </xsl:variable>

        <table class="tableMaster" cellspacing="0" cellpadding="0">
            <tr>
                <td>                  
                    <xsl:call-template name="moduleHeadersTemplate">
                        <xsl:with-param name="Header">
                            <xsl:text>My Goals</xsl:text>
                        </xsl:with-param>
                        <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                        <xsl:with-param name="Count" select="$GoalCount"></xsl:with-param>
                    </xsl:call-template>
                
                </td>
            </tr>
            <tr>
                <td>                 
                    <div id="div_AddNewGoal" name="PortalMenuOption" style="padding-top:5px;padding-left:10px;padding-bottom:5px;" 
                         onmouseover="document.getElementById('div_AddNewGoal').className='moduleSubHeaderOptionHover';"
                         onmouseout="document.getElementById('div_AddNewGoal').className='moduleSubHeaderOption';"
                         onclick="portal_HighlightSelectedOption('{$ItemID}','div_AddGoal','#58595B');">
                        <a href="http://{$HostName}/CreateGoal.aspx?ID={$ItemID}" style="color: #A7A9AC;" 
                           class="moduleSubHeaderOption decorationNone paddingLeft20">
                            + Add New Goal
                        </a>
                    </div>               
                </td>
            </tr>
            <tr>
                <td>
                    <div>                       
                        <span class="onMouseOver" onClick = "return Portal_Mycommunities({$ItemID},'DivPortal_MyCommunities');">
                            <xsl:call-template name="moduleHeadersTemplate">
                                <xsl:with-param name="Header">
                                    <xsl:text>My Communities</xsl:text>
                                </xsl:with-param>
                                <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                                <xsl:with-param name="Count" select="$CommunitesCount"></xsl:with-param>
                            </xsl:call-template>                          
                        </span>
                        <div id="DivPortal_MyCommunities" style="padding-top:5px;display:none;">
                        </div>
                    </div>
                </td>
            </tr>           
            <tr>
                <td>                  
                    <a href="http://{$HostName}/Notifications.aspx" class="decorationNone">
                        <xsl:call-template name="moduleHeadersTemplate">
                            <xsl:with-param name="Header">
                                <xsl:text>My Notifications</xsl:text>
                            </xsl:with-param>
                            <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                            <xsl:with-param name="Count" select="$NotificationCount"></xsl:with-param>
                        </xsl:call-template>                       
                    </a>
                </td>
            </tr>
        </table>
    </xsl:template>
</xsl:stylesheet>