<commit_before>{% load i18n %}
<div id="graph_configuration_modal" class="hide">
    <div class="modal fade graph-config">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" data-bind="text: 'Editing ' + graphDisplayName()"></h4>
                </div>
                <div class="modal-body" style="max-height:372px; overflow-y: scroll;">
                    <form class="form-horizontal">
                      <div class="form-group">
                        <label class="col-sm-2 control-label" for="graphType">{% trans "Graph Type" %}</label>
                        <div class="col-sm-4">
                            <select id="graphType" class="form-control" data-bind="
                                options: availableGraphTypes,
                                value: selectedGraphType
                            ">
                            </select>
                        </div>
                      </div>
                    </form>
                    <div data-bind="bootstrapTabs: true">
                        <div class="tabbable">
                            <ul class="nav nav-tabs">
                                <li class="active"><a>{% trans "Series" %}</a></li>
                                <li><a>{% trans "Configuration" %}</a></li>
                                <li><a>{% trans "Annotations" %}</a></li>
                            </ul>
                        </div>
                        <div class="tab-content">
                            <div class="tab-pane series">
                                <div class="spacer"></div>
                                <div data-bind="foreach: series">
                                    <form class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">{% trans "Source" %}</label>
                                            <div class="col-sm-4">
                                                <select class="form-control" data-bind="
                                                    value: selectedSource,
                                                    options: sourceOptions,
                                                    optionsText: 'text'
                                                ">
                                                </select>
                                            </div>
                                            <div class="col-sm-6">
                                                <button class="btn btn-danger pull-right" data-bind="click: $parent.removeSeries">
                                                    <i class="fa fa-trash"></i> {% trans "Delete Series" %}
                                                </button>
                                                <a href="#" data-bind="
                                                    click: toggleShowDataPath,
                                                    text: showDataPath() ? 'hide path' : 'show path'
                                                    "></a>
                                            </div>
                                        </div>
                                        <div class="form-group" data-bind="visible: showDataPath">
                                            <label class="col-sm-2 control-label">{% trans "Path" %}</label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: dataPath" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" data-bind="text: xLabel"></label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: xFunction" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" data-bind="text: yLabel"></label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: yFunction" />
                                            </div>
                                        </div>
                                        <!-- ko if: 'radiusFunction' in $data -->
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">{% trans "Radius" %}</label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: radiusFunction" />
                                            </div>
                                        </div>
                                        <!-- /ko -->
                                        <div class="form-group">
                                            <div class="col-sm-2 control-label"></div>
                                            <div class="col-sm-10">
                                                <div data-bind="foreach: configPairs">
                                                    <div data-bind="template: 'graph_property_value_mapping_inputs'"></div>
                                                </div>
                                                <a class="btn btn-default btn-sm" href="#" data-bind="click: addConfigPair">
                                                    <i class="fa fa-plus"></i>
                                                    {% blocktrans %}
                                                        Add Configuration &rarr; Value Mapping
                                                    {% endblocktrans %}
                                                </a>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <a class="btn btn-success" href="#" data-bind="click: addSeries">
                                    <i class="fa fa-plus"></i> {% trans "Add Series" %}
                                </a>
                            </div>
                            <div class="tab-pane configuration">
                                <div class="spacer"></div>
                                {# Display the locale-specific property/value pairs #}
                                <div data-bind="foreach: axisTitleConfigurations">
                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-sm-3">
                                                <div class="property-name" data-bind="text: property"></div>
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                &rarr;
                                            </div>
                                            <div class="col-sm-3">
                                                <input type="text" class="form-control" data-bind="
                                                    value: values[$parent.lang],
                                                    attr: {placeholder: getBackup().value}
                                                " />
                                            </div>
                                            <div class="col-sm-1">
                                                <span data-bind="template: 'backup_language_badge'"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div data-bind="foreach: configPairs">
                                    <div data-bind="template: 'graph_property_value_mapping_inputs'"></div>
                                </div>
                                <a class="btn btn-success" href="#" data-bind="click: addConfigPair">
                                    <i class="fa fa-plus"></i>
                                    {% blocktrans %}
                                        Add Configuration &rarr; Value mapping
                                    {% endblocktrans %}
                                </a>
                            </div>
                            <div class="tab-pane annotations">
                                <table class="table table-striped" data-bind="if: annotations().length">
                                    <thead>
                                        <tr>
                                          <th>{% trans "X Value" %}</th>
                                          <th>{% trans "Y Value" %}</th>
                                          <th>{% trans "Display Text" %}</th>
                                          <th></th>
                                          <th></th>
                                        </tr>
                                    </thead>
                                    <tbody data-bind="foreach: annotations">
                                      <tr>
                                        <td>
                                            <input type="text" class="form-control" placeholder="x" data-bind="value: x">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control" placeholder="y" data-bind="value: y">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control" placeholder="Display Text" data-bind="
                                                value: values[$parent.lang],
                                                attr: {placeholder: getBackup().value}
                                            ">
                                        </td>
                                        <td>
                                            <span data-bind="template: 'backup_language_badge'"></span>
                                        </td>
                                        <td>
                                            <a class="btn btn-danger" href="#" data-bind="click: $parent.removeAnnotation">
                                                <i class="fa fa-remove"></i>
                                            </a>
                                        </td>
                                      </tr>
                                    </tbody>
                                </table>
                                <a class="btn btn-success" href="#" data-bind="click: addAnnotation">
                                    <i class="fa fa-plus"></i>{% trans "Add Annotation" %}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button class="btn btn-primary" data-dismiss="modal" data-bind="click: onSave">Save</button>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="graph_property_value_mapping_inputs" class="hide">
    <div class="form-group row">
        <div class="col-sm-3">
            <input type="text" class="form-control" placeholder="property"
                   data-bind="typeahead: $parent.configPropertyOptions, value: property">
        </div>
        <div class="col-sm-1 text-center">
            &rarr;
        </div>
        <div class="col-sm-3">
            <input type="text" class="form-control"
                   data-bind="value: value, attr: {placeholder: $parent.configPropertyHints[property()]}">
        </div><commit_msg>fix autocompletes in graphing modal<commit_after>{% load i18n %}
<div id="graph_configuration_modal" class="hide">
    <div class="modal fade graph-config">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" data-bind="text: 'Editing ' + graphDisplayName()"></h4>
                </div>
                <div class="modal-body" style="max-height:372px; overflow-y: scroll;">
                    <form class="form-horizontal">
                      <div class="form-group">
                        <label class="col-sm-2 control-label" for="graphType">{% trans "Graph Type" %}</label>
                        <div class="col-sm-4">
                            <select id="graphType" class="form-control" data-bind="
                                options: availableGraphTypes,
                                value: selectedGraphType
                            ">
                            </select>
                        </div>
                      </div>
                    </form>
                    <div data-bind="bootstrapTabs: true">
                        <div class="tabbable">
                            <ul class="nav nav-tabs">
                                <li class="active"><a>{% trans "Series" %}</a></li>
                                <li><a>{% trans "Configuration" %}</a></li>
                                <li><a>{% trans "Annotations" %}</a></li>
                            </ul>
                        </div>
                        <div class="tab-content">
                            <div class="tab-pane series">
                                <div class="spacer"></div>
                                <div data-bind="foreach: series">
                                    <form class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">{% trans "Source" %}</label>
                                            <div class="col-sm-4">
                                                <select class="form-control" data-bind="
                                                    value: selectedSource,
                                                    options: sourceOptions,
                                                    optionsText: 'text'
                                                ">
                                                </select>
                                            </div>
                                            <div class="col-sm-6">
                                                <button class="btn btn-danger pull-right" data-bind="click: $parent.removeSeries">
                                                    <i class="fa fa-trash"></i> {% trans "Delete Series" %}
                                                </button>
                                                <a href="#" data-bind="
                                                    click: toggleShowDataPath,
                                                    text: showDataPath() ? 'hide path' : 'show path'
                                                    "></a>
                                            </div>
                                        </div>
                                        <div class="form-group" data-bind="visible: showDataPath">
                                            <label class="col-sm-2 control-label">{% trans "Path" %}</label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: dataPath" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" data-bind="text: xLabel"></label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: xFunction" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" data-bind="text: yLabel"></label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: yFunction" />
                                            </div>
                                        </div>
                                        <!-- ko if: 'radiusFunction' in $data -->
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">{% trans "Radius" %}</label>
                                            <div class="col-sm-4">
                                                <input type="text" class="form-control" data-bind="value: radiusFunction" />
                                            </div>
                                        </div>
                                        <!-- /ko -->
                                        <div class="form-group">
                                            <div class="col-sm-2 control-label"></div>
                                            <div class="col-sm-10">
                                                <div data-bind="foreach: configPairs">
                                                    <div data-bind="template: 'graph_property_value_mapping_inputs'"></div>
                                                </div>
                                                <a class="btn btn-default btn-sm" href="#" data-bind="click: addConfigPair">
                                                    <i class="fa fa-plus"></i>
                                                    {% blocktrans %}
                                                        Add Configuration &rarr; Value Mapping
                                                    {% endblocktrans %}
                                                </a>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <a class="btn btn-success" href="#" data-bind="click: addSeries">
                                    <i class="fa fa-plus"></i> {% trans "Add Series" %}
                                </a>
                            </div>
                            <div class="tab-pane configuration">
                                <div class="spacer"></div>
                                {# Display the locale-specific property/value pairs #}
                                <div data-bind="foreach: axisTitleConfigurations">
                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-sm-3">
                                                <div class="property-name" data-bind="text: property"></div>
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                &rarr;
                                            </div>
                                            <div class="col-sm-3">
                                                <input type="text" class="form-control" data-bind="
                                                    value: values[$parent.lang],
                                                    attr: {placeholder: getBackup().value}
                                                " />
                                            </div>
                                            <div class="col-sm-1">
                                                <span data-bind="template: 'backup_language_badge'"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div data-bind="foreach: configPairs">
                                    <div data-bind="template: 'graph_property_value_mapping_inputs'"></div>
                                </div>
                                <a class="btn btn-success" href="#" data-bind="click: addConfigPair">
                                    <i class="fa fa-plus"></i>
                                    {% blocktrans %}
                                        Add Configuration &rarr; Value mapping
                                    {% endblocktrans %}
                                </a>
                            </div>
                            <div class="tab-pane annotations">
                                <table class="table table-striped" data-bind="if: annotations().length">
                                    <thead>
                                        <tr>
                                          <th>{% trans "X Value" %}</th>
                                          <th>{% trans "Y Value" %}</th>
                                          <th>{% trans "Display Text" %}</th>
                                          <th></th>
                                          <th></th>
                                        </tr>
                                    </thead>
                                    <tbody data-bind="foreach: annotations">
                                      <tr>
                                        <td>
                                            <input type="text" class="form-control" placeholder="x" data-bind="value: x">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control" placeholder="y" data-bind="value: y">
                                        </td>
                                        <td>
                                            <input type="text" class="form-control" placeholder="Display Text" data-bind="
                                                value: values[$parent.lang],
                                                attr: {placeholder: getBackup().value}
                                            ">
                                        </td>
                                        <td>
                                            <span data-bind="template: 'backup_language_badge'"></span>
                                        </td>
                                        <td>
                                            <a class="btn btn-danger" href="#" data-bind="click: $parent.removeAnnotation">
                                                <i class="fa fa-remove"></i>
                                            </a>
                                        </td>
                                      </tr>
                                    </tbody>
                                </table>
                                <a class="btn btn-success" href="#" data-bind="click: addAnnotation">
                                    <i class="fa fa-plus"></i>{% trans "Add Annotation" %}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button class="btn btn-primary" data-dismiss="modal" data-bind="click: onSave">Save</button>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="graph_property_value_mapping_inputs" class="hide">
    <div class="form-group row">
        <!--
            .ui-front makes jQuery UI attach the dropdown to this element rather than the body,
            which is necessary because this is inside of a modal.
        -->
        <div class="col-sm-3 ui-front">
            <input type="text" class="form-control" placeholder="property"
                   data-bind="typeahead: $parent.configPropertyOptions, value: property">
        </div>
        <div class="col-sm-1 text-center">
            &rarr;
        </div>
        <div class="col-sm-3">
            <input type="text" class="form-control"
                   data-bind="value: value, attr: {placeholder: $parent.configPropertyHints[property()]}">
        </div>
{'fraction_non_alphanumeric': 0.10699045697881915, 'fraction_numerical': 0.0023275661416711927, 'mean_word_length': 0.6491171954964176, 'pattern_counts': {'":': 0, '<': 428, '<?xml version=': 0, '>': 428, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 428, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5329453', 'n_tokens_mistral': 4711, 'n_tokens_neox': 4509, 'n_words': 1016}