function buildProjectListAsTable()

in site/js/projects.js [943:999]


function buildProjectListAsTable(json) {
    var arr = [];
    for (p in projects) {
        var project = projects[p];

        // Get name of PMC
        var pmc = committees[project.pmc] ? committees[project.pmc].name : "Unknown";

        // Get project type
        var type = "Sub-Project";
        var shortp = p.split("-")[0];
        if (unixgroups[shortp]) {
            type = "TLP";
            if ((!committeesByName[project.name] && committees[project.pmc]) || project.name.match(/incubating/i)) {
                type = "Sub-project";
            }
        } else {
            type = "Retired";
        }

        if (project.podling || project.name.match(/incubating/i)) {
            type = "Podling";
            pmc = "Apache Incubator";
        }

        // Programming language
        var pl = project['programming-language'] ? project['programming-language'] : "Unknown";

        // Shove the result into a row
        arr.push([ p, project.name, type, pmc, pl, project.category])
    }

    // Construct the data table
    $('#contents').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="projectlist"></table>' );

    $('#projectlist').dataTable( {
        "data": arr,
        "columns": [
            { "title": "ID", "visible": false },
            { "title": "Name" },
            { "title": "Type" },
            { "title": "PMC" },
            { "title": "Programming Language(s)" },
            { "title": "Category" }
        ],
        "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                    jQuery(nRow).attr('id', aData[0]);
                    jQuery(nRow).css("cursor", "pointer");
                    return nRow;
                }
    } );

    $('#projectlist tbody').on('click', 'tr', function () {
        var name = $(this).attr('id');
        location.href = "project.html?" + name
    } );
}