_stats.html.haml 1.83 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.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
Phil Hughes's avatar
Phil Hughes committed
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 }
Phil Hughes's avatar
Phil Hughes committed
25
              = sprite_icon(diff_file_changed_icon(diff_file), size: 16, css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon append-right-8")
26
              %span.diff-changed-file-content.append-right-8
27
28
29
30
31
32
                - if diff_file.blob&.name
                  %strong.diff-changed-file-name
                    = diff_file.blob.name
                - else
                  %strong.diff-changed-blank-file-name
                    = s_('Diffs|No file name available')
33
                %span.diff-changed-file-path.prepend-top-5= diff_file_path_text(diff_file)
34
              %span.diff-changed-stats
Phil Hughes's avatar
Phil Hughes committed
35
                %span.cgreen<
36
                  +#{diff_file.added_lines}
Phil Hughes's avatar
Phil Hughes committed
37
                %span.cred<
38
                  \-#{diff_file.removed_lines}
39
40
        %li.dropdown-menu-empty-item.hidden
          %a
41
            No files found.