mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
fix gallery page ordering bug (derpibooru/philomena#195)
This commit is contained in:
parent
da38408ef4
commit
96f1005255
1 changed files with 9 additions and 7 deletions
|
@ -46,12 +46,15 @@ defmodule PhilomenaWeb.GalleryController do
|
|||
user = conn.assigns.current_user
|
||||
query = "gallery_id:#{gallery.id}"
|
||||
|
||||
params =
|
||||
Map.merge(conn.params, %{
|
||||
"q" => query,
|
||||
"sf" => "gallery_id:#{gallery.id}",
|
||||
"sd" => position_order(gallery)
|
||||
})
|
||||
conn =
|
||||
update_in(
|
||||
conn.params,
|
||||
&Map.merge(&1, %{
|
||||
"q" => query,
|
||||
"sf" => "gallery_id:#{gallery.id}",
|
||||
"sd" => position_order(gallery)
|
||||
})
|
||||
)
|
||||
|
||||
{:ok, {images, _tags}} = ImageLoader.search_string(conn, query)
|
||||
{gallery_prev, gallery_next} = prev_next_page_images(conn, query)
|
||||
|
@ -75,7 +78,6 @@ defmodule PhilomenaWeb.GalleryController do
|
|||
|
||||
conn
|
||||
|> NotificationCountPlug.call([])
|
||||
|> Map.put(:params, params)
|
||||
|> assign(:clientside_data, gallery_images: gallery_json)
|
||||
|> render("show.html",
|
||||
title: "Showing Gallery",
|
||||
|
|
Loading…
Reference in a new issue