<commit_before><!DOCTYPE html>
<html lang="en">
<head>
    <title>Summary</title>
    <link rel="stylesheet" type="text/css" href="/static/style.css">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/js/bootstrap-dialog.min.js"></script>
    <script type="text/javascript" src="/static/common.js"></script>
    <script src="/static/jquery-2.1.3.js"></script>
    <script src="/static/tableHeadFixer.js"></script>
    <nav class="navbar navbar-inverse navbar-static-top" >
        <div class="container">
            <div class="navbar-header">
                <a class="navbar-brand" href="javascript:window.history.back()">Back</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="/api/v1/about_page"><span class="glyphicon glyphicon-lamp"></span>About</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="javascript:popup('Notice', 'User Settings will be available in V2')"><span class="glyphicon glyphicon-user"></span>{{ current_user }}</a></li>
                </ul>
            </div>
        </div>
    </nav>

</head>
<body>
<script>
    $(document).ready(function() {
        var table = $('#fixTable').tableHeadFixer( {
            left: 7
        });
    });
</script>
<div id="parent">
    {% set cs = project.vendorIds | length * 2 %}
    <table id="fixTable" class="table table-condensed" >
        <thead>
        <tr>
            <th colspan=  "{{ 4+cs }}" >
                Project: {{ project.projectId }}
                &nbsp;
                &nbsp;
                &nbsp;
                {% set project_status, percentage = get_project_status(project.projectId) %}
                {% if project_status == "Late" %}
                    <span class="glyphicon glyphicon-exclamation-sign" style="color:red"></span>
                {% elif project_status == "Incomplete" %}
                    <span class="glyphicon glyphicon-exclamation-sign" style="color:orange"></span>
                {% else %}
                    <span class="glyphicon glyphicon-ok-sign" style="color:green"></span>
                {% endif %}
                &nbsp;
                &nbsp;
                &nbsp;
                {{ percentage }}
                &nbsp;
                %
                &nbsp;
                &nbsp;
                &nbsp;
                {% set urlx = "/api/v1/show_entrys_given_project/" + project.projectId | urlencode %}
                <a href={{ urlx }}>Entrys<span class="glyphicon glyphicon-chevron-right"></span></a>
            </th>
        </tr>
        <tr>
            <th colspan="7" style="text-align: center">Objectives</th>
            <th colspan="{{ cs }}" style="text-align: center">Evaluation Criteria</th>
        </tr>
        <tr>
            <th>ID</th>
            <th>Description</th>
            <th>Weight</th>
            <th>Criteria ID</th>
            <th>Criterion</th>
            <th>Criteria</th>
            <th>Criteria Weight</th>
            {% for vendor in project.vendorIds %}
                <th style="border-left:1px solid;">
                    {{ vendor }} Score
                </th>
                <th>
                    {{ vendor }} Weight Score
                </th>
            {% endfor %}
        </tr>
        </thead>
        <tbody>
        {% if bos_db is defined %}
            {% for bo in bos_db %}
                <tr>
                    <td>
                        {{ bo.objectiveId }}
                    </td>
                    <td>
                        {{ bo.description }}
                    </td>
                    <td>
                        {{ bo.weight }}
                    </td>
                    {% set count = [0] %}
                    {% for ec in bo.evaluation_criteria %}
                        {% if count > [0] %}
                            <tr>
                            <td></td><td></td><td></td>
                        {% endif %}
                    <td>
                        {{ ec.evaluation_criterionId }}
                    </td>
                    <td>
                        {{ ec.evaluation_criterion }}
                    </td>
                    <td>
                        {{ '%0.2f'| format(ec.calculations["criteria_percentage"]|float)  }}
                    </td>
                    <td>
                        {{ '%0.2f'| format(ec.calculations["criteria_weight"]|float) }}
                    </td>
                    {% for vendor in project.vendorIds %}
                        <td style="border-left:1px solid;">
                            {% set key = vendor + "_vendor_score" %}
                            {{ '%0.2f'| format(ec.calculations[key]|float) }}
                        </td>
                        <td>
                            {% set key = vendor + "_vendor_weighted_score" %}
                            {{ ec.calculations[key] }}
                            {% if top_vendor is defined %}
                                {% if vendor == top_vendor %}
                                    (*)
                                {% endif %}
                            {% endif %}
                        </td>
                    {% endfor %}
                        {% if count > [0] %}
                            </tr>
                        {% endif %}
                    {% if count.append(count.pop() + 1) %}{% endif %}
                    {% endfor %}
                </tr>
            {% endfor %}
        {% endif %}
        </tbody>
        <tfoot>
        <tr>
            <td colspan="{{ 7+cs }}" >(*): Top vendor</td>
        </tr>
        </tfoot>
    </table>
