﻿<?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 name="PriorWorkoutExercise">
        <xsl:param name="PriorWorkoutExercisesXML" select="'N/A'"></xsl:param>
        <xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
        <xsl:param name="WorkoutItemID" select="'N/A'"></xsl:param>
        <xsl:param name="AccountID" select="'N/A'"></xsl:param>

        <table class="tableMaster marginTop10" cellpadding="1" cellspacing="5">
            <tr>
                <td width="2%">
                </td>
                <td width="32%">
                    <span class="brandTitle">Exercises from Prior Workouts</span>
                </td>
                <td width="20%"></td>
                <td width="20%" class="textRight">
                    <span class="brandTitle">Last Workout</span>
                </td>
                <td width="5%">

                </td>
                <td width="5%">

                </td>
            </tr>
            <xsl:for-each select="$PriorWorkoutExercisesXML/PriorWorkoutExercise">
                <tr>
                    <td>
                        <div id="div_AddExerciseButton" class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray"
                            style="width:35px;line-height:20px;text-align:center;"
                            onclick="Workout_AddPriorExerciseToWorkout('{ExerciseID}','{$PortalItemID}','{ExerciseName}','{$WorkoutItemID}','{$AccountID}');">
                            <span id="span_Cancel" class="capitalFont">Add</span>
                        </div>
                    </td>
                    <td>
                        <span class="label" style="font-size:17px;color:#58595B">
                            <xsl:value-of select="ExerciseName"/>
                        </span>
                    </td>
                    <td>
                    </td>
                    <td class="textRight">
                        <span class="label" style="font-size:17px;color:#58595B">
                            <xsl:choose>
                                <xsl:when test="RepsTotal">
                                    <xsl:value-of select="RepsTotal"/> Reps
                                </xsl:when>
                                <xsl:when test="LevelTotal">
                                    <xsl:value-of select="LevelTotal"/> Levels
                                </xsl:when>
                                <xsl:when test="TimeTotal">
                                    <xsl:value-of select="TimeTotal"/> Secs
                                </xsl:when>
                                <xsl:when test="WeightTotal">
                                    <xsl:value-of select="WeightTotal"/> Gram
                                </xsl:when>
                                <xsl:when test="DistanceTotal">
                                    <xsl:value-of select="DistanceTotal"/> Miles
                                </xsl:when>
                                <xsl:when test="CaloriesTotal">
                                    <xsl:value-of select="CaloriesTotal"/> Cals
                                </xsl:when>
                            </xsl:choose>
                        </span>
                    </td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>
