diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-22 11:38:47 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-22 11:38:47 +0300 |
commit | 09daff61780a2fa391cf1a80bf152cca15740754 (patch) | |
tree | 69af484297a2e0a9bff74db5a1eec24abd14df45 /app/assets/javascripts/stat_graph_contributors.js.coffee | |
parent | 8d70ac008dbb43752e2c1f69530c4453eb8e0e2d (diff) | |
download | gitlab-ce-09daff61780a2fa391cf1a80bf152cca15740754.tar.gz |
Colors for author additions/develtions in graph
Diffstat (limited to 'app/assets/javascripts/stat_graph_contributors.js.coffee')
-rw-r--r-- | app/assets/javascripts/stat_graph_contributors.js.coffee | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/app/assets/javascripts/stat_graph_contributors.js.coffee b/app/assets/javascripts/stat_graph_contributors.js.coffee index 12dfe4da841..6cf6f1f022a 100644 --- a/app/assets/javascripts/stat_graph_contributors.js.coffee +++ b/app/assets/javascripts/stat_graph_contributors.js.coffee @@ -19,7 +19,27 @@ class window.ContributorsStatGraph author_graph.draw() ) format_author_commit_info: (author) -> - author.commits + " commits " + author.additions + " ++ / " + author.deletions + " --" + commits = $('<span/>', { + class: 'graph-author-commits-count' + }) + commits.text(author.commits + " commits") + + additions = $('<span/>', { + class: 'graph-additions' + }) + additions.text(author.additions + " ++") + + deletions = $('<span/>', { + class: 'graph-deletions' + }) + deletions.text(author.deletions + " --") + + $('<span/>').append(commits) + .append(" / ") + .append(additions) + .append(" / ") + .append(deletions) + create_author_header: (author) -> list_item = $('<li/>', { class: 'person' @@ -30,7 +50,7 @@ class window.ContributorsStatGraph class: 'commits' }) author_commit_info = @format_author_commit_info(author) - author_commit_info_span.text(author_commit_info) + author_commit_info_span.html(author_commit_info) list_item.append(author_name) list_item.append(author_commit_info_span) list_item @@ -52,10 +72,10 @@ class window.ContributorsStatGraph @field = field change_date_header: -> x_domain = ContributorsGraph.prototype.x_domain - print_date_format = d3.time.format("%B %e %Y"); - print = print_date_format(x_domain[0]) + " - " + print_date_format(x_domain[1]); - $("#date_header").text(print); + print_date_format = d3.time.format("%B %e %Y") + print = print_date_format(x_domain[0]) + " - " + print_date_format(x_domain[1]) + $("#date_header").text(print) redraw_author_commit_info: (author) -> author_list_item = $(@authors[author.author].list_item) author_commit_info = @format_author_commit_info(author) - author_list_item.find("span").text(author_commit_info)
\ No newline at end of file + author_list_item.find("span").html(author_commit_info) |