</div>
</body>
</html>


<commit_msg>Make freeze panes optional w/ checkbox<commit_after><!DOCTYPE html>
<html lang="en">
<head>
    <title>Summary</title>
    <link rel="stylesheet" type="text/css" href="/static/style.css">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/js/bootstrap-dialog.min.js"></script>
    <script type="text/javascript" src="/static/common.js"></script>
    <script src="/static/jquery-2.1.3.js"></script>
    <script src="/static/tableHeadFixer.js"></script>
    <nav class="navbar navbar-inverse navbar-static-top" >
        <div class="container">
            <div class="navbar-header">
                <a class="navbar-brand" href="javascript:window.history.back()">Back</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="/api/v1/about_page"><span class="glyphicon glyphicon-lamp"></span>About</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="javascript:popup('Notice', 'User Settings will be available in V2')"><span class="glyphicon glyphicon-user"></span>{{ current_user }}</a></li>
                </ul>
            </div>
        </div>
    </nav>
    <style>
    </style>
</head>
<body>
<script>
    var filter = [];

    $(document).ready(function(){
        console.log("ready " + filter);
    });

    function onFreezeClick(cb) {
        if (cb.checked) {
            var table = $('#fixTable').tableHeadFixer( {
                left: 7
            });
        } else {
            window.location.reload(true);
        }
    }

    function onCompareClick(cb) {
        console.log(cb.name);
        if (cb.checked) {
            filter.push(cb.name);
        } else {
            var idx = filter.indexOf(cb.name);
            filter.splice(idx, 1);
        }
    }

    function onRefresh(button) {
        console.log(filter);
        var ff = document.getElementById("filter");
        if (ff == null) {
            ff = document.createElement("filter");
            ff.id = "filter";
        }
        ff.value = filter;
         $( "#parent" ).load(window.location.href + " #parent" );
    }

    function showCompares(displayFlag) {
        var cbs = getCbList();
        var spans = getSpans();
        if (displayFlag) {
            for (var ii = 0; ii < cbs.length; ii++) {
                cbs[ii].style.display = "inline"
            }
            for (var ii = 0; ii < spans.length; ii++) {
                spans[ii].style.display = "inline"
            }
            compareCBRow.style.display = "table-row";
            refresh.style.display = "inline";
        } else {
            for (var ii = 0; ii < cbs.length; ii++) {
                cbs[ii].style.display = "none"
            }
            for (var ii = 0; ii < spans.length; ii++) {
                spans[ii].style.display = "none"
            }
            compareCBRow.style.display = "none";
            refresh.style.display = "none";
            filter = [];
        }


    }
    function onCBClick(cb) {
        var compareCBRow = document.getElementById("compareCBRow");
        var refresh = document.getElementById("refresh");
        showCompares(cb.checked);
    }

    function getSpans() {
        var spans = [];
        var inputs = document.getElementsByTagName("span");
        for (ii = 0; ii < inputs.length; ii++) {
            if (inputs[ii].name = "spancbs") {
                spans.push(inputs[ii]);
            }
        }
        return spans;
    }
    function getCbList() {
        var inputs = document.getElementsByTagName("input");
        var cbs = [];
        for (ii = 0; ii < inputs.length; ii++) {
            if(inputs[ii].type == "checkbox") {
                if (inputs[ii].name != 'compare' &&
                    inputs[ii].name != 'freeze') {
                    cbs.push(inputs[ii]);
                }
            }
        }
        return cbs;
    }

</script>
<div id="out" style="float:right; padding:10px">
    <label>Freeze Panes</label>
    <input id = "freeze" type="checkbox" name="freeze" onclick="onFreezeClick(this);">
    <!--label>Compare</label>
    <input id = "compare" type="checkbox" name="compare" onclick="onCBClick(this);">
    <button type="button" class="btn btn-default" name="refresh" id="refresh" style="display: none" onclick="javascript:onRefresh()">Compare</button-->
