<commit_before>Oro = Oro || {};
Oro.Tags = Oro.Tags || {};

Oro.Tags.TagView =  Backbone.View.extend({
    options: {
        filter: null
    },

    /** @property */
    template: _.template(
        '<ul id="tag-list" class="inline">' +
            '<% _.each(models, function(tag, i) { %>' +
                '<li data-id="<%= tag.get("id") %>">' +
                    '<% if (tag.get("url").length > 0) { %>' +
                        '<a href="<%= tag.get("url") %>">' +
                    '<%} %>' +
                        '<span class="label label-info"><%= tag.get("name") %></span>' +
                    '<% if (tag.get("url").length > 0) { %>' +
                        '</a>' +
                    '<%} %>' +
                '</li>' +
            '<%}) %>' +
            '<% if (models.length == 0) { %>' +
                _.__('There are no tags yet') +
            '<%} %>' +
        '</ul>'
    ),

    /**
     * Constructor
     */
    initialize: function() {
        this.collection = new Oro.Tags.TagCollection();
        this.listenTo(this.getCollection(), 'reset', this.render);
        this.listenTo(this, 'filter', this.render);

        // process filter action binding
        $('#tag-sort-actions a').click(_.bind(this.filter, this));
    },

    /**
     * Filter collection proxy
     *
     * @returns {*}
     */
    filter: function(e) {
        var $el = $(e.target);

        // clear all active links
        $el.parents('ul').find('a.active').removeClass('active');
        // make current filter active
        $el.addClass('active');

        this.options.filter = $el.data('type');
        this.trigger('filter');

        return this;
    },

    /**
     * Get collection object
     *
     * @returns {*}
     */
    getCollection: function() {
        return this.collection;
    },

    /**
     * Render widget
     *
     * @returns {}
     */
    render: function() {
        $('#tags-holder').html(
            this.template(this.getCollection().getFilteredCollection(this.options.filter))
        );
        // process tag click redirect
        if (Oro.hashNavigationEnabled()) {
            Oro.hashNavigationInstance.processClicks($('#tag-list a'));
        }

        return this;
    }
});
<commit_msg>BAP-1482: Change message on empty Tag fields  - changed message<commit_after>Oro = Oro || {};
Oro.Tags = Oro.Tags || {};

Oro.Tags.TagView =  Backbone.View.extend({
    options: {
        filter: null
    },

    /** @property */
    template: _.template(
        '<ul id="tag-list" class="inline">' +
            '<% _.each(models, function(tag, i) { %>' +
                '<li data-id="<%= tag.get("id") %>">' +
                    '<% if (tag.get("url").length > 0) { %>' +
                        '<a href="<%= tag.get("url") %>">' +
                    '<%} %>' +
                        '<span class="label label-info"><%= tag.get("name") %></span>' +
                    '<% if (tag.get("url").length > 0) { %>' +
                        '</a>' +
                    '<%} %>' +
                '</li>' +
            '<%}) %>' +
            '<% if (models.length == 0) { %>' +
                _.__('Not tagged') +
            '<%} %>' +
        '</ul>'
    ),

    /**
     * Constructor
     */
    initialize: function() {
        this.collection = new Oro.Tags.TagCollection();
        this.listenTo(this.getCollection(), 'reset', this.render);
        this.listenTo(this, 'filter', this.render);

        // process filter action binding
        $('#tag-sort-actions a').click(_.bind(this.filter, this));
    },

    /**
     * Filter collection proxy
     *
     * @returns {*}
     */
    filter: function(e) {
        var $el = $(e.target);

        // clear all active links
        $el.parents('ul').find('a.active').removeClass('active');
        // make current filter active
        $el.addClass('active');

        this.options.filter = $el.data('type');
        this.trigger('filter');

        return this;
    },

    /**
     * Get collection object
     *
     * @returns {*}
     */
    getCollection: function() {
        return this.collection;
    },

    /**
     * Render widget
     *
     * @returns {}
     */
    render: function() {
        $('#tags-holder').html(
            this.template(this.getCollection().getFilteredCollection(this.options.filter))
        );
        // process tag click redirect
        if (Oro.hashNavigationEnabled()) {
            Oro.hashNavigationInstance.processClicks($('#tag-list a'));
        }

        return this;
    }
});

{'fraction_non_alphanumeric': 0.1942919868276619, 'fraction_numerical': 0.0021953896816684962, 'mean_word_length': 1.5480984340044743, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 45, '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': '1886804', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1344, 'n_words': 233}