summaryrefslogtreecommitdiff
path: root/app/views/source_changes/_source_changes.html.slim
blob: be71ccf64885038c6b5b9aa870b707c128d059c5 (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
.block
  - pagination = paginate @source_changes
  .block__header = pagination

  .block__content
    - can_manage = can? :manage, SourceChange
    - if @source_changes.any?
      table.table
        thead
          tr
            th colspan=2 Image
            th New Source
            th Timestamp
            th User
            th Initial?
        tbody
          - @source_changes.order(created_at: :desc).each do |sc|
            tr
              - if sc.post && sc.post.visible_to?(current_user)
                td.center
                  = link_to sc.post.id, short_post_path(sc.post)
                  - if sc.post.hidden_from_users
                    | (deleted)
                td.center = render partial: 'posts/post_container', locals: { post: sc.post, size: :thumb_tiny }
              - else
                td.center N/A
                td.center Image Merged/Deleted
              td
                =<> sc.new_value || '<Value missing>'
                - if can_manage
                  =<> link_to 'Delete', source_change_path(sc), method: :delete
              td = friendly_time(sc.created_at)
              - signify_staff = sc.user_visible? && sc.user.staff?
              td[class=(signify_staff ? 'success' : 'blank')]
                =<> link_to_author(sc, can_manage)
                - if can_manage
                  => link_to_ip sc.ip
                - if sc.post && sc.post.uploader_is?(sc.user, sc.ip)
                  br
                  - if sc.user_visible?
                    | (Image Uploader)
                  - else
                    | (Anonymous Uploader)
                - if signify_staff
                  br
                  small
                  strong> Stop!
                  | This user is a staff member.
                  br
                  | Ask them before reverting their changes.
              td
                - if sc.initial
                  | &#x2713;
    - else
      | No source changes!

  .block__header = pagination