summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_replaced_image_diff.html.haml
blob: 8fc232b464e1bbe7bd94130327c58d2bc4a16a45 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- blob = diff_file.blob
- old_blob = diff_file.old_blob
- blob_raw_path = diff_file_blob_raw_path(diff_file)
- old_blob_raw_path = diff_file_old_blob_raw_path(diff_file)
- click_to_comment = local_assigns.fetch(:click_to_comment, true)
- diff_view_data = local_assigns.fetch(:diff_view_data, '')
- class_name = ''

- if click_to_comment
  - class_name = 'js-add-image-diff-note-button click-to-comment'

.image.js-replaced-image{ data: diff_view_data }
  .two-up.view
    .wrap
      .frame.deleted
        = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false)
      %p.image-info.hide
        %span.meta-filesize= number_to_human_size(old_blob.size)
        |
        %strong W:
        %span.meta-width
        |
        %strong H:
        %span.meta-height
    .wrap
      = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path }
      %p.image-info.hide
        %span.meta-filesize= number_to_human_size(blob.size)
        |
        %strong W:
        %span.meta-width
        |
        %strong H:
        %span.meta-height

  .swipe.view.hide
    .swipe-frame
      .frame.deleted
        = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false)
      .swipe-wrap
        = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path }
      %span.swipe-bar
        %span.top-handle
        %span.bottom-handle

  .onion-skin.view.hide
    .onion-skin-frame
      .frame.deleted
        = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false)
      = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path }
      .controls
        .transparent
        .drag-track
          .dragger{ :style => "left: 0px;" }
        .opaque

.view-modes.hide
  %ul.view-modes-menu
    %li.two-up{ data: { mode: 'two-up' } } 2-up
    %li.swipe{ data: { mode: 'swipe' } } Swipe
    %li.onion-skin{ data: { mode: 'onion-skin' } } Onion skin