summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_stats.html.haml
blob: c4d7f26430bda8255608740252a4dd9faadc3302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.js-toggle-container
  .commit-stat-summary
    Showing
    = link_to '#', class: 'js-toggle-button' do
      %strong #{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
  .file-stats.js-toggle-content.hide
    %ul
      - diffs.each_with_index do |diff, i|
        %li
          - if diff.deleted_file
            %span.deleted-file
              %a{href: "#diff-#{i}"}
                %i.fa.fa-minus
                = diff.old_path
          - elsif diff.renamed_file
            %span.renamed-file
              %a{href: "#diff-#{i}"}
                %i.fa.fa-minus
                = diff.old_path
                →
                = diff.new_path
          - elsif diff.new_file
            %span.new-file
              %a{href: "#diff-#{i}"}
                %i.fa.fa-plus
                = diff.new_path
          - else
            %span.edit-file
              %a{href: "#diff-#{i}"}
                %i.fa.fa-adjust
                = diff.new_path