﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="WizardButtons.xslt"/>
    <xsl:include href="GenericTemplates/Notes_LineBreak.xslt"/>

    <xsl:template match="/">
        <input id="templateXML" type="hidden" value="&lt;Templates&gt;&lt;/Templates&gt;" ></input>
        <xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>


        <xsl:call-template name="WizardButtons">
            <xsl:with-param name="TemplatePathURL" select="normalize-space(AjaxRequest/TemplateURL)"></xsl:with-param>
            <xsl:with-param name="Source" select="normalize-space(AjaxRequest/Params/Orgin)"></xsl:with-param>
            <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
        </xsl:call-template>

        <table style="margin-top:10px;">

            <tr>
                <td>
                    <div style="margin-bottom:20px;">
                        <img src="{normalize-space(AjaxRequest/TemplateURL)}Web/Images/AdPerson_Right.jpg" height="150px" title="Register_Girl" BORDER="0"></img>
                    </div>
                </td>
                <td>
                    <div id="divHeader">
                        <span class="labelSize14">
                            Step 2 of 4 - Your Action Plan for the Year.
                        </span>
                    </div>
                    <div >
                        <span class="labelSize13">
                            “Excellent!  So now, let’s start to think about what you will need to get accomplished this year in order to stay on track. You can select from the Recommended Goal Templates as well as enter your own custom goals.”
                        </span>
                    </div>
                </td>
            </tr>

            <xsl:for-each select="AjaxRequest/LifeSpaces/LifeSpace[ItemPermissionID &gt; 0 or TypeID = 2 or count(Goals/Goal) &gt; 0]">
                <tr>
                    <td>
                        <div align="center">
                            <a class="link" href="http://{$HostName}/LifeSpace.aspx?ID={ItemID}" target="_blank">
                                <xsl:choose>
                                    <xsl:when test="ItemID > 6">
                                        <img src="http://{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/LifeSpace LLC.jpg"
                                             style="border:0px;" height="80px"></img>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <img src="http://{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/{normalize-space(Item)}.jpg"
                                                                                     style="border:0px;" height="80px"></img>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </a>
                        </div>
                        <div align="center">
                            <a class="linkHeader" href="http://{$HostName}/LifeSpace.aspx?ID={ItemID}" target="_blank">
                                <xsl:value-of select="Item"/>
                            </a>
                        </div>
                    </td>
                    <td>

                        <div id="divEditDiscription_{ItemID}" class ="label" style="display:block;">
                            <xsl:if test ="Description != ''">
                                <span id="spanLifeSpaceDiscription_{ItemID}">
                                    <!--<xsl:value-of select="Description"/>-->
                                    <xsl:call-template name="break">
                                        <xsl:with-param name="text" select="Description"></xsl:with-param>
                                    </xsl:call-template>
                                </span>
                                <span style="color:gray;">
                                    &#xa0;<xsl:value-of select ="CreatedDate"/>
                                </span>
                                <span class="link" onclick="Plan_flipdiscriptionDiv('divEditDiscription_{ItemID}', 'divUpdateDiscription_{ItemID}');" style="color:gray;">
                                    (Edit)
                                </span>
                            </xsl:if>
                        </div>
                        <div  id="divUpdateDiscription_{ItemID}"  class ="label" style="display:none;">
                            <!--<input id="inputDiscription_{ItemID}" type="text" style="width:100%;" value="{Description}">

                            </input>-->
                            <textarea id="inputDiscription_{ItemID}" rows="2" class="textAreaBox" style="border: 2px solid black;">
                                <xsl:value-of select="Description"/>
                            </textarea>

                            <div style="padding-top:5px">
                                <span
                                        class="button"
                                        onclick="Plan_saveLifespaceDreamText('divUpdateDiscription_{ItemID}', 'divEditDiscription_{ItemID}', 'inputDiscription_{ItemID}', 'spanLifeSpaceDiscription_{ItemID}', {ItemID});">
                                    Save
                                </span>&#xa0;
                                <span
                                      class="button"
                                      onclick="Plan_flipdiscriptionDiv('divUpdateDiscription_{ItemID}' , 'divEditDiscription_{ItemID}');">
                                    Cancel
                                </span>
                            </div>
                        </div>

                        <div style="margin-top:15px;">
                            <span class="labelSize11" style="color:black;">
                                What are Your Goals?
                            </span>
                        </div>

                        <div id="div_Goals_{ItemID}" style="margin-left:5px; ">
                            <xsl:for-each select="Goals/Goal">
                                <div style="color: rgb(55, 96, 146);">
                                    <a class="linkHeader" href="http://{$HostName}/Goal.aspx?ID={ItemID}" target="_blank">
                                        <xsl:value-of select="Item"/>
                                    </a>
                                </div>
                            </xsl:for-each>
                        </div>

                        <div style="padding-top:15px;">
                            <xsl:for-each select="Template">
                                <div class="label">
                                    <input id="chk_LifeSpace_Template_{ItemID}" type="checkbox" name="cbTemplate" ItemID="-1"
                                           onclick="plan_SaveTemplateActivateGoal('chk_LifeSpace_Template_{ItemID}',{ItemID},{../ItemID}, '', 'aTemplate{ItemID}_LifeSpace{../ItemID}');"></input>
                                    <!--<input id="chk_LifeSpace_Template_{ItemID}" type="checkbox" name="cbTemplate"
                                           onclick="checkTemplateXML('chk_LifeSpace_Template_{ItemID}',{ItemID},{../ItemID}, '{Name}', 'aTemplate{ItemID}_LifeSpace{../ItemID}');"></input>-->
                                    <a class="linkHeader" id="aTemplate{ItemID}_LifeSpace{../ItemID}" href="http://{$HostName}/{PromoteKey}" target="_blank">
                                        <xsl:value-of select="Name"/>
                                    </a>
                                    <div id="div_AddTemplate_{ItemID}_{../ItemID}">
                                    </div>
                                </div>
                            </xsl:for-each>
                        </div>
                        <xsl:choose>
                            <xsl:when test="ItemPermissionID &gt; 0 or TypeID = 2">
                              <div style="padding-top:5px; margin-left:5px;">
                            <div id ="div_AddNewGoal_{ItemID}" ></div>
                            <input id ="input_AddNewGoal_{ItemID}" type="text" name="txtAddGoal" class="textAreaNotes" value=" Add new goal here…" onclick="createNewGoal({ItemID},  'div_AddNewGoal_{ItemID}', 'PlanPage','');"></input>
                        </div>  
                            </xsl:when>
                        </xsl:choose>
                        
                    </td>
                </tr>

                <tr>
                    <td colspan="2">
                        <div class="seperatorLine"></div>
                    </td>
                </tr>
            </xsl:for-each>

        </table>
        <div align="right">
            <!--<input type="button" onclick="plan_Save('templateXML');" value="Continue" class="button"></input>-->
            <a class ="link" href="http://{$HostName}/CommunityWizard.aspx">
                <!--<img src="{normalize-space(AjaxRequest/TemplateURL)}Web/Images/BtnContinue.png" title="ContinueButton" style="cursor: pointer;"
                  onClick="plan_Save('templateXML');"></img>-->
                <img src="{normalize-space(AjaxRequest/TemplateURL)}Web/Images/BtnContinue.png" title="ContinueButton" style="cursor: pointer; border:0px;"></img>
            </a>
        </div>
    </xsl:template>
</xsl:stylesheet>
