﻿<?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:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xsl:variable name="ThisPeriodKey" select="AjaxRequest/ThisPeriodKey"></xsl:variable>
        <xsl:variable name="LastPeriodKey" select="AjaxRequest/LastPeriodKey"></xsl:variable>
        <xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalID"></xsl:variable>
        
        <table class="tableMaster" cellpadding="0" cellspacing="0">
            <tr>
                <td width="70%">
                    <div id="div_Portal_{$PortalItemID}_NumberGraph_Dashboard">
                        
                    </div>
                </td>
                <td width="30%">
                    <div class="marginBottom10">
                        <span class="marginRight10 userName" style="cursor:default;">Team Members</span>
                        <select class="smallDropdown sentenceFont" id="ddl_{$PortalItemID}_Employees" style="width:120px;">
                            <option value="-1">
                                <xsl:text>All</xsl:text>
                            </option>
                            <xsl:for-each select="AjaxRequest/PermissionXML/Permission">
                                <option value="{UserID}">
                                    <xsl:value-of select="DisplayName"/>
                                </option>
                            </xsl:for-each>
                        </select>
                    </div>
                    <div class="marginBottom10">
                        <span style="margin-right:44px;cursor:default;" class="userName">Measure</span>
                        <select class="smallDropdown sentenceFont" id="ddl_{$PortalItemID}_MetricKeys" style="width:120px;">
                            <xsl:for-each select="AjaxRequest/PortalMetrics/Metrics">
                                <xsl:choose>
                                    <xsl:when test="DefaultYN = 1">
                                        <option value="{PortalMetricID}" selected="selected">
                                            <xsl:value-of select="MetricKey"/>&#xa0;(<xsl:value-of select="PeriodType"/>)
                                        </option>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <option value="{PortalMetricID}">
                                            <xsl:value-of select="MetricKey"/>&#xa0;(<xsl:value-of select="PeriodType"/>)
										</option>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </xsl:for-each>
                        </select>
                    </div>
                    <div class="marginBottom10">
                        <span style="margin-right:65px;cursor:default;" class="userName">Year</span>
                        <select class="smallDropdown" id="ddl_{$PortalItemID}_Year">
                            <option value="{$ThisPeriodKey}">
                                <xsl:value-of select="$ThisPeriodKey"/>
                            </option>
                            <option value="{$LastPeriodKey}">
                                <xsl:value-of select="$LastPeriodKey"/>
                            </option>
                        </select>
                    </div>
                  <div>
                    <span class="onMouseOver actionCountText divBrowseGradient" style="display:inline;color:white;padding-right:10px;padding-left:10px;padding-top:2px;padding-bottom:2px;"
                 onClick="LoadDashboardSelectedGraphData('ddl_{$PortalItemID}_Employees', 'ddl_{$PortalItemID}_MetricKeys', '-1', '{$PortalItemID}', 
                                              'div_Portal_{$PortalItemID}_NumberGraph_Dashboard','ddl_{$PortalItemID}_Year',0,12,1,'DashboardNumberGraph','');">Go</span>
                  </div>
                </td>
            </tr>        
        </table>
    </xsl:template>
</xsl:stylesheet>
