diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-08 21:54:52 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-08 21:54:52 +0300 |
commit | 218219abbdfdc3bc0bc1a9c95cfc0e0ddb5861dd (patch) | |
tree | 42cbccd75357e44ad9895b59de76e9a56c03be4a /app/views/projects/diffs/_stats.html.haml | |
parent | bde3f25d262b13d0139276786fe9d9cba29269b8 (diff) | |
download | gitlab-ce-218219abbdfdc3bc0bc1a9c95cfc0e0ddb5861dd.tar.gz |
Refactoring inside refactoring. We need to go deeper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/diffs/_stats.html.haml')
-rw-r--r-- | app/views/projects/diffs/_stats.html.haml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml new file mode 100644 index 00000000000..8ef7cc6e086 --- /dev/null +++ b/app/views/projects/diffs/_stats.html.haml @@ -0,0 +1,41 @@ +.js-toggle-container + .commit-stat-summary + Showing + %strong.cdark #{pluralize(diffs.count, "changed file")} + - if current_controller?(:commit) + - unless @commit.has_zero_stats? + with + %strong.cgreen #{@commit.stats.additions} additions + and + %strong.cred #{@commit.stats.deletions} deletions + + = link_to '#', class: 'btn btn-small js-toggle-button' do + Show diff stats + %i.icon-chevron-down + .file-stats.js-toggle-content.hide + %ul.bordered-list + - diffs.each_with_index do |diff, i| + %li + - if diff.deleted_file + %span.deleted-file + %a{href: "#diff-#{i}"} + %i.icon-minus + = diff.old_path + - elsif diff.renamed_file + %span.renamed-file + %a{href: "#diff-#{i}"} + %i.icon-minus + = diff.old_path + \-> + = diff.new_path + - elsif diff.new_file + %span.new-file + %a{href: "#diff-#{i}"} + %i.icon-plus + = diff.new_path + - else + %span.edit-file + %a{href: "#diff-#{i}"} + %i.icon-adjust + = diff.new_path + |