Ignore:
Timestamp:
01/15/24 00:11:01 (5 months ago)
Author:
gjoko kostadinov <gjokokostadinov@…>
Branches:
master
Children:
943857c
Parents:
e8999eb
Message:

Add services search functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/resources/static/js/register_business.js

    re8999eb rf29cd58  
    1717        var $el = $("#predefined_services");
    1818        $el.empty();
     19        console.log(selectedObj['serviceTypes']);
    1920        $.each(selectedObj['serviceTypes'], function (index, obj) {
    2021            $el.append(
    21                 '<div class=\"form-outline mb-4\">' +
     22                '<div class="form-outline mb-4">' +
    2223                '    <div class="row">' +
    2324                '        <div class="col-md-6">\n' +
    24                 '            <input class="form-check-input" type="checkbox" value=\"' + obj.id + '\" id=\"' + obj.id + '\">\n' +
    25                 '            <label class="form-check-label" for=\"' + obj.id + '\">\n' +
     25                '            <input class="form-check-input" type="checkbox" value="' + obj.id + '" id="' + obj.id + '">\n' +
     26                '            <label class="form-check-label" for="' + obj.id + '">\n' +
    2627                obj.name +
    2728                '            </label>\n' +
    2829                '        </div>' +
    29                 '        <div class=\"form-outline col-md-2 d-grid\">' +
    30                 '            <input type=\"text\" id=\"' + obj.id + obj.name.replace(/\s/g, "") + "duration" + '\" class=\"form-control\" placeholder="time" />' +
     30                '        <div class="form-outline col-md-2 d-grid">' +
     31                '            <input type="text" id="' + obj.id + obj.name.replace(/\s/g, "") + "duration" + '" class="form-control" placeholder="time" />' +
    3132                '        </div>' +
    32                 '        <div class=\"form-outline col-md-2 d-grid\">' +
    33                 '            <input type=\"text\" id=\"' + obj.id + obj.name.replace(/\s/g, "") + "price" + '\" class=\"form-control\" placeholder="price" />' +
     33                '        <div class="form-outline col-md-2 d-grid">' +
     34                '            <input type="text" id="' + obj.id + obj.name.replace(/\s/g, "") + "price" + '" class="form-control" placeholder="price" />' +
     35                '        </div>' +
     36                '    </div>' +
     37                '    <div class="row" style="margin-top:10px;">' +
     38                '        <div class="form-outline col-md-10 d-grid">' +
     39                '            <input type="text" id="' + obj.id + obj.name.replace(/\s/g, "") + "description" + '" class="form-control" placeholder="description" />' +
    3440                '        </div>' +
    3541                '    </div>' +
     
    5864            '        </div>' +
    5965            '        <div class="form-outline col-md-2 d-grid">' +
    60             '            <input type="text" id="' + -1 + input_service.replace(/\s/g, "") + "price"+ '" class="form-control" placeholder="price" />' +
     66            '            <input type="text" id="' + -1 + input_service.replace(/\s/g, "") + "price" + '" class="form-control" placeholder="price" />' +
     67            '        </div>' +
     68            '        <div class="row" style="margin-top:10px;">' +
     69            '            <div class="form-outline col-md-10 d-grid">' +
     70            '                <input type="text" id="' + -1 + input_service.replace(/\s/g, "") + "description" + '" class="form-control" placeholder="description" />' +
     71            '            </div>' +
    6172            '        </div>' +
    6273            '    </div>' +
     
    90101            var time = $($($(label).parent()).siblings()[0]).children()[0].value;
    91102            var price = $($($(label).parent()).siblings()[1]).children()[0].value;
     103            var description = $($($($($($(label).parent())).parent()).siblings()[0]).children()[0]).children()[0].value;
    92104
    93105            var serviceType = {}
     
    99111            service['duration'] = time;
    100112            service['price'] = price;
     113            service['description'] = description;
    101114            servicesObj.push(service);
    102115        });
Note: See TracChangeset for help on using the changeset viewer.