From 2c121c80c8718788b7c66c91a1c735e368a95b9d Mon Sep 17 00:00:00 2001 From: SeinopSys Date: Sun, 19 Jul 2020 21:00:43 +0200 Subject: [PATCH] Fix handling of the added query parameter everywhere --- .../templates/fingerprint_profile/tag_change/index.html.slime | 3 ++- .../templates/ip_profile/tag_change/index.html.slime | 3 ++- .../templates/profile/tag_change/index.html.slime | 3 ++- lib/philomena_web/templates/tag/tag_change/index.html.slime | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime b/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime index c69d2d9b..956fef3b 100644 --- a/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime +++ b/lib/philomena_web/templates/fingerprint_profile/tag_change/index.html.slime @@ -3,7 +3,8 @@ h1 = @fingerprint - route = fn p -> Routes.fingerprint_profile_tag_change_path(@conn, :index, @fingerprint, p) end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn +- params = if @conn.params["added"] do [added: @conn.params["added"]] else nil end +- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params .block .block__header diff --git a/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime b/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime index 68ce6797..518c0316 100644 --- a/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime +++ b/lib/philomena_web/templates/ip_profile/tag_change/index.html.slime @@ -3,7 +3,8 @@ h1 = @ip - route = fn p -> Routes.ip_profile_tag_change_path(@conn, :index, to_string(@ip), p) end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn +- params = if @conn.params["added"] do [added: @conn.params["added"]] else nil end +- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params .block .block__header diff --git a/lib/philomena_web/templates/profile/tag_change/index.html.slime b/lib/philomena_web/templates/profile/tag_change/index.html.slime index ae2663df..29e9703e 100644 --- a/lib/philomena_web/templates/profile/tag_change/index.html.slime +++ b/lib/philomena_web/templates/profile/tag_change/index.html.slime @@ -4,7 +4,8 @@ h1 = @user.name - route = fn p -> Routes.profile_tag_change_path(@conn, :index, @user, p) end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: [added: @conn.params["added"]] +- params = if @conn.params["added"] do [added: @conn.params["added"]] else nil end +- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params .block .block__header diff --git a/lib/philomena_web/templates/tag/tag_change/index.html.slime b/lib/philomena_web/templates/tag/tag_change/index.html.slime index 4c0a0e58..73306544 100644 --- a/lib/philomena_web/templates/tag/tag_change/index.html.slime +++ b/lib/philomena_web/templates/tag/tag_change/index.html.slime @@ -4,7 +4,8 @@ h1 = @tag.name - route = fn p -> Routes.tag_tag_change_path(@conn, :index, @tag, p) end -- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: [added: @conn.params["added"]] +- params = if @conn.params["added"] do [added: @conn.params["added"]] else nil end +- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @tag_changes, route: route, conn: @conn, params: params .block .block__header