<commit_before>extends layout

block content
        script
            $(function(){
                //Client search functionality
                $("#inputIcon").typeahead({
                    source : function(query, process){
                        console.log(query);
                        return ["<NAME>", "<NAME>"];
                    }
                });
                $("#inputIcon").click(function(){
                    if($(this).val() == "Kliendi nimi"){
                        $(this).val("");
                    }
                });
                $("#inputIcon").change(function(){
                    var exists = true;
                    $(this).closest(".control-group").toggleClass("error",!exists);
                    $(this).closest(".control-group").toggleClass("success",exists);
                });
                //Product table total
                function calculateTotal(){
                    var total = getTotal();
                    $("#sum").html(total);
                }
                function getTotal(){
                    var total = 0;
                    $("#prod-tbody tr:visible .price").each(function(i, val){
                        var qty = Number($(val).parent().siblings("td").children(".qty").html());
                        console.log(qty);
                        total += Number($(val).html())*qty;
                    });
                    return total;
                }
                //Adding and removing products
                $(".prod-add").click(function(){
                    var qty = $(this).siblings(".qty");
                    var newQty = Number(qty.html())+1;
                    qty.html(" "+newQty+" ");
                    calculateTotal();
                });
                $(".prod-remove").click(function(){
                    var qty = $(this).siblings(".qty");
                    var newQty = Number(qty.html())-1;
                    if(newQty < 0) {
                        return;
                    }
                    qty.html(" "+newQty+" ");
                    calculateTotal();
                });
                $("#pay").click(function(){
                    var total = getTotal();
                    var transaction = $("<tr class ='success'><td>12.09.2012 22:00</td><td>"+$("#inputIcon").val()+"</td><td>"+total+" €</td><td>Sulas</td></tr>");
                    transaction.prependTo("#trans-tbody");
                    setTimeout(function(){
                        transaction.removeClass("success");
                    },2000);
                    $(".qty").html(" 0 ");
                });
            });
        .container-fluid
            .row-fluid
                .span6
                    h2 <NAME>steem
            br
            .row-fluid
                .span6
                    .control-group
                        .controls
                            .input-prepend
                                span.add-on
                                    i.icon-user
                                input#inputIcon.span6(type='text', value='Kliendi nimi')
            br
            .row-fluid
                .span6
                    table.table.table-bordered.table-hover
                        thead
                            tr
                                th Toode
                                th Kogus
                                th Hind
                        tbody#prod-tbody
                            tr#beer
                                td Õlu
                                td 
                                    i.icon-plus-sign.prod-add
                                    span.qty  0 
                                    i.icon-minus-sign.prod-remove

                                td 
                                    span.price 1
                                    |  €
                            tr#nonalc
                                td Kali/Limonaad
                                td 
                                    i.icon-plus-sign.prod-add
                                    span.qty  0 
                                    i.icon-minus-sign.prod-remove

                                td 
                                    span.price 0.5
                                    |  €
                            tr#foxbeer
                                td Rebaseõlu
                                td 
                                    i.icon-plus-sign.prod-add
                                    span.qty  0 
                                    i.icon-minus-sign.prod-remove

                                td 
                                    span.price 0
                                    |  €
                            tr
                                th
                                th Kokku
                                th
                                    span#sum 0
                                    |  €
            .row-fluid
                .span4
                    .btn-group
                        button#pay.btn.btn-large.btn-primary Sulas
                        button.btn.btn-large Mobiiliga
                        button.btn.btn-large Ettemaksuga
                        button.btn.btn-large.btn-danger Võlg
            br
            .row-fluid
                .span4
                    h4 Viimased tehingud
            .row-fluid
                .span6
                    table.table.table-bordered.table-hover
                        thead
                            tr
                                th Aeg
                                th Nimi
                                th Summa
                                th Makseviis
                        tbody#trans-tbody
                            tr
                                td 12.09.2012 22:00
                                td Maido Käära
                                td 2 €
                                td Mobiil<commit_msg>Kiire õlu<commit_after>extends layout

