﻿<?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/TimeStamp.xslt" />
    <xsl:include href="GenericTemplates/Notes_LineBreak.xslt" />
    

    <xsl:template match="/" name ="CommentsTemplate">

        <div id="div_Item_{normalize-space(CommentData/NoteItemID)}"
             style="margin-top: 2px; margin-left: 30px; padding-left: 10px; padding-top: 3px; padding-bottom: 3px; 
                 width: 87%; background-color: rgb(236, 239, 248);">
            <div>
                <span class="commentsFrom_Bold">
                    <xsl:value-of select ="normalize-space(CommentData/UserName)"/>
                </span>
                &#xa0;
                <span class="labelSmall">
                    <xsl:call-template name="break">
                        <xsl:with-param name="text" select="CommentData/Comments"></xsl:with-param>
                    </xsl:call-template>
                </span>
            </div>
            <div>
                <xsl:if test="normalize-space(CommentData/CanDelete) = 1">
                    <a onclick="return comment_Delete('div_Item_{normalize-space(CommentData/NoteItemID)}', 
                                                '{normalize-space(CommentData/NoteItemID)}', 
                                                '{normalize-space(CommentData/ParentID)}', 
                                                '{normalize-space(CommentData/ConvertYN)}')"
                          style="font-size: 9pt;" class="link">Delete</a>
                </xsl:if>

                <xsl:variable name="MyRating">
                    <xsl:choose>
                        <xsl:when test="normalize-space(CommentData/Mine) = 1">
                            <xsl:text>MyRating</xsl:text>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:text>OthersRating</xsl:text>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
            </div>
        </div>
    </xsl:template>
</xsl:stylesheet>