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

93 lines
4.6 KiB
Text
Raw Normal View History

2023-11-23 17:07:49 +01:00
.block.block__content
.metabar.flex.flex--wrap.layout--centered id="image_meta_#{@image.id}"
.metabar__navigation.hidden--phone
2019-11-30 03:33:15 +01:00
a.js-prev href=Routes.image_navigate_path(@conn, :index, @image, [rel: "prev"] ++ scope(@conn)) title="Previous Image (j)"
2019-08-18 20:14:36 +02:00
i.fa.fa-chevron-left
2019-11-30 03:33:15 +01:00
a.js-up href=Routes.image_navigate_path(@conn, :index, @image, [rel: "find"] ++ scope(@conn)) title="Find this image in the global image list (i)"
2019-08-18 20:14:36 +02:00
i.fa.fa-chevron-up
2019-11-30 03:33:15 +01:00
a.js-next href=Routes.image_navigate_path(@conn, :index, @image, [rel: "next"] ++ scope(@conn)) title="Next Image (k)"
2019-08-18 20:14:36 +02:00
i.fa.fa-chevron-right
2019-11-30 06:40:37 +01:00
a.js-rand href=Routes.image_random_path(@conn, :index, scope(@conn)) title="Random (r)"
2019-08-18 20:14:36 +02:00
i.fa.fa-random
2023-11-23 17:07:49 +01:00
.metabar__interactions
2019-08-18 20:14:36 +02:00
a.interaction--fave href="#" rel="nofollow" data-image-id=@image.id
span.favorites> title="Favorites" data-image-id=@image.id = @image.faves_count
span.fave-span title="Fave!"
i.fa.fa-star
a.interaction--upvote href="#" rel="nofollow" data-image-id=@image.id
2019-11-30 23:40:53 +01:00
= if show_vote_counts?(@conn.assigns.current_user) do
span.upvotes> title="Upvotes" data-image-id=@image.id = @image.upvotes_count
2019-08-18 20:14:36 +02:00
span.upvote-span title="Yay!"
i.fa.fa-arrow-up
2023-11-23 17:07:49 +01:00
span.score data-image-id=@image.id = @image.score
2019-08-18 20:14:36 +02:00
a.interaction--downvote href="#" rel="nofollow" data-image-id=@image.id
span.downvote-span title="Neigh!"
i.fa.fa-arrow-down
2019-11-30 23:40:53 +01:00
= if show_vote_counts?(@conn.assigns.current_user) do
span.downvotes< title="Downvotes" data-image-id=@image.id = @image.downvotes_count
2023-11-23 17:07:49 +01:00
a.interaction--comment.hidden--phone href="#comments" title="Comments"
2019-08-18 20:14:36 +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
span.hide-span title="Hide"
i.fa.fa-eye-slash
2023-11-23 17:07:49 +01:00
.metabar__interactions.hidden--mobile
2019-11-17 18:50:42 +01:00
= render PhilomenaWeb.Image.SubscriptionView, "_subscription.html", watching: @watching, image: @image, conn: @conn
= render PhilomenaWeb.ImageView, "_add_to_gallery_dropdown.html", image: @image, user_galleries: @user_galleries, conn: @conn
2019-12-21 00:07:02 +01:00
a href=Routes.image_related_path(@conn, :index, @image) title="Related Images"
i.fa.fa-sitemap>
2023-11-23 17:07:49 +01:00
span.hidden--mobile Related
.metabar__mobile-separator
.metabar__interactions.hidden--phone
2019-08-18 20:14:36 +02:00
a href="#{pretty_url(@image, false, false)}" rel="nofollow" title="View (tags in filename)"
i.fa.fa-eye>
| View
a href="#{pretty_url(@image, true, false)}" rel="nofollow" title="View (no tags in filename)"
i.fa.fa-eye>
| VS
a href="#{pretty_url(@image, false, true)}" rel="nofollow" title="Download (tags in filename)"
i.fa.fa-download>
| Download
a href="#{pretty_url(@image, true, true)}" title="Download (no tags in filename)"
i.fa.fa-download>
| DS
2023-11-23 17:07:49 +01:00
.metabar__interactions.hidden--desktop.hidden--tablet
= render PhilomenaWeb.Image.SubscriptionView, "_subscription.html", watching: @watching, image: @image, conn: @conn
= render PhilomenaWeb.ImageView, "_add_to_gallery_dropdown.html", image: @image, user_galleries: @user_galleries, conn: @conn
a href=Routes.image_related_path(@conn, :index, @image) title="Related Images"
i.fa.fa-sitemap
a href="#{pretty_url(@image, true, false)}" rel="nofollow" title="View (no tags in filename)"
i.fa.fa-eye
a href="#{pretty_url(@image, true, true)}" title="Download (no tags in filename)"
i.fa.fa-download
.metabar.metabar__user-credit.hidden--phone.layout--centered#extrameta
2019-08-18 20:14:36 +02:00
div
2019-10-04 03:03:33 +02:00
' Uploaded
=> pretty_time(@image.created_at)
2019-12-17 19:53:41 +01:00
= render PhilomenaWeb.ImageView, "_uploader.html", assigns
2019-08-18 20:14:36 +02:00
span.image-size
| &nbsp;
= @image.image_width
| x
= @image.image_height
2020-07-06 20:00:02 +02:00
= if not is_nil(@image.image_duration) and @image.image_is_animated and @image.image_duration > 0 do
span.image-size title=@image.image_duration
2020-07-06 20:00:02 +02:00
| &nbsp;
- dur = trunc(@image.image_duration)
- ms = trunc((@image.image_duration - dur)*100)
- {mm, ss} = {div(dur, 60), rem(dur, 60)}
= :io_lib.format("~2..0B:~2..0B.~2..0B", [mm, ss, ms])
2020-07-06 20:00:02 +02:00
2019-12-09 00:17:12 +01:00
=<> String.upcase(to_string(@image.image_format))
2020-07-06 14:56:23 +02:00
- size_kb = div(@image.image_size, 1000)
- size_mb = Float.round(size_kb / 1000.0, 2)
2019-08-18 20:14:36 +02:00
span title="#{size_kb} kB"
2020-07-06 14:56:23 +02:00
= if size_kb <= 1000 do
2019-08-18 20:14:36 +02:00
=> size_kb
| kB
- else
=> size_mb
| MB