</div>
<div id="parent">
    {% set cs = project.vendorIds | length * 2 %}
    <table id="fixTable" class="table table-condensed" >
        <thead>
        <tr>
            <th colspan=  "{{ 4+cs }}" >
                Project: {{ project.projectId }}
                &nbsp;
                &nbsp;
                &nbsp;
                {% set project_status, percentage = get_project_status(project.projectId) %}
                {% if project_status == "Late" %}
                    <span class="glyphicon glyphicon-exclamation-sign" style="color:red"></span>
                {% elif project_status == "Incomplete" %}
                    <span class="glyphicon glyphicon-exclamation-sign" style="color:orange"></span>
                {% else %}
                    <span class="glyphicon glyphicon-ok-sign" style="color:green"></span>
                {% endif %}
                &nbsp;
                &nbsp;
                &nbsp;
                {{ percentage }}
                &nbsp;
                %
                &nbsp;
                &nbsp;
                &nbsp;
                {% set urlx = "/api/v1/show_entrys_given_project/" + project.projectId | urlencode %}
                <a href={{ urlx }}>Entrys<span class="glyphicon glyphicon-chevron-right"></span></a>
            </th>
        </tr>
        <tr>
            <th colspan="7" style="text-align: center">Objectives</th>
            <th colspan="{{ cs }}" style="text-align: center">Evaluation Criteria</th>
            <div id="compareCB" style="display:inline">
                <tr id="compareCBRow" style="display: none;">
                {% for ii in range(7) %}
                     <td></td>
                {% endfor %}
                {% for vendor in project.vendorIds %}
                    {% if filter is defined %}
                        {{ mdebug("0 " + filter) }}
                    {% endif %}
                    {% if filter | length > 0 %}
                        {% if vendor in filter %}
                            {{ mdebug("1 " + vendor) }}
                            <th colspan="2" style="text-align: center">
                                <span id="spancbs" style="display:none">Compare</span>
                                <input id="cbs" type="checkbox" name={{ vendor }} style="display:none" onclick="onCompareClick(this);">
                            </th>
                        {% else %}
                            {{ mdebug("2 " + vendor) }}
                        {% endif %}
                    {% else %}
                        <th colspan="2" style="text-align: center">
                            <span id="spancbs" style="display:none">Compare</span>
                            <input id="cbs" type="checkbox" name={{ vendor }} style="display:none" onclick="onCompareClick(this);">
                        </th>
                    {% endif %}
                {% endfor %}
                </tr>
            </div>
        </tr>
        <tr>
            <th>ID</th>
            <th>Description</th>
            <th>Weight</th>
            <th>Criteria ID</th>
            <th>Criterion</th>
            <th>Criteria</th>
            <th>Criteria Weight</th>
            {% for vendor in project.vendorIds %}
                <th style="border-left:1px solid;">
                    {{ vendor }} Score
                </th>
                <th>
                    {{ vendor }} Weight Score
                </th>
            {% endfor %}
        </tr>
        </thead>
        <tbody>
        {% if bos_db is defined %}
            {% for bo in bos_db %}
                <tr>
                    <td>
                        {{ bo.objectiveId }}
                    </td>
                    <td>
                        {{ bo.description }}
                    </td>
                    <td>
                        {{ bo.weight }}
                    </td>
                    {% set count = [0] %}
                    {% for ec in bo.evaluation_criteria %}
                        {% if count > [0] %}
                            <tr>
                            <td></td><td></td><td></td>
                        {% endif %}
                    <td>
                        {{ ec.evaluation_criterionId }}
                    </td>
                    <td>
                        {{ ec.evaluation_criterion }}
                    </td>
                    <td>
                        {{ '%0.2f'| format(ec.calculations["criteria_percentage"]|float)  }}
                    </td>
                    <td>
                        {{ '%0.2f'| format(ec.calculations["criteria_weight"]|float) }}
                    </td>
                    {% for vendor in project.vendorIds %}
                        <td style="border-left:1px solid;">
                            {% set key = vendor + "_vendor_score" %}
                            {{ '%0.2f'| format(ec.calculations[key]|float) }}
                        </td>
                        <td>
                            {% set key = vendor + "_vendor_weighted_score" %}
                            {{ ec.calculations[key] }}
                            {% if top_vendor is defined %}
                                {% if vendor == top_vendor %}
                                    (*)
                                {% endif %}
                            {% endif %}
                        </td>
                    {% endfor %}
                        {% if count > [0] %}
                            </tr>
                        {% endif %}
                    {% if count.append(count.pop() + 1) %}{% endif %}
                    {% endfor %}
                </tr>
            {% endfor %}
        {% endif %}
        </tbody>
        <tfoot>
        <tr>
            <td colspan="{{ 7+cs }}" >(*): Top vendor</td>
        </tr>
        </tfoot>
    </table>
</div>
</body>
</html>



{'fraction_non_alphanumeric': 0.15261945543677277, 'fraction_numerical': 0.005551946134309846, 'mean_word_length': 1.2349524815205914, 'pattern_counts': {'":': 0, '<': 307, '<?xml version=': 0, '>': 306, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4899302', 'n_tokens_mistral': 4957, 'n_tokens_neox': 4478, 'n_words': 852}