<commit_before>(function($, _){
    var displayAdmins = function(){
        var toHtml = function(admin){
            var result = "<span class='admin'>";
            result = result + "</br>" + "<a href='../admin/" + admin.admin_hash + "'>" + admin.admin_username + "<a/>";
            result = result + "</br>" + admin.admin_id + "</br>";
            result = result + "<button name='"+admin.admin_id+"'>delete</button>"
            result = result + "</span>";
            return result;
        };
        $.ajax({
            contentType: 'application/json',
            data: {},
            dataType: 'json',
            success: function(response){
                console.log(response);
                var data = $(".data")[0];
                var inner = _.reduce(response, function(accume, v){
                    accume = accume + toHtml(v);
                    return accume;
                }, "");
                $(data).html(inner);
            },
            error: function(){
                console.log("Device control failed");
            },
            processData: false,
            type: 'GET',
            url: '../admin'
        });
    };
    $(document).ready(function(){
        displayAdmins();
    });
})($, _);<commit_msg>started working on javascript model stuff<commit_after>(function($, _){
    var displayAdmins = function(){
        var render = function(obj, anchor){
            console.debug(obj.html());
            anchor.append(obj.html());
            anchor.append("hi");
            $("."+obj.id()).click(obj.deleteFn(obj.id()));
        };
        var toHtml = function(admin){
            var result = {
                "html" : function(){
                    var html = "<span class='"+admin.admin_id+"'>";
                    html = html + "</br>" + "<a href='../admin/" + admin.admin_hash + "'>" + admin.admin_username + "<a/>";
                    html = html + "</br>" + admin.admin_id + "</br>";
                    html = html + "<button name='"+admin.admin_id+"'>delete</button>"
                    html = html + "</span>";
                    return html;
                },
                "id" : function(){
                    return admin.admin_id;
                },
                "deleteFn" : function(id){
                    var obj = $("."+id);
                    return function(){ obj.hide();};
                },
            };
            return result;
        };
        $.ajax({
            contentType: 'application/json',
            data: {},
            dataType: 'json',
            success: function(response){
                console.log(response);
                var data = $(".data");
                var inner = _.reduce(response, function(accume, v){
                    accume = accume + toHtml(v);
                    return accume;
                }, "");
//                var obj = response[0];
                render(toHtml(response[0]), data);
//                $(data).html(inner);
            },
            error: function(){
                console.log("Device control failed");
            },
            processData: false,
            type: 'GET',
            url: '../admin'
        });
    };
    $(document).ready(function(){
        displayAdmins();
    });
})($, _);
{'fraction_non_alphanumeric': 0.16742909423604757, 'fraction_numerical': 0.0009149130832570906, 'mean_word_length': 1.2969187675070029, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4432769', 'n_tokens_mistral': 850, 'n_tokens_neox': 815, 'n_words': 174}