summaryrefslogtreecommitdiff
path: root/app/views/posts/_display_posts.html.slim
blob: 07c0e468f2b83d7d67b6547cb79feedbf53a49c3 (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
ruby:
  featured ||= false
  compact ||= false

- posts.each do |post|
  / TODO: consider a CSS solution to size instead
  ruby:
    size = if featured
             :medium
           elsif current_user ? current_user.show_large_thumbnails : true
             :thumb
           else
             :thumb_small
           end
  - if post.present? && post.visible_to?(current_user)
    .media-box.js-post-root data-post-id=post.id
      .media-box__header.media-box__header--link-row
        = form_tag post_interactions_path(post)
          button.interaction--fave[type='submit' name='a' value='f']
            span.fave-span title='Fave!'
              i.fa.fa-star
            span.favorites title='Favorites' = post.faves_count
          button.interaction--upvote[type='submit' name='a' value='u']
            i.fa.fa-arrow-up title='Yay!'
          span.score title='Score' data-post-id=post.id = post.score
          button.interaction--downvote[type='submit' name='a' value='d']
            i.fa.fa-arrow-down title='Neigh!'
          - if show_comments?
            a.interaction--comments[href="/#{post.id}#comments"]
              i.fa.fa-comments
              span.comments_count[title='Comments'] = post.comments_count
          button.interaction--hide[type='submit' name='a' value='h']
            i.fa.fa-eye-slash title='Hide'
      .media-box__content.flex.flex--centered.flex--center-distributed
        include _post_container.html.slim

- if posts.empty?
  - if compact
    p No images found
  - else
    h3 No images found
    p You should check your filter settings are not too restrictive or that you're not trying to look for things that don't exist.