<commit_before><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
    xmlns="http://www.w3.org/1999/xhtml" 
    version="1.0">
    
    <xsl:template match="field[@name='comments'][ancestor::component[@class='BlogPost'][@type='form']]">
        <!-- <a class="comment_link" href="#">Комментировать</a>  -->

        <xsl:if test="not(recordset[@empty])">
			<xsl:variable name="IS_SHOW_COMMENT_LINK"><xsl:if test="@is_tree='1' and @is_editable='1'">1</xsl:if></xsl:variable>
           
            <div class="comments">
                Комментарии (<span><xsl:value-of select="count(recordset/record)"/></span>)
                <ul>
                    <xsl:for-each select="recordset/record">
                       <li id="{field[@name='comment_id']}_comment">
                            <xsl:if test="field[@name='u_avatar_img'] != ''">
                                <img width="50" height="50" src="{field[@name='u_avatar_img']}" />
                            </xsl:if>
                            <span><xsl:value-of select="field[@name='comment_created']"/> - <xsl:value-of select="field[@name='u_fullname']"/></span>
                            <p><xsl:value-of select="field[@name='comment_name']"/></p>
                            <!-- a class="edit" href="{$BASE}{$LANG_ABBR}tvslot-editor/{field[@name='tvslot_id']}/edit">Edit</a -->
                            <xsl:apply-templates select="recordset"/>
                            
                            <xsl:if test="$IS_SHOW_COMMENT_LINK">
                                <span><a href="#">Комментировать</a></span>
                            </xsl:if>
                       </li>
                    </xsl:for-each>
                </ul>
            </div>
       </xsl:if>
    </xsl:template>

</xsl:stylesheet><commit_msg>blog - comments: fix tree view<commit_after><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
    xmlns="http://www.w3.org/1999/xhtml" 
    version="1.0">
    
    <xsl:template match="field[@name='comments'][ancestor::component[@class='BlogPost'][@type='form']]">

        <xsl:if test="not(recordset[@empty])">
			<xsl:variable name="IS_SHOW_COMMENT_LINK"><xsl:if test="@is_tree='1' and @is_editable='1'">1</xsl:if></xsl:variable>
           
            <div class="comments">
                Комментарии (<span><xsl:value-of select="count(recordset/record)"/></span>)
                <ul>
                    <xsl:call-template name="COMMENT">
                        <xsl:with-param name="recordset" select="./recordset" />
                        <xsl:with-param name="IS_SHOW_COMMENT_LINK" select="$IS_SHOW_COMMENT_LINK" />                      
                    </xsl:call-template>
                </ul>
            </div>
       </xsl:if>
    </xsl:template>

    <xsl:template name="COMMENT">
        <xsl:param name="recordset" />
        <xsl:param name="IS_SHOW_COMMENT_LINK" />
        <xsl:for-each select="recordset/record">
           <li id="{field[@name='comment_id']}_comment">
                <xsl:if test="field[@name='u_avatar_img'] != ''">
                    <img width="50" height="50" src="{field[@name='u_avatar_img']}" alt="" />
                </xsl:if>
                <span>
                    <xsl:value-of select="field[@name='comment_created']"/> - <xsl:value-of select="field[@name='u_fullname']"/>
                </span>
                <p>
                    <xsl:value-of select="field[@name='comment_name']"/>
                </p>

                <xsl:if test="$IS_SHOW_COMMENT_LINK">
                    <span><a href="#">Комментировать</a></span>
                </xsl:if>

                <xsl:if test="recordset">
                    <ul>
                        <xsl:call-template name="COMMENT">
                            <xsl:with-param name="recordset" select="./recordset" />
                            <xsl:with-param name="IS_SHOW_COMMENT_LINK" select="$IS_SHOW_COMMENT_LINK" />
                        </xsl:call-template>
                    </ul>
                </xsl:if>
           </li>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.18404907975460122, 'fraction_numerical': 0.010382255781028787, 'mean_word_length': 1.7651663405088063, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 2, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1550185', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1265, 'n_words': 148}