philomena/lib/philomena_web/templates/image/_image_box.html.slime

39 lines
1.5 KiB
Text
Raw Permalink Normal View History

2019-10-05 00:52:44 +02:00
elixir:
link = assigns[:link] || ~p"/images/#{@image}"
2019-10-05 02:31:35 +02:00
size_class =
2019-10-05 00:52:44 +02:00
case @size do
:thumb ->
"media-box__content--large"
:medium ->
"media-box__content--featured"
_ ->
"media-box__content--small"
end
2019-10-05 02:31:35 +02:00
header_class =
case @size do
:thumb_small ->
"media-box__header--small"
_ ->
nil
end
2019-08-18 18:17:05 +02:00
.media-box data-image-id=@image.id
2019-10-05 02:31:35 +02:00
.media-box__header.media-box__header--link-row class=header_class data-image-id=@image.id
2019-08-18 18:17:05 +02:00
a.interaction--fave href="#" rel="nofollow" data-image-id=@image.id
2020-02-06 23:40:25 +01:00
span.fave-span title="Fave!"
2019-08-18 18:17:05 +02:00
i.fa.fa-star
2020-02-06 23:40:25 +01:00
span.favorites title="Favorites" data-image-id=@image.id = @image.faves_count
2019-08-18 18:17:05 +02:00
a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id
2020-02-06 23:40:25 +01:00
i.fa.fa-arrow-up title="Yay!"
span.score title="Score" data-image-id=@image.id = @image.score
2019-08-18 18:17:05 +02:00
a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id
2020-02-06 23:40:25 +01:00
i.fa.fa-arrow-down title="Neigh!"
a.interaction--comments href="/#{@image.id}#comments" title="Comments"
2019-08-18 18:17:05 +02:00
i.fa.fa-comments
span.comments_count data-image-id=@image.id = @image.comments_count
a.interaction--hide href="#" rel="nofollow" data-image-id=@image.id
2020-02-06 23:40:25 +01:00
i.fa.fa-eye-slash title="Hide"
2019-10-05 02:31:35 +02:00
.media-box__content.flex.flex--centered.flex--center-distributed class=size_class
2020-02-06 23:40:25 +01:00
= render PhilomenaWeb.ImageView, "_image_container.html", link: link, image: @image, size: @size, conn: @conn