philomena/lib/philomena_web/templates/gallery/show.html.slime

85 lines
3.3 KiB
Text
Raw Normal View History

2019-12-05 01:53:31 +01:00
elixir:
scope = scope(@conn)
image_url = fn image, hit -> Routes.image_path(@conn, :show, image, Keyword.put(scope, :sort, hit["sort"])) end
2019-12-05 01:53:31 +01:00
route = fn p -> Routes.gallery_path(@conn, :show, @gallery, p) end
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: scope
info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images
#sortable class=sortable_classes(@conn)
2019-12-05 01:53:31 +01:00
.block#imagelist-container
2020-12-11 17:53:40 +01:00
section.block__header.flex.page__header
2023-11-23 17:07:49 +01:00
span.page__title
2020-12-11 17:53:40 +01:00
span
' Viewing gallery
strong>
= @gallery.title
2019-12-05 01:53:31 +01:00
2020-12-11 17:53:40 +01:00
.page__pagination = pagination
2019-12-05 01:53:31 +01:00
2023-11-23 17:07:49 +01:00
.flex__right.page__info
2019-12-26 23:43:32 +01:00
= render PhilomenaWeb.ImageView, "_random_button.html", conn: @conn, params: scope
2019-12-05 05:12:49 +01:00
a href=Routes.gallery_report_path(@conn, :new, @gallery)
2019-12-05 01:53:31 +01:00
i.fa.fa-exclamation-triangle>
2023-11-23 17:07:49 +01:00
span.hidden--mobile Report
2019-12-05 01:53:31 +01:00
= if can?(@conn, :edit, @gallery) do
a href=Routes.gallery_path(@conn, :edit, @gallery)
2019-12-15 19:04:41 +01:00
i.fas.fa-edit>
2023-11-23 17:07:49 +01:00
span.hidden--mobile Edit
2019-12-05 01:53:31 +01:00
= if can?(@conn, :edit, @gallery) do
2020-02-06 23:40:25 +01:00
a.rearrange-button.js-rearrange href="#" data-click-hide=".js-rearrange" data-click-show=".js-save,#gallery-rearrange-info"
2019-12-05 01:53:31 +01:00
i.fa.fa-sort>
' Rearrange
2019-12-05 05:12:49 +01:00
2020-02-06 23:40:25 +01:00
a.rearrange-button.js-save.hidden href="#" data-click-hide=".js-save,#gallery-rearrange-info" data-click-show=".js-rearrange" data-reorder-path=Routes.gallery_order_path(@conn, :update, @gallery)
2019-12-05 01:53:31 +01:00
i.fa.fa-check>
' Save
2019-12-21 23:15:16 +01:00
a href=Routes.gallery_path(@conn, :delete, @gallery) data-method="delete" data-confirm="Are you really, really sure?"
i.fa.fa-trash>
2023-11-23 17:07:49 +01:00
span.hidden--mobile Delete
2019-12-21 23:15:16 +01:00
2019-12-05 01:53:31 +01:00
= if show_subscription_link?(@gallery.creator, @conn.assigns.current_user) do
2019-12-05 05:12:49 +01:00
= render PhilomenaWeb.Gallery.SubscriptionView, "_subscription.html", watching: @watching, gallery: @gallery, conn: @conn
2019-12-05 01:53:31 +01:00
.block__header.block__header--light.block__header--sub
2023-11-23 17:07:49 +01:00
span A gallery by
2019-12-05 01:53:31 +01:00
=> link @gallery.creator.name, to: Routes.profile_path(@conn, :show, @gallery.creator)
' with
=> @gallery.image_count
= pluralize("image", "images", @gallery.image_count)
2023-11-23 17:07:49 +01:00
span.hidden--mobile
2020-12-11 17:53:40 +01:00
' , last updated
= pretty_time(@gallery.updated_at)
2019-12-05 01:53:31 +01:00
.block__content.flex.js-imagelist-info
2023-11-23 17:07:49 +01:00
.flex__fixed.media-tiny-container.spacing--right
2019-12-05 01:53:31 +01:00
= render PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb_tiny, conn: @conn
.flex__grow
= if @gallery.spoiler_warning not in [nil, ""] do
strong> Warning:
= @gallery.spoiler_warning
= if @gallery.description not in [nil, ""] do
p = @gallery.description
.block__content.hidden#gallery-rearrange-info
.block.block--fixed.block--primary
| Click the image and drag.
br
strong Note that you may have to wait a couple of seconds before the order is applied.
2023-11-23 17:07:49 +01:00
.media-list
= for {image, hit} <- @gallery_images do
= render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: image_url.(image, hit), size: :thumb, conn: @conn
2019-12-05 01:53:31 +01:00
2020-12-11 17:53:40 +01:00
.block__header.block__header--light.flex.page__header
.page__pagination = pagination
2019-12-05 01:53:31 +01:00
2023-11-23 17:07:49 +01:00
span.page__info
2019-12-15 19:04:41 +01:00
= info