<commit_before>{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2016 Spring Signage Ltd
 * (${FILE_NAME})
 */

#}


{% raw %}
<script type="text/x-handlebars-template" id="dataSetViewOrderClauseTemplate">
    <div class="form-group">
        <label class="col-sm-1 control-label" for="orderClause[]">{{ title }}</label>
        <div class="col-sm-7">
            <select class="form-control" name="orderClause[]">
                <option value=""></option>
                {{#each columns}}
                    <option value="{{ heading }}" {{#if_eq heading ../orderClause}}selected{{/if_eq}}>{{ heading }}</option>
                {{/each}}
            </select>
        </div>
        <div class="col-sm-3">
            <label for="orderClauseDirection[]">
                <select class="form-control" name="orderClauseDirection[]">
                    <option value="ASC" {{#if orderClauseAsc}}selected{{/if}}>{{ ascTitle }}</option>
                    <option value="DESC" {{#if orderClauseDesc}}selected{{/if}}>{{ descTitle }}</option>
                </select>
            </label>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-default btn-sm"><i class="fa {{ buttonGlyph }}"></i></button>
        </div>
    </div>
</script>

<script type="text/x-handlebars-template" id="dataSetViewFilterClauseTemplate">
    <div class="form-group">
        <label class="col-sm-1 control-label" for="filterClause[]">{{ title }}</label>
        <div class="col-sm-4">
            <select class="form-control" name="filterClause[]">
                <option value=""></option>
                {{#each columns}}
                    <option value="{{ heading }}" {{#if_eq heading ../filterClause}}selected{{/if_eq}}>{{ heading }}</option>
                {{/each}}
            </select>
        </div>
        <div class="col-sm-3">
            <label for="filterClauseCriteria[]">
                <select class="form-control" name="filterClauseCriteria[]">
                    {{#each filterOptions}}
                    <option value="{{ id }}" {{#if_eq id ../filterClauseCriteria}}selected{{/if_eq}}>{{ value }}</option>
                    {{/each}}
                </select>
            </label>
        </div>
        <div class="col-sm-3">
            <label for="filterClauseValue[]">
                <input class="form-control" name="filterClauseValue[]" type="text" value="{{ filterClauseValue }}" />
            </label>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-default btn-sm"><i class="fa {{ buttonGlyph }}"></i></button>
        </div>
    </div>
</script>

{% endraw %}

<script type="text/javascript">
    Handlebars.registerHelper('if_eq', function(a, b, opts) {
        if(a == b) // Or === depending on your needs
            return opts.fn(this);
        else
            return opts.inverse(this);
    });

    function dataSetFormSetup(dialog) {

        $("#columnsIn, #columnsOut").sortable({
            connectWith: '.connectedSortable',
            dropOnEmpty: true
        }).disableSelection();

        // If all 3 of the template fields are empty, then the template should be reapplied.
        if (!$("#overrideTemplate").is(":checked") && $("#styleSheet").val() == "") {
            // Reapply
            var templateId = $("#templateId").val();
<commit_msg>Double click to switch columns in datasetview xibosignage/xibo#722<commit_after>{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2016 Spring Signage Ltd
 * (${FILE_NAME})
 */

#}


{% raw %}
<script type="text/x-handlebars-template" id="dataSetViewOrderClauseTemplate">
    <div class="form-group">
        <label class="col-sm-1 control-label" for="orderClause[]">{{ title }}</label>
        <div class="col-sm-7">
            <select class="form-control" name="orderClause[]">
                <option value=""></option>
                {{#each columns}}
                    <option value="{{ heading }}" {{#if_eq heading ../orderClause}}selected{{/if_eq}}>{{ heading }}</option>
                {{/each}}
            </select>
        </div>
        <div class="col-sm-3">
            <label for="orderClauseDirection[]">
                <select class="form-control" name="orderClauseDirection[]">
                    <option value="ASC" {{#if orderClauseAsc}}selected{{/if}}>{{ ascTitle }}</option>
                    <option value="DESC" {{#if orderClauseDesc}}selected{{/if}}>{{ descTitle }}</option>
                </select>
            </label>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-default btn-sm"><i class="fa {{ buttonGlyph }}"></i></button>
        </div>
    </div>
</script>

<script type="text/x-handlebars-template" id="dataSetViewFilterClauseTemplate">
    <div class="form-group">
        <label class="col-sm-1 control-label" for="filterClause[]">{{ title }}</label>
        <div class="col-sm-4">
            <select class="form-control" name="filterClause[]">
                <option value=""></option>
                {{#each columns}}
                    <option value="{{ heading }}" {{#if_eq heading ../filterClause}}selected{{/if_eq}}>{{ heading }}</option>
                {{/each}}
            </select>
        </div>
        <div class="col-sm-3">
            <label for="filterClauseCriteria[]">
                <select class="form-control" name="filterClauseCriteria[]">
                    {{#each filterOptions}}
                    <option value="{{ id }}" {{#if_eq id ../filterClauseCriteria}}selected{{/if_eq}}>{{ value }}</option>
                    {{/each}}
                </select>
            </label>
        </div>
        <div class="col-sm-3">
            <label for="filterClauseValue[]">
                <input class="form-control" name="filterClauseValue[]" type="text" value="{{ filterClauseValue }}" />
            </label>
        </div>
        <div class="col-sm-1">
            <button class="btn btn-default btn-sm"><i class="fa {{ buttonGlyph }}"></i></button>
        </div>
    </div>
</script>

{% endraw %}

<script type="text/javascript">
    Handlebars.registerHelper('if_eq', function(a, b, opts) {
        if(a == b) // Or === depending on your needs
            return opts.fn(this);
        else
            return opts.inverse(this);
    });

    function dataSetFormSetup(dialog) {

        $("#columnsIn, #columnsOut").sortable({
            connectWith: '.connectedSortable',
            dropOnEmpty: true
        }).disableSelection();

        $(".li-sortable", dialog).dblclick(switchLists);

        // If all 3 of the template fields are empty, then the template should be reapplied.
        if (!$("#overrideTemplate").is(":checked") && $("#styleSheet").val() == "") {
            // Reapply
            var templateId = $("#templateId").val();

{'fraction_non_alphanumeric': 0.1852013374036924, 'fraction_numerical': 0.004506468963512139, 'mean_word_length': 2.111714156490276, 'pattern_counts': {'":': 2, '<': 131, '<?xml version=': 0, '>': 131, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7049280', 'n_tokens_mistral': 1981, 'n_tokens_neox': 1933, 'n_words': 417}