2019-10-05 00:52:44 +02:00
|
|
|
elixir:
|
2024-06-06 22:28:35 +02:00
|
|
|
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
|
2023-11-23 17:07:49 +01:00
|
|
|
.media-box__header class=header_class data-image-id=@image.id
|
|
|
|
.media-box__header--link-row
|
|
|
|
a.interaction--fave href="#" rel="nofollow" data-image-id=@image.id
|
|
|
|
i.fa.fa-star title="Fave!"
|
2024-06-12 20:50:46 +02:00
|
|
|
span.interaction--fave.interaction--nohover.interaction--optional.hidden--phone = shorten_number(@image.faves_count)
|
2023-11-23 17:07:49 +01:00
|
|
|
a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id
|
|
|
|
i.fa.fa-arrow-up title="Yay!"
|
2024-06-12 20:50:46 +02:00
|
|
|
span.score title="Score" data-image-id=@image.id = shorten_number(@image.score)
|
2023-11-23 17:07:49 +01:00
|
|
|
a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id
|
|
|
|
i.fa.fa-arrow-down title="Neigh!"
|
2024-06-12 20:50:46 +02:00
|
|
|
a.interaction--hide.interaction--optional.hidden--phone href="#" rel="nofollow" data-image-id=@image.id
|
|
|
|
i.fa.fa-eye-slash title="Hide"
|
2023-11-23 17:07:49 +01:00
|
|
|
a.interaction--comment href="/#{@image.id}#comments" title="Comments"
|
|
|
|
i.fa.fa-comments>
|
|
|
|
= if @image.comments_count > 0 do
|
2024-06-12 20:50:46 +02:00
|
|
|
span.comments-count data-image-id=@image.id = shorten_number(@image.comments_count)
|
2023-11-23 17:07:49 +01:00
|
|
|
.media-box__content 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
|