~qeef/damn-client.js

888faff0be87d76f09091c78ce09ef2528ec2e8f — Jiri Vlasak 4 months ago 270bd7e
Distinguish authors and mappers in statistics
1 files changed, 22 insertions(+), 1 deletions(-)

M static/light-stats.js
M static/light-stats.js => static/light-stats.js +22 -1
@@ 134,6 134,7 @@ function html_light_stats(area)
    ih += "<a href='javascript:clean_adv(" + aid + ");show_squares_map(" + aid + ")'>squares map</a>";
    ih += " <a href='javascript:clean_adv(" + aid + ");show_all_commits(" + aid + ")'>all commits</a>";
    ih += " <a href='javascript:clean_adv(" + aid + ");show_all_authors(" + aid + ")'>all authors</a>";
    ih += " <a href='javascript:clean_adv(" + aid + ");show_all_mappers(" + aid + ")'>all mappers</a>";
    ih += " <a href='javascript:clean_adv(" + aid + ");show_local_mappers(" + aid + ")'>local mappers</a>";
    ih += " <a href='javascript:clean_adv(" + aid + ")'>clean</a>";
    ih += "</div>";


@@ 160,6 161,26 @@ function show_all_commits(aid, of=false)
    up(stats_a(), ih);
    if (of) add_hist("damn " + aid, link_to("stats", aid, of));
}
function show_all_mappers(aid)
{
    var ih = "";
    var authors_li = mappers(aid);
    var li = [];
    for (k in authors_li) li.push(html_author_row(aid, authors_li[k]));
    up(stats_a(), html_list(li));
}
function mappers(aid=false)
{
    if (!aid) return [];
    var li = [];
    for (k in api.areas[aid]["commits"]) {
        var c = api.areas[aid]["commits"][k];
        if (li.indexOf(c["author"]) == -1) {
            li.push(c["author"]);
        }
    }
    return li;
}
function show_all_authors(aid)
{
    var ih = "";


@@ 174,7 195,7 @@ function authors(aid=false)
    var li = [];
    for (k in api.areas[aid]["commits"]) {
        var c = api.areas[aid]["commits"][k];
        if (li.indexOf(c["author"]) == -1) {
        if (c["type"] == "update" && li.indexOf(c["author"]) == -1) {
            li.push(c["author"]);
        }
    }