<commit_before>{% extends "modelview/base.html" %}
{% load bootstrap3 %}
{% load staticfiles %}
{% load modelview_extras %}
{% load dataedit.taghandler %}
{% block after-header %}
<link rel="stylesheet" href="{% static 'css/mv-style.css' %}">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
{% endblock %}

{% block factsheets_content %}
<h3>{{label}} Factsheets <a class="btn btn-add btn-circle glyphicon glyphicon-plus" style="padding:0" href="add"></a> </h3> <br>

<style>
    .btn-add{
    background: transparent;
    color: green;
}
    input[type="checkbox"]:checked+label{
    font-weight: bold;
    border: 3px solid;
}
</style>

{% if label == 'Model' or label == 'Framework' %}
<div>
    <h4>Filter</h4>
    <div>
    You can filter the attributes to compare the models by clicking the categories below. If you only want to compare a selection of models you can filter them by using the colored tags below.
    </div>
    <div class="checkbox-container">
    {% for heading,d in fields.items %}
        <div class="checkbox-item">
            <div class="panel-heading">
              <h4 class="panel-title">
                <a class="fill-div" data-toggle="collapse" href="#{{heading.split|join:'_'}}">{{heading}}</a>
              </h4>
            </div>

            <div id="{{heading.split|join:'_'}}" class="panel-collapse collapse">
                <table class="table">
                    {% for key,value in d.items %}
                        <tr>
                            <th><label for="{{key}}">{{key}}</label></th>
                            <td><input type="checkbox" onchange="apply_filter(event.target)" id="{{key}}" {% if key.split|join:'_' in default %} checked="checked" {%endif %}></td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
    {% endfor %}
    </div>
