_stats.html.haml 1.52 KB
Newer Older
1
2
- sum_added_lines = diff_files.sum(&:added_lines)
- sum_removed_lines = diff_files.sum(&:removed_lines)
3
4
5
6
.commit-stat-summary.dropdown
  Showing
  %button.diff-stats-summary-toggler.js-diff-stats-dropdown{ type: "button", data: { toggle: "dropdown" } }<
    = pluralize(diff_files.size, "changed file")
Phil Hughes's avatar
Phil Hughes committed
7
    = icon("caret-down", class: "prepend-left-5")
8
  %span.diff-stats-additions-deletions-expanded#diff-stats
9
10
11
12
    with
    %strong.cgreen #{sum_added_lines} additions
    and
    %strong.cred #{sum_removed_lines} deletions
13
  .diff-stats-additions-deletions-collapsed.pull-right{ "aria-hidden": "true", "aria-describedby": "diff-stats" }
14
15
16
17
    %strong.cgreen<
      +#{sum_added_lines}
    %strong.cred<
      \-#{sum_removed_lines}
18
  .dropdown-menu.diff-file-changes
Phil Hughes's avatar
Phil Hughes committed
19
    = dropdown_filter("Search files")
20
21
22
23
24
25
26
27
28
29
30
    .dropdown-content
      %ul
        - diff_files.each do |diff_file|
          - file_hash = hexdigest(diff_file.file_path)
          - added_lines = diff_file.added_lines
          - removed_lines = diff_file.removed_lines
          %li
            %a{ href: "##{file_hash}", title: diff_file.new_path }
              = icon("#{diff_file_changed_icon(diff_file)} fw", class: "#{diff_file_changed_icon_color(diff_file)} append-right-5")
              %span.diff-file-changes-path= diff_file.new_path
              .pull-right
Phil Hughes's avatar
Phil Hughes committed
31
32
33
34
                %span.cgreen<
                  +#{added_lines}
                %span.cred<
                  \-#{removed_lines}
35
36
37
        %li.dropdown-menu-empty-link.hidden
          %a{ href: "#" }
            No files found.