diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py index c558c9c..5d6632b 100644 --- a/pagure/lib/tasks.py +++ b/pagure/lib/tasks.py @@ -751,8 +751,12 @@ def commits_author_stats(repopath): out_stats = collections.defaultdict(list) for authors, val in stats.items(): out_stats[val].append(authors) + out_list = [ + (key, out_stats[key]) + for key in sorted(out_stats, reverse=True) + ] - return (cnt, out_stats, len(authors_email), commit.commit_time) + return (cnt, out_list, len(authors_email), commit.commit_time) @conn.task diff --git a/pagure/static/issues_stats.js b/pagure/static/issues_stats.js index 999fc24..32c1e11 100644 --- a/pagure/static/issues_stats.js +++ b/pagure/static/issues_stats.js @@ -77,12 +77,13 @@ show_commits_authors = function(data) { + data.results[2] + ' contributors

\n' + '
\n'; for (key in data.results[1]){ - for (key2 in data.results[1][key]){ - entry = data.results[1][key][key2] + cnt = data.results[1][key][0]; + for (entry in data.results[1][key][1]){ + entry = data.results[1][key][1][entry]; html += ' ' + entry[0] - + '
' + key + ' commits
' + + '
' + cnt + ' commits
' + '
\n'; } } diff --git a/tests/test_pagure_flask_internal.py b/tests/test_pagure_flask_internal.py index b048910..036b68d 100644 --- a/tests/test_pagure_flask_internal.py +++ b/tests/test_pagure_flask_internal.py @@ -1459,7 +1459,7 @@ class PagureFlaskInternaltests(tests.Modeltests): js_data2, {u'results': [ 2, - {u'2': [[u'Alice Author', u'alice@authors.tld']]}, + [[2, [[u'Alice Author', u'alice@authors.tld']]]], 1, 1509110062 ]