</div>
<hr>

	<div>
            <h4>Select tag filter:</h4>
            <div>
                You can select models by chosing one or more tags. If you want to tag models you can set tags by editing the model. You can also define a new tag and add that to the group of models that you want to compare. You can also <a href="/dataedit/tags">define a new tag</a>.
            </div>
            <div class="well">
                {% for t in tags %}
                <span>
                    <input onchange="apply_tag_filter(event.target)" type="checkbox" class="hidden" name="select_{{t.id}}" id="select_{{t.id}}">
                    <label style="background:{{ t.color }}; color:{% readable_text_color t.color %}" class="btn tag" for="select_{{t.id}}">{{t.name}}</label>
                </span>
                {% endfor %}
            </div>
        </div>
    <table id="overview" class="display">
    </table>

    <script>
    var dt;

    var full_data = [
        {% for model in models %}
            {
                {% for d in fields.values %}
                    model_name: '<a href="{{model.id}}">{{model.model_name}}</a>',
                    tags: [ {% for tag in model.tags %} {id:'{{tag.id}}', name:'{{tag.name}}', color:'{{tag.color}}',  textcolor:'{% readable_text_color tag.color %}'}, {%endfor%} ],

                    {% for group in d.values %}
                        {% for field in group %}
                            {{ field }}: {{model|get_model_value:field}},
                        {% endfor %}
                    {% endfor %}

                {% endfor %}
            },
        {% endfor %}
    ]

    var render_tag = function (data, type, row){
        var s = '';
        for(var i in data){
            var tag = data[i];
            s += '<a href="" class="btn tag" style="background:'+tag.color + '; color:' + tag.textcolor + '; display:inline-block;">' + tag.name + '</a>'
        }
        return s;
    }

    var all_columns = [
        {data: 'model_name', name: 'Name', title: 'Name', visible: true},
        {data: 'tags', name: 'tags', title: 'tags', visible: true, render:render_tag },
        {% for d in fields.values %}
            {% for l, group in d.items %}
                    {% for field in group %}
                        {data: '{{ field }}', name: '{{ field }}', title: '{{ field|white_out:'_' }}', visible: {% if field in default %} true {% else %} false {%endif %}},
                    {% endfor %}
            {% endfor %}
        {% endfor %}

    ];

    var fields = {
        {% for d in fields.values %}
            {% for l, group in d.items %}
                '{{ l }}' : [
                    {% for field in group %}
                        '{{ field }}',
                    {% endfor %}
                ],
            {% endfor %}
        {% endfor %}
    };

    var active_tags = [];

    var apply_filter = function (sender){
        for (var i in fields[sender.id]) {
            var property = fields[sender.id][i]
            var column = dt.column(property+':name')
            column.visible( sender.checked );
        }<commit_msg>Move tags to the end of FS list<commit_after>{% extends "modelview/base.html" %}
{% load bootstrap3 %}
{% load staticfiles %}
{% load modelview_extras %}
{% load dataedit.taghandler %}
{% block after-header %}
<link rel="stylesheet" href="{% static 'css/mv-style.css' %}">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
{% endblock %}

{% block factsheets_content %}
<h3>{{label}} Factsheets <a class="btn btn-add btn-circle glyphicon glyphicon-plus" style="padding:0" href="add"></a> </h3> <br>

<style>
    .btn-add{
    background: transparent;
    color: green;
}
    input[type="checkbox"]:checked+label{
    font-weight: bold;
    border: 3px solid;
}
</style>

{% if label == 'Model' or label == 'Framework' %}
<div>
    <h4>Filter</h4>
    <div>
    You can filter the attributes to compare the models by clicking the categories below. If you only want to compare a selection of models you can filter them by using the colored tags below.
    </div>
    <div class="checkbox-container">
    {% for heading,d in fields.items %}
        <div class="checkbox-item">
            <div class="panel-heading">
              <h4 class="panel-title">
                <a class="fill-div" data-toggle="collapse" href="#{{heading.split|join:'_'}}">{{heading}}</a>
              </h4>
            </div>

            <div id="{{heading.split|join:'_'}}" class="panel-collapse collapse">
                <table class="table">
                    {% for key,value in d.items %}
                        <tr>
                            <th><label for="{{key}}">{{key}}</label></th>
                            <td><input type="checkbox" onchange="apply_filter(event.target)" id="{{key}}" {% if key.split|join:'_' in default %} checked="checked" {%endif %}></td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
    {% endfor %}
    </div>
</div>
<hr>

	<div>
            <h4>Select tag filter:</h4>
            <div>
                You can select models by chosing one or more tags. If you want to tag models you can set tags by editing the model. You can also define a new tag and add that to the group of models that you want to compare. You can also <a href="/dataedit/tags">define a new tag</a>.
            </div>
            <div class="well">
                {% for t in tags %}
                <span>
                    <input onchange="apply_tag_filter(event.target)" type="checkbox" class="hidden" name="select_{{t.id}}" id="select_{{t.id}}">
                    <label style="background:{{ t.color }}; color:{% readable_text_color t.color %}" class="btn tag" for="select_{{t.id}}">{{t.name}}</label>
                </span>
                {% endfor %}
            </div>
        </div>
    <table id="overview" class="display">
    </table>

    <script>
    var dt;

    var full_data = [
        {% for model in models %}
            {
                {% for d in fields.values %}
                    model_name: '<a href="{{model.id}}">{{model.model_name}}</a>',
                    tags: [ {% for tag in model.tags %} {id:'{{tag.id}}', name:'{{tag.name}}', color:'{{tag.color}}',  textcolor:'{% readable_text_color tag.color %}'}, {%endfor%} ],

                    {% for group in d.values %}
                        {% for field in group %}
                            {{ field }}: {{model|get_model_value:field}},
                        {% endfor %}
                    {% endfor %}

                {% endfor %}
            },
        {% endfor %}
    ]

    var render_tag = function (data, type, row){
        var s = '';
        for(var i in data){
            var tag = data[i];
            s += '<a href="" class="btn tag" style="background:'+tag.color + '; color:' + tag.textcolor + '; display:inline-block;">' + tag.name + '</a>'
        }
        return s;
    }

    var all_columns = [
        {data: 'model_name', name: 'Name', title: 'Name', visible: true},
        {% for d in fields.values %}
            {% for l, group in d.items %}
                    {% for field in group %}
                        {data: '{{ field }}', name: '{{ field }}', title: '{{ field|white_out:'_' }}', visible: {% if field in default %} true {% else %} false {%endif %}},
                    {% endfor %}
            {% endfor %}
        {% endfor %}
        {data: 'tags', name: 'tags', title: 'tags', visible: true, render:render_tag },
    ];

    var fields = {
        {% for d in fields.values %}
            {% for l, group in d.items %}
                '{{ l }}' : [
                    {% for field in group %}
                        '{{ field }}',
                    {% endfor %}
                ],
            {% endfor %}
        {% endfor %}
    };

    var active_tags = [];

    var apply_filter = function (sender){
        for (var i in fields[sender.id]) {
            var property = fields[sender.id][i]
            var column = dt.column(property+':name')
            column.visible( sender.checked );
        }
{'fraction_non_alphanumeric': 0.17038109020742884, 'fraction_numerical': 0.004052098408104197, 'mean_word_length': 1.8099756031444836, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 129, 'https://': 4, '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': '6261555', 'n_tokens_mistral': 3234, 'n_tokens_neox': 2936, 'n_words': 797}