<commit_before><% node_url = function(node, parent) {
    var url = '';
    switch (parseInt(node.node_type_id)) {
        case 1:
            url = '/#/projects/' + node.node_id + '/view';
            break;
        case 2:
            url = '/#/projects/' + project_id + '/testsuites/' + node.node_id + '/view';
            break;
        case 3:
            url = '/#/projects/' + project_id + '/testsuites/' + parent.node_id + '/testcases/' + node.node_id + '/view';
            break;
        default:
            url = '/';
            break;
    }
    return url;
} %>

<% fn = function(node, parent) { %>
<div class='item'>
    <i class="folder icon"></i>
    <div class="content">
        <a href="<%= node_url(node, parent) %>" data-node-type-id='<%= node.node_type_id %>' data-node-id='<%= node.node_id %>'>
            <%= node.display_name %>
        </a>
        <% 
        var children = node.children;
        if (children.length > 0) { %>
        <div class="list">
            <% for (var i = 0; i < children.length; i++) {
                fn(children[i], node);
            } %>
        </div>
        <% } %>
    </div>
</div>
<% } %>

<% fn(items, {}); %><commit_msg>Fix issue #93 custom icons for nodes<commit_after><% node_url = function(node, parent) {
    var url = '';
    switch (parseInt(node.node_type_id)) {
        case 1:
            url = '/#/projects/' + node.node_id + '/view';
            break;
        case 2:
            url = '/#/projects/' + project_id + '/testsuites/' + node.node_id + '/view';
            break;
        case 3:
            url = '/#/projects/' + project_id + '/testsuites/' + parent.node_id + '/testcases/' + node.node_id + '/view';
            break;
        default:
            url = '/';
            break;
    }
    return url;
} %>

<% node_icon = function(node) {
    var icon = '';
    switch (parseInt(node.node_type_id)) {
        case 1:
            icon = 'book icon';
            break;
        case 2:
            icon = 'folder open icon';
            break;
        case 3:
            icon = 'file text outline icon';
            break;
        default:
            icon = 'folder icon';
            break;
    }
    return icon;
} %>

<% fn = function(node, parent) { %>
<div class='item'>
    <i class="<%= node_icon(node) %>"></i>
    <div class="content">
        <a href="<%= node_url(node, parent) %>" data-node-type-id='<%= node.node_type_id %>' data-node-id='<%= node.node_id %>'>
            <%= node.display_name %>
        </a>
        <% 
        var children = node.children;
        if (children.length > 0) { %>
        <div class="list">
            <% for (var i = 0; i < children.length; i++) {
                fn(children[i], node);
            } %>
        </div>
        <% } %>
    </div>
</div>
<% } %>

<% fn(items, {}); %>
{'fraction_non_alphanumeric': 0.18719037508846426, 'fraction_numerical': 0.005307855626326964, 'mean_word_length': 1.5723384895359418, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '5009988', 'n_tokens_mistral': 959, 'n_tokens_neox': 901, 'n_words': 203}