<commit_before>'use strict';

function createConfigModal() {


    var toAppend = document.getElementById('toAppend');
    var configObj = allInfo.locations;
    var liHtmlConfig = [];

    if (configObj.length > 0) {
        for (var conf in configObj) {
            var locName = configObj[conf].name;
            if (conf == 0) {
                liHtmlConfig = '<li><a class="eatNameAddPoint" style="padding:5px;" name="' + locName + '" href="#">' + locName + '</a></li>'
            } else {
                liHtmlConfig += '<li><a class="eatNameAddPoint" style="padding:5px;" name="' + locName + '" href="#">' + locName + '</a></li>'
            }
        }
    }


    var configHtml = `<div class="modal fade in" id="configModal" tabindex="-1" role="dialog">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                    <h4 class="modal-title" style="color: #4cae4c;">EssPunkt hinzufügen</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                    <div class="col-md-4">
                                        <p>Wählen</p>
                                    </div>
                                    <div class="col-md-4">
                                        <p>Startzeit</p>
                                    </div>
                                    <div class="col-md-2">
                                        <p>Neu</p>
                                    </div>
                                    </div>
                                    <div class="row">
                                    <div class="col-md-4">
                                        <div class="dropdown" id="LocObjAddPoint">
                                            <button class="btn dropdown-toggle btn-success" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">EssPunkt auswählen<span class="caret"></span></button>
                                            <ul class="dropdown-menu configModal" aria-labelledby="dLabel">
                                                `+ liHtmlConfig + `
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="input-group clockpicker" data-placement="bottom" data-align="top" data-autoclose="true"><input class="form-control" type="text" value="11:45" id="timeVa"><span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span></div>
                                        <script type="text/javascript">$('.clockpicker').clockpicker();</script>
                                    </div>
                                    <div class="col-md-2 text-center"><button class="btn btn-success" onclick="createNewLocation()">Neuer Esspunkt</button></div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-default" type="button" data-dismiss="modal" onclick="deleteUserLocationButt()">Abbrechen</button>
                                    <button class="btn btn-success" id="createEssPunktButton" disabled type="button" data-dismiss="modal" onclick="addNewLocation()">Erstellen</button>
                                </div>
                            </div>
                        </div>
                        </div>`
    var configModal = document.getElementById('configModal');
    $(configModal).remove();
    $(toAppend).append(configHtml);

    $('#configModal').modal();
}

