mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-28 05:57:58 +01:00
38 lines
1.4 KiB
Text
38 lines
1.4 KiB
Text
elixir:
|
|
link = assigns[:link] || Routes.image_path(@conn, :show, @image)
|
|
size_class =
|
|
case @size do
|
|
:thumb ->
|
|
"media-box__content--large"
|
|
:medium ->
|
|
"media-box__content--featured"
|
|
_ ->
|
|
"media-box__content--small"
|
|
end
|
|
|
|
header_class =
|
|
case @size do
|
|
:thumb_small ->
|
|
"media-box__header--small"
|
|
_ ->
|
|
nil
|
|
end
|
|
|
|
.media-box data-image-id=@image.id
|
|
.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!"
|
|
a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id
|
|
i.fa.fa-arrow-up title="Yay!"
|
|
span.score title="Score" data-image-id=@image.id = @image.score
|
|
a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id
|
|
i.fa.fa-arrow-down title="Neigh!"
|
|
a.interaction--comment href="/#{@image.id}#comments" title="Comments"
|
|
i.fa.fa-comments>
|
|
= if @image.comments_count > 0 do
|
|
span.comments_count data-image-id=@image.id = @image.comments_count
|
|
/a.interaction--hide href="#" rel="nofollow" data-image-id=@image.id
|
|
i.fa.fa-eye-slash title="Hide"
|
|
.media-box__content class=size_class
|
|
= render PhilomenaWeb.ImageView, "_image_container.html", link: link, image: @image, size: @size, conn: @conn
|