<commit_before><template name="commentsBox">
    {{! We have not found any good way to include templates with the same context
        even when using Template.dynamic }}

    {{#if customTpl}}
        {{> customTpl }}
    {{else}}
        <div class="comments-box">
            {{#if templateIs 'bootstrap' }}
                <h3>{{ take key='title' default='Comments'}}</h3>

                {{#if loginAction}}
                    <div class="alert alert-warning" role="alert">You need to login to {{loginAction}}</div>
                {{/if}}

                {{> textarea }}

                <div class="media-list comments">
                    {{#each comment}}
                        {{> commentsSingleComment}}
                    {{/each}}
                </div>

                {{#if hasMoreComments}}
                    <button type="button" class="btn btn-success btn-lg btn-block loadmore-action">{{ take key='load-more' default='Load more comments' }}</button>
                {{/if}}
            {{/if}}

            {{#if templateIs 'semantic-ui' }}
                <div class="ui comments">
                    <h3 class="ui header">{{ take key='title' default='Comments'}}</h3>
                        {{#if loginAction}}
                            <div class="ui warning message">You need to login to {{loginAction}}</div>
                        {{/if}}

                        {{> textarea }}

                        {{#each comment}}
                            {{> commentsSingleComment }}
                        {{/each}}

                        {{#if hasMoreComments}}
                            <div class="ui fluid green loadmore-action button">{{ take key='load-more' default='Load more comments' }}</div>
                        {{/if}}
                </div>
            {{/if}}

            {{#if templateIs 'ionic' }}
                <h3>{{ take key='title' default='Comments'}}</h3>

                {{#if loginAction}}
                    <div class="bar bar-header bar-assertive">You need to login to {{loginAction}}</div>
                {{/if}}

                {{> textarea }}

                {{#each comment}}
                    {{> commentsSingleComment}}
                {{/each}}

                {{#if hasMoreComments}}
                    <button type="button" class="button button-block button-positive loadmore-action">{{ take key='load-more' default='Load more comments' }}</button>
                {{/if}}
            {{/if}}
        </div>
    {{/if}}
</template>

<template name="commentsSingleComment">
    {{#if templateIs 'semantic-ui' }}
        <div data-id="{{_id}}" class="comment">
            {{> avatar userId=userId }}
            <div class="content">
                <a class="author">{{user.displayName}}</a>
                <div class="metadata">
                    <span class="date">{{createdAgo}}</span>
                </div>
                <div class="text comment-content" data-id="{{commentId}}">
                    {{content}}
                </div>
                {{#if image}}
                    <div class="content-image">
                        <img src="{{image}}"/>
                    </div>
                {{/if}}
                <div class="actions">
                    <a class="rating unstyled-link like-action {{#if hasLiked}}active{{/if}}">
                        {{likesCount}}
                        <i class="angle up link icon"></i>
                    </a>

                    <a class="reply-action">{{ take key='reply' default='Reply' }}</a>
                    {{#if isOwnComment}}
                        {{#if isEditable}}
                            <a class="save-action">{{ take key='save' default='Save' }}</a>
                        {{else}}
                            <a class="edit-action">{{ take key='edit' default='Edit' }}</a>
                        {{/if}}
                    <a class="remove-action">{{ take key='remove' default='Remove' }}</a>
                    {{/if}}
                </div>
                <div class="create-reply">
                    {{#if addReply}}
                        {{> textarea reply=true scope=this }}
                    {{/if}}
                </div>

                {{#if reply}}
                    <div class="comments reply-wrapper">
                        {{#each reply}}
                            {{> commentsSingleComment }}
                        {{/each}}
                    </div>
                {{/if}}
            </div>
        </div>
    {{/if}}

    {{#if templateIs 'bootstrap' }}
        <div class="media">
            <div class="media-left">
                {{> avatar userId=userId class="" }}
            </div>
            <div class="media-body comment">
                <h4 class="media-heading">{{user.displayName}} <small>{{createdAgo}}</small></h4>
                <div class="content">
                    <p class="comment-content" data-id="{{commentId}}">{{content}}</p>

                    <div class="actions btn-group btn-group-xs">
                        <div class="btn {{#if hasLiked}}btn-primary{{else}}btn-default{{/if}} like-action" aria-label="Left Align">
                            <small>{{likesCount}}</small>
                            <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>
                        </div>

                        <div class="btn btn-default reply-action" aria-label="Left Align">
                            {{ take key='reply' default='Reply' }}
                        </div>

                        {{#if isOwnComment}}
                        {{#if isEditable}}
                        <div class="btn btn-default save-action" aria-label="Left Align">
                            {{ take key='save' default='Save' }}
                        </div>
                        {{else}}
                        <div class="btn btn-default edit-action" aria-label="Left Align">
                            {{ take key='edit' default='Edit' }}
                        </div>
                        {{/if}}
                        <div class="btn btn-danger remove-action" aria-label="Left Align">
                            {{ take key='remove' default='Remove' }}
                        </div>
                        {{/if}}
                    </div>
                </div>

                {{#if addReply}}
                    <div class="create-reply">
                        {{> textarea reply=true scope=this }}
                    </div>
                {{/if}}

                {{#if reply}}
                    {{#each reply}}
                        {{> commentsSingleComment }}
                    {{/each}}
                {{/if}}
            </div>
        </div>
    {{/if}}

    {{#if templateIs 'ionic' }}
        <div class="list card">
            <div class="item item-avatar">
                <img src='{{avatarUrl}}'>
                <p><small>{{createdAgo}}</small></p>
                <p><strong>{{user.displayName}}</strong></p>
            </div>

            <div class="item item-body comment">
                <p class="comment-content" data-id="{{commentId}}">{{content}}</p>

                <div class="actions">
                    <div class="button-bar">
                        <a class="button button-clear {{#if hasLiked}}button-positive{{/if}} icon-left ion-thumbsup like-action">
                            {{likesCount}}
                        </a>

                        <div class="button button-clear ion-reply reply-action">
                            {{ take key='reply' }}
                        </div>

                        {{#if isOwnComment}}
                        {{#if isEditable}}
                        <div class="button button-clear ion-archive save-action">
                            {{ take key='save' }}<commit_msg>Add `{{#markdown}}` around comment text.<commit_after><template name="commentsBox">
    {{! We have not found any good way to include templates with the same context
        even when using Template.dynamic }}

    {{#if customTpl}}
        {{> customTpl }}
    {{else}}
        <div class="comments-box">
            {{#if templateIs 'bootstrap' }}
                <h3>{{ take key='title' default='Comments'}}</h3>

                {{#if loginAction}}
                    <div class="alert alert-warning" role="alert">You need to login to {{loginAction}}</div>
                {{/if}}

                {{> textarea }}

                <div class="media-list comments">
                    {{#each comment}}
                        {{> commentsSingleComment}}
                    {{/each}}
                </div>

                {{#if hasMoreComments}}
                    <button type="button" class="btn btn-success btn-lg btn-block loadmore-action">{{ take key='load-more' default='Load more comments' }}</button>
                {{/if}}
            {{/if}}

            {{#if templateIs 'semantic-ui' }}
                <div class="ui comments">
                    <h3 class="ui header">{{ take key='title' default='Comments'}}</h3>
                        {{#if loginAction}}
                            <div class="ui warning message">You need to login to {{loginAction}}</div>
                        {{/if}}

                        {{> textarea }}

                        {{#each comment}}
                            {{> commentsSingleComment }}
                        {{/each}}

                        {{#if hasMoreComments}}
                            <div class="ui fluid green loadmore-action button">{{ take key='load-more' default='Load more comments' }}</div>
                        {{/if}}
                </div>
            {{/if}}

            {{#if templateIs 'ionic' }}
                <h3>{{ take key='title' default='Comments'}}</h3>

                {{#if loginAction}}
                    <div class="bar bar-header bar-assertive">You need to login to {{loginAction}}</div>
                {{/if}}

                {{> textarea }}

                {{#each comment}}
                    {{> commentsSingleComment}}
                {{/each}}

                {{#if hasMoreComments}}
                    <button type="button" class="button button-block button-positive loadmore-action">{{ take key='load-more' default='Load more comments' }}</button>
                {{/if}}
            {{/if}}
        </div>
    {{/if}}
</template>

<template name="commentsSingleComment">
    {{#if templateIs 'semantic-ui' }}
        <div data-id="{{_id}}" class="comment">
            {{> avatar userId=userId }}
            <div class="content">
                <a class="author">{{user.displayName}}</a>
                <div class="metadata">
                    <span class="date">{{createdAgo}}</span>
                </div>
                <div class="text comment-content" data-id="{{commentId}}">
                    {{#markdown}}
                    {{content}}
                    {{/markdown}}
                </div>
                {{#if image}}
                    <div class="content-image">
                        <img src="{{image}}"/>
                    </div>
                {{/if}}
                <div class="actions">
                    <a class="rating unstyled-link like-action {{#if hasLiked}}active{{/if}}">
                        {{likesCount}}
                        <i class="angle up link icon"></i>
                    </a>

                    <a class="reply-action">{{ take key='reply' default='Reply' }}</a>
                    {{#if isOwnComment}}
                        {{#if isEditable}}
                            <a class="save-action">{{ take key='save' default='Save' }}</a>
                        {{else}}
                            <a class="edit-action">{{ take key='edit' default='Edit' }}</a>
                        {{/if}}
                    <a class="remove-action">{{ take key='remove' default='Remove' }}</a>
                    {{/if}}
                </div>
                <div class="create-reply">
                    {{#if addReply}}
                        {{> textarea reply=true scope=this }}
                    {{/if}}
                </div>

                {{#if reply}}
                    <div class="comments reply-wrapper">
                        {{#each reply}}
                            {{> commentsSingleComment }}
                        {{/each}}
                    </div>
                {{/if}}
            </div>
        </div>
    {{/if}}

    {{#if templateIs 'bootstrap' }}
        <div class="media">
            <div class="media-left">
                {{> avatar userId=userId class="" }}
            </div>
            <div class="media-body comment">
                <h4 class="media-heading">{{user.displayName}} <small>{{createdAgo}}</small></h4>
                <div class="content">
                    <p class="comment-content" data-id="{{commentId}}">{{#markdown}}{{content}}{{/markdown}}</p>

                    <div class="actions btn-group btn-group-xs">
                        <div class="btn {{#if hasLiked}}btn-primary{{else}}btn-default{{/if}} like-action" aria-label="Left Align">
                            <small>{{likesCount}}</small>
                            <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>
                        </div>

                        <div class="btn btn-default reply-action" aria-label="Left Align">
                            {{ take key='reply' default='Reply' }}
                        </div>

                        {{#if isOwnComment}}
                        {{#if isEditable}}
                        <div class="btn btn-default save-action" aria-label="Left Align">
                            {{ take key='save' default='Save' }}
                        </div>
                        {{else}}
                        <div class="btn btn-default edit-action" aria-label="Left Align">
                            {{ take key='edit' default='Edit' }}
                        </div>
                        {{/if}}
                        <div class="btn btn-danger remove-action" aria-label="Left Align">
                            {{ take key='remove' default='Remove' }}
                        </div>
                        {{/if}}
                    </div>
                </div>

                {{#if addReply}}
                    <div class="create-reply">
                        {{> textarea reply=true scope=this }}
                    </div>
                {{/if}}

                {{#if reply}}
                    {{#each reply}}
                        {{> commentsSingleComment }}
                    {{/each}}
                {{/if}}
            </div>
        </div>
    {{/if}}

    {{#if templateIs 'ionic' }}
        <div class="list card">
            <div class="item item-avatar">
                <img src='{{avatarUrl}}'>
                <p><small>{{createdAgo}}</small></p>
                <p><strong>{{user.displayName}}</strong></p>
            </div>

            <div class="item item-body comment">
                <p class="comment-content" data-id="{{commentId}}">{{#markdown}}{{content}}{{/markdown}}</p>

                <div class="actions">
                    <div class="button-bar">
                        <a class="button button-clear {{#if hasLiked}}button-positive{{/if}} icon-left ion-thumbsup like-action">
                            {{likesCount}}
                        </a>

                        <div class="button button-clear ion-reply reply-action">
                            {{ take key='reply' }}
                        </div>

                        {{#if isOwnComment}}
                        {{#if isEditable}}
                        <div class="button button-clear ion-archive save-action">
                            {{ take key='save' }}
{'fraction_non_alphanumeric': 0.15484358280355007, 'fraction_numerical': 0.0010071127336816264, 'mean_word_length': 1.1531372814744545, 'pattern_counts': {'":': 0, '<': 231, '<?xml version=': 0, '>': 257, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1024438', 'n_tokens_mistral': 4097, 'n_tokens_neox': 3735, 'n_words': 854}