block content
        script
            $(function(){
                //Client search functionality
                $("#inputIcon").typeahead({
                    source : function(query, process){
                        console.log(query);
                        return ["<NAME>", "<NAME>"];
                    }
                });
                $("#inputIcon").click(function(){
                    if($(this).val() == "Kliendi nimi"){
                        $(this).val("");
                    }
                });
                $("#inputIcon").change(function(){
                    var exists = true;
                    $(this).closest(".control-group").toggleClass("error",!exists);
                    $(this).closest(".control-group").toggleClass("success",exists);
                });
                //Product table total
                function calculateTotal(){
                    var total = getTotal();
                    $("#sum").html(total);
                }
                function getTotal(){
                    var total = 0;
                    $("#prod-tbody tr:visible .price").each(function(i, val){
                        var qty = Number($(val).parent().siblings("td").children(".qty").html());
                        console.log(qty);
                        total += Number($(val).html())*qty;
                    });
                    return total;
                }
                //Adding and removing products
                $(".prod-add").click(function(){
                    var qty = $(this).siblings(".qty");
                    var newQty = Number(qty.html())+1;
                    qty.html(" "+newQty+" ");
                    calculateTotal();
                });
                $(".prod-remove").click(function(){
                    var qty = $(this).siblings(".qty");
                    var newQty = Number(qty.html())-1;
                    if(newQty < 0) {
                        return;
                    }
                    qty.html(" "+newQty+" ");
                    calculateTotal();
                });
                function addTransaction(total){
                    var transaction = $("<tr class ='success'><td>12.09.2012 22:00</td><td>"+$("#inputIcon").val()+"</td><td>"+total+" €</td><td>Sulas</td></tr>");
                    transaction.prependTo("#trans-tbody");
                    setTimeout(function(){
                        transaction.removeClass("success");
                    },2000);
                    $(".qty").html(" 0 ");
                }
                $("#pay").click(function(){
                    addTransaction(getTotal());
                });
                $("#one-beer").click(function(){
                    addTransaction(1);
                });
            });
        .container-fluid
            .row-fluid
                .span6
                    h2 <NAME>steem
            br
            .row-fluid
                .span2
                    .control-group
                        .controls
                            .input-prepend.input-append
                                span.add-on
                                    i.icon-user
                                input#inputIcon(type='text', value='<NAME>')
                                button#one-beer.btn.btn-primary Üks õlu
            br
            .row-fluid
                .span6
                    #accordion.accordion
                        .accordion-group
                            .accordion-heading
                                a.accordion-toggle(data-toggle='collapse', data-parent='#accordion', href='#collapseOne') Täpsemalt
                            #collapseOne.accordion-body.collapse.input
                                .accordion-inner 
                                    table.table.table-bordered.table-hover
                                        thead
                                            tr
                                                th Toode
                                                th Kogus
                                                th Hind
                                        tbody#prod-tbody
                                            tr#beer
                                                td Õlu
                                                td 
                                                    i.icon-plus-sign.prod-add
                                                    span.qty  0 
                                                    i.icon-minus-sign.prod-remove

                                                td 
                                                    span.price 1
                                                    |  €
                                            tr#nonalc
                                                td Kali/Limonaad
                                                td 
                                                    i.icon-plus-sign.prod-add
                                                    span.qty  0 
                                                    i.icon-minus-sign.prod-remove

                                                td 
                                                    span.price 0.5
                                                    |  €
                                            tr#foxbeer
                                                td Rebaseõlu
                                                td 
                                                    i.icon-plus-sign.prod-add
                                                    span.qty  0 
                                                    i.icon-minus-sign.prod-remove

                                                td 
                                                    span.price 0
                                                    |  €
                                            tr
                                                th
                                                th Kokku
                                                th
                                                    span#sum 0
                                                    |  €
                                    .btn-group
                                        button#pay.btn.btn-large.btn-primary Sulas
                                        button.btn.btn-large Mobiiliga
                                        button.btn.btn-large Ettemaksuga
                                        button.btn.btn-large.btn-danger Võlg
            .row-fluid
                .span4
                    h4 Viimased tehingud
            .row-fluid
                .span6
                    table.table.table-bordered.table-hover
                        thead
                            tr
                                th Aeg
                                th Nimi
                                th Summa
                                th Makseviis
                        tbody#trans-tbody
                            tr
                                td 12.09.2012 22:00
                                td <NAME>
                                td 2 €
                                td Mobiil
{'fraction_non_alphanumeric': 0.08940071217516478, 'fraction_numerical': 0.007652094855670884, 'mean_word_length': 0.5522107243650047, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 124, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '183399', 'n_tokens_mistral': 2770, 'n_tokens_neox': 2460, 'n_words': 437}