BigW Consortium Gitlab

_stats.html.haml 1.45 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")
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.hidden-xs.hidden-sm{ "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
19
    = dropdown_filter("Search files")
20 21 22 23
    .dropdown-content
      %ul
        - diff_files.each do |diff_file|
          %li
24
            %a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
25
              = icon("#{diff_file_changed_icon(diff_file)} fw", class: "#{diff_file_changed_icon_color(diff_file)} append-right-5")
26
              %span.diff-file-changes-path.append-right-5= diff_file.new_path
27
              .pull-right
Phil Hughes committed
28
                %span.cgreen<
29
                  +#{diff_file.added_lines}
Phil Hughes committed
30
                %span.cred<
31
                  \-#{diff_file.removed_lines}
32 33
        %li.dropdown-menu-empty-item.hidden
          %a
34
            No files found.