diff --git a/app/assets/javascripts/stat_graph_contributors.js.coffee b/app/assets/javascripts/stat_graph_contributors.js.coffee index 12dfe4d..6cf6f1f 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 = $('', { + class: 'graph-author-commits-count' + }) + commits.text(author.commits + " commits") + + additions = $('', { + class: 'graph-additions' + }) + additions.text(author.additions + " ++") + + deletions = $('', { + class: 'graph-deletions' + }) + deletions.text(author.deletions + " --") + + $('').append(commits) + .append(" / ") + .append(additions) + .append(" / ") + .append(deletions) + create_author_header: (author) -> list_item = $('
  • ', { 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) diff --git a/app/assets/stylesheets/sections/graph.scss b/app/assets/stylesheets/sections/graph.scss index 9be4cb7..dd5d638 100644 --- a/app/assets/stylesheets/sections/graph.scss +++ b/app/assets/stylesheets/sections/graph.scss @@ -1,15 +1,15 @@ -.graph_holder { +.graph_holder { border: 1px solid #aaa; padding: 1px; - h4 { + h4 { padding: 0 10px; border-bottom: 1px solid #bbb; @include bg-gray-gradient; } - .graph { + .graph { background: #f1f1f1; height: 500px; overflow-y: scroll; @@ -17,3 +17,16 @@ } } +.graphs { + .graph-author-commits-count { + } + + .graph-additions { + color: #4a2; + } + + .graph-deletions { + color: #d12f19; + } +} + -- libgit2 0.21.2