gitlab-org--gitlab-foss/app/views/projects/diffs/_stats.html.haml

42 lines
1.8 KiB
Text
Raw Normal View History

- sum_added_lines = diff_files.sum(&:added_lines)
- sum_removed_lines = diff_files.sum(&:removed_lines)
.commit-stat-summary.dropdown
Showing
2018-04-23 15:30:22 -04:00
%button.diff-stats-summary-toggler.js-diff-stats-dropdown{ type: "button", data: { toggle: "dropdown", display: "static" } }<
= pluralize(diff_files.size, "changed file")
= sprite_icon("chevron-down", css_class: "gl-ml-2")
%span.diff-stats-additions-deletions-expanded#diff-stats
2017-07-27 10:53:04 -04:00
with
%strong.cgreen= pluralize(sum_added_lines, 'addition')
2017-07-27 10:53:04 -04:00
and
%strong.cred= pluralize(sum_removed_lines, 'deletion')
.diff-stats-additions-deletions-collapsed.float-right.d-none{ "aria-hidden": "true", "aria-describedby": "diff-stats" }
2017-07-27 10:53:04 -04:00
%strong.cgreen<
+#{sum_added_lines}
%strong.cred<
\-#{sum_removed_lines}
.dropdown-menu.diff-file-changes
= dropdown_filter("Search files")
.dropdown-content
%ul
- diff_files.each do |diff_file|
%li
%a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
= sprite_icon(diff_file_changed_icon(diff_file), css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon gl-mr-3")
%span.diff-changed-file-content.gl-mr-3
- if diff_file.file_path
%strong.diff-changed-file-name
= diff_file.file_path
- else
%strong.diff-changed-blank-file-name
= s_('Diffs|No file name available')
%span.diff-changed-file-path.gl-mt-2= diff_file_path_text(diff_file)
%span.diff-changed-stats
2017-07-27 10:30:57 -04:00
%span.cgreen<
+#{diff_file.added_lines}
2017-07-27 10:30:57 -04:00
%span.cred<
\-#{diff_file.removed_lines}
%li.dropdown-menu-empty-item.hidden
%a
= _("No files found.")