function appendDailyPoint(point) {

    if (point.points[0].img.path) {
        var LogoImg = point.points[0].img.path
    } else {
        var LogoImg = '/img/empty_logo.png'
    }
    if (point.points[0].tag.length > 0) {
        var tagshtml;
        for (var tag in point.points[0].tag) {
            if (tag == 3 || tag == 6 || tag == 9 || tag == 12) {
                tagshtml += '<br />';
                tagshtml += '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
            } else {
                if (tag == 0) {
                    tagshtml = '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
                } else {
                    tagshtml += '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
                }

            }
        }
    } else {
        var tagshtml = '<span></span>'
    }

    if (point.points[0].addrr.mapurl.length <= 0) {
        var mapbutton = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Map</button>'
    } else {
        var mapbutton = '<a href="' + point.points[0].addrr.mapurl + '" class="btn btn-info btn-block" role="button">Map</a>'
    }

    if (point.points[0].addrr.menulink.length <= 0) {
        var menubuttonWeb = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Menü (Web)</button>'
    } else {
        var menubuttonWeb = '<a href="' + point.points[0].addrr.menulink + '" class="btn btn-info btn-block" role="button">Menü (Web)</a>'
    }

    if (point.points[0].doc.uploaded <= 0) {
        var menubuttonPDF = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Menü (PDF)</button>'
    } else {
        var menubuttonPDF = '<a href="' + point.points[0].doc.path + '" class="btn btn-info btn-block" role="button">Menü (PDF)</a>'
    }

    var bestellung = point.points[0].beste;
    if (bestellung == 'true') {
        var labelbe = `<span class="label label-info" style="margin-right:5px">bestellung</span>`
    } else {
        var labelbe = ``
    }

    var passanger = {
        'userName': {
            'name': point.name,
            'memNum': point.members.length
        }
    }

    var locHtml = `
  <div class="panel panel-default panelDailyPoint" name="`+ point.points[0].name + point.location.time + `;` + point.points[0].name + `">
    <div name="`+ point.name + `panel" class="panel-heading">` + labelbe + point.points[0].name + ` - Start ` + point.location.time + ` Uhr
        <button class="close" onclick='deleteDayPoint("`+ point.points[0].name + point.location.time + `")' name="` + point.points[0].name + point.location.time + `dbutton")'><span>×</span></button>
    </div>
    <div class="panel-body">
        <div class="row">
        <div class="col-md-5">
            <div class="row">
            <div class="col-md-5">
                <div class="row">
                <div class="col-md-12">
                    <img src="`+ LogoImg + `" alt="loc-logo" class="img-thumbnail"/>
                </div>
                </div>
                <div class="row">
                <div class="col-md-12" style="max-width:20px">
                    ` + tagshtml + `
                </div>
                </div>
            </div>
            <div class="col-md-7">
                <div class="row">
                <div class="col-md-12">
                    <span class="addrr">Adresse</span>
                    <br/>
                    <span>`+ point.points[0].addrr.str + `</span>
                    <br/>
                    <span>`+ point.points[0].addrr.plz + ` ` + point.points[0].addrr.ort + `</span>
                    <br/>
                    <span class="addrr">Telefon</span>
                    <br/>
                    <span>`+ point.points[0].addrr.tel + `</span>
                        `+ mapbutton + `
                    <div class="col-md-6" style="padding:1px">
                        `+ menubuttonWeb + `
                    </div>
                    <div class="col-md-6" style="padding:1px">
                        `+ menubuttonPDF + `
                    </div>
                </div>
                </div>
            </div>
            <div class="col-md-12" name="appendComment`+ point.points[0].name + point.location.time + `">

            </div>
            <div class="col-md-12">
                    <div class="input-group">
                        <input id="commentarInput`+ point.points[0].name + point.location.time + `" type="text" class="form-control" placeholder="Kommentar schreiben">
                        <span class="input-group-btn">
                            <div class="btn btn-success btn-circle pull-right" onclick='addComment("`+ point.points[0].name + point.location.time + `;` + point.points[0].name + `")'>
                                <i class="glyphicon glyphicon-comment"></i>
                            </div>
                        </span>
                    </div><!-- /input-group -->
            </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="row" name=`+ point.name + `>
            <div onclick="addUserButton('`+ point.name + `;` + bestellung + `')" class="btn-toolbar pull-right btn btn-circle btn-success top--30px">
                <i class="glyphicon glyphicon-plus"></i>
            </div>

            </div>
        </div>
        <div class="col-md-3">
            <div class="imgcenter">
            <div class="carnum", name="carnum`+ point.name + `">0</div>
            <div class="passnum", name="passnum`+ point.name + `">0</div>
            </div>
        </div>
        </div>
    </div>
  </div>`;
    $('#toAppend').append($(locHtml));

    if (point.members.length > 0) {
        var memberSpan;
        var membersArr = point.members;<commit_msg>fix error with spaces in names<commit_after>'use strict';

function createConfigModal() {


    var toAppend = document.getElementById('toAppend');
    var configObj = allInfo.locations;
    var liHtmlConfig = [];

    if (configObj.length > 0) {
        for (var conf in configObj) {
            var locName = configObj[conf].name;
            if (conf == 0) {
                liHtmlConfig = '<li><a class="eatNameAddPoint" style="padding:5px;" name="' + locName + '" href="#">' + locName + '</a></li>'
            } else {
                liHtmlConfig += '<li><a class="eatNameAddPoint" style="padding:5px;" name="' + locName + '" href="#">' + locName + '</a></li>'
            }
        }
    }


    var configHtml = `<div class="modal fade in" id="configModal" tabindex="-1" role="dialog">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                    <h4 class="modal-title" style="color: #4cae4c;">EssPunkt hinzufügen</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                    <div class="col-md-4">
                                        <p>Wählen</p>
                                    </div>
                                    <div class="col-md-4">
                                        <p>Startzeit</p>
                                    </div>
                                    <div class="col-md-2">
                                        <p>Neu</p>
                                    </div>
                                    </div>
                                    <div class="row">
                                    <div class="col-md-4">
                                        <div class="dropdown" id="LocObjAddPoint">
                                            <button class="btn dropdown-toggle btn-success" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">EssPunkt auswählen<span class="caret"></span></button>
                                            <ul class="dropdown-menu configModal" aria-labelledby="dLabel">
                                                `+ liHtmlConfig + `
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="input-group clockpicker" data-placement="bottom" data-align="top" data-autoclose="true"><input class="form-control" type="text" value="11:45" id="timeVa"><span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span></div>
                                        <script type="text/javascript">$('.clockpicker').clockpicker();</script>
                                    </div>
                                    <div class="col-md-2 text-center"><button class="btn btn-success" onclick="createNewLocation()">Neuer Esspunkt</button></div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-default" type="button" data-dismiss="modal" onclick="deleteUserLocationButt()">Abbrechen</button>
                                    <button class="btn btn-success" id="createEssPunktButton" disabled type="button" data-dismiss="modal" onclick="addNewLocation()">Erstellen</button>
                                </div>
                            </div>
                        </div>
                        </div>`
    var configModal = document.getElementById('configModal');
    $(configModal).remove();
    $(toAppend).append(configHtml);

    $('#configModal').modal();
}

function appendDailyPoint(point) {

    if (point.points[0].img.path) {
        var LogoImg = point.points[0].img.path
    } else {
        var LogoImg = '/img/empty_logo.png'
    }
    if (point.points[0].tag.length > 0) {
        var tagshtml;
        for (var tag in point.points[0].tag) {
            if (tag == 3 || tag == 6 || tag == 9 || tag == 12) {
                tagshtml += '<br />';
                tagshtml += '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
            } else {
                if (tag == 0) {
                    tagshtml = '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
                } else {
                    tagshtml += '<span class="label label-info">' + point.points[0].tag[tag] + '</span>';
                }

            }
        }
    } else {
        var tagshtml = '<span></span>'
    }

    if (point.points[0].addrr.mapurl.length <= 0) {
        var mapbutton = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Map</button>'
    } else {
        var mapbutton = '<a href="' + point.points[0].addrr.mapurl + '" class="btn btn-info btn-block" role="button">Map</a>'
    }

    if (point.points[0].addrr.menulink.length <= 0) {
        var menubuttonWeb = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Menü (Web)</button>'
    } else {
        var menubuttonWeb = '<a href="' + point.points[0].addrr.menulink + '" class="btn btn-info btn-block" role="button">Menü (Web)</a>'
    }

    if (point.points[0].doc.uploaded <= 0) {
        var menubuttonPDF = '<button onclick="getMenu()" disabled="disabled" class="btn btn-default btn-block">Menü (PDF)</button>'
    } else {
        var menubuttonPDF = '<a href="' + point.points[0].doc.path + '" class="btn btn-info btn-block" role="button">Menü (PDF)</a>'
    }

    var bestellung = point.points[0].beste;
    if (bestellung == 'true') {
        var labelbe = `<span class="label label-info" style="margin-right:5px">bestellung</span>`
    } else {
        var labelbe = ``
    }

    var passanger = {
        'userName': {
            'name': point.name,
            'memNum': point.members.length
        }
    }

    var locHtml = `
  <div class="panel panel-default panelDailyPoint" name="`+ point.points[0].name + point.location.time + `;` + point.points[0].name + `">
    <div name="`+ point.name + `panel" class="panel-heading">` + labelbe + point.points[0].name + ` - Start ` + point.location.time + ` Uhr
        <button class="close" onclick='deleteDayPoint("`+ point.points[0].name + point.location.time + `")' name="` + point.points[0].name + point.location.time + `dbutton")'><span>×</span></button>
    </div>
    <div class="panel-body">
        <div class="row">
        <div class="col-md-5">
            <div class="row">
            <div class="col-md-5">
                <div class="row">
                <div class="col-md-12">
                    <img src="`+ LogoImg + `" alt="loc-logo" class="img-thumbnail"/>
                </div>
                </div>
                <div class="row">
                <div class="col-md-12" style="max-width:20px">
                    ` + tagshtml + `
                </div>
                </div>
            </div>
            <div class="col-md-7">
                <div class="row">
                <div class="col-md-12">
                    <span class="addrr">Adresse</span>
                    <br/>
                    <span>`+ point.points[0].addrr.str + `</span>
                    <br/>
                    <span>`+ point.points[0].addrr.plz + ` ` + point.points[0].addrr.ort + `</span>
                    <br/>
                    <span class="addrr">Telefon</span>
                    <br/>
                    <span>`+ point.points[0].addrr.tel + `</span>
                        `+ mapbutton + `
                    <div class="col-md-6" style="padding:1px">
                        `+ menubuttonWeb + `
                    </div>
                    <div class="col-md-6" style="padding:1px">
                        `+ menubuttonPDF + `
                    </div>
                </div>
                </div>
            </div>
            <div class="col-md-12" name="appendComment`+ point.points[0].name + point.location.time + `">

            </div>
            <div class="col-md-12">
                    <div class="input-group">
                        <input id="commentarInput`+ point.points[0].name + point.location.time + `" type="text" class="form-control" placeholder="Kommentar schreiben">
                        <span class="input-group-btn">
                            <div class="btn btn-success btn-circle pull-right" onclick='addComment("`+ point.points[0].name + point.location.time + `;` + point.points[0].name + `")'>
                                <i class="glyphicon glyphicon-comment"></i>
                            </div>
                        </span>
                    </div><!-- /input-group -->
            </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="row" name="`+ point.name + `">
            <div onclick="addUserButton('`+ point.name + `;` + bestellung + `')" class="btn-toolbar pull-right btn btn-circle btn-success top--30px">
                <i class="glyphicon glyphicon-plus"></i>
            </div>

            </div>
        </div>
        <div class="col-md-3">
            <div class="imgcenter">
            <div class="carnum", name="carnum`+ point.name + `">0</div>
            <div class="passnum", name="passnum`+ point.name + `">0</div>
            </div>
        </div>
        </div>
    </div>
  </div>`;
    $('#toAppend').append($(locHtml));

    if (point.members.length > 0) {
        var memberSpan;
        var membersArr = point.members;
{'fraction_non_alphanumeric': 0.1619559214820021, 'fraction_numerical': 0.008333751694362167, 'mean_word_length': 1.409288824383164, 'pattern_counts': {'":': 0, '<': 359, '<?xml version=': 0, '>': 359, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 90, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '769172', 'n_tokens_mistral': 5664, 'n_tokens_neox': 5365, 'n_words': 1012}