From 7ebba8b368bf918d267ebedf5c6f5dfa276b8b06 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 22 Dec 2021 21:30:28 -0500 Subject: [PATCH] Fix propagation of hidden parameter in searches --- lib/philomena_web/templates/layout/_header.html.slime | 2 ++ lib/philomena_web/templates/search/_form.html.slime | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/philomena_web/templates/layout/_header.html.slime b/lib/philomena_web/templates/layout/_header.html.slime index 98afd3ae..f922ef3a 100644 --- a/lib/philomena_web/templates/layout/_header.html.slime +++ b/lib/philomena_web/templates/layout/_header.html.slime @@ -18,6 +18,8 @@ header.header input type="hidden" name="sf" value=@conn.params["sf"] = if present?(@conn.params["sd"]) do input type="hidden" name="sd" value=@conn.params["sd"] + = if present?(@conn.params["hidden"]) do + input type="hidden" name="hidden" value=@conn.params["hidden"] = if hides_images?(@conn) do = select f, :del, [{"-D", ""}, {"+D", 1}, {"*D", "deleted"}, {"DO", "only"}], name: "del", class: "input header__input js-staff-action", autocomplete: "off" diff --git a/lib/philomena_web/templates/search/_form.html.slime b/lib/philomena_web/templates/search/_form.html.slime index 97760553..fa3dd74d 100644 --- a/lib/philomena_web/templates/search/_form.html.slime +++ b/lib/philomena_web/templates/search/_form.html.slime @@ -168,5 +168,8 @@ h1 Search = select f, :sf, sort_fields, class: "input input--separate-left", name: "sf", autocomplete: "off", selected: @conn.params["sf"] = select f, :sd, sort_directions, class: "input input--separate-left", name: "sd", autocomplete: "off", selected: @conn.params["sd"] + = if present?(@conn.params["hidden"]) do + = hidden_input f, :hidden, name: "hidden", value: @conn.params["hidden"] + = if hides_images?(@conn) do = select f, :del, sort_hidden, class: "input input--separate-left", name: "del", autocomplete: "off", selected: @conn.params["del"]