From 5cdc6472088d3cd7459f1fcff6ff1c6e14015fd0 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 7 Dec 2019 11:32:04 -0500 Subject: [PATCH] add 'search posts' button to topic header --- lib/philomena/posts/query.ex | 4 ++-- lib/philomena_web/controllers/post_controller.ex | 1 - lib/philomena_web/templates/topic/show.html.slime | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/philomena/posts/query.ex b/lib/philomena/posts/query.ex index 3672f213..ef9c5c99 100644 --- a/lib/philomena/posts/query.ex +++ b/lib/philomena/posts/query.ex @@ -43,9 +43,9 @@ defmodule Philomena.Posts.Query do int_fields = ~W(id) date_fields = ~W(created_at updated_at) - literal_fields = ~W(image_id) + literal_fields = ~W(forum_id topic_id) ngram_fields = ~W(body subject) - custom_fields = ~W(author user_id forum_id topic_id) + custom_fields = ~W(author user_id) default_field = "body" transforms = %{ "user_id" => &Philomena.Posts.Query.user_id_transform/2, diff --git a/lib/philomena_web/controllers/post_controller.ex b/lib/philomena_web/controllers/post_controller.ex index fccd2c6e..f5082e30 100644 --- a/lib/philomena_web/controllers/post_controller.ex +++ b/lib/philomena_web/controllers/post_controller.ex @@ -22,7 +22,6 @@ defmodule PhilomenaWeb.PostController do %{term: %{access_level: "normal"}}, ], must_not: [ - %{terms: %{image_tag_ids: conn.assigns.current_filter.hidden_tag_ids}}, %{term: %{hidden_from_users: true}} ] } diff --git a/lib/philomena_web/templates/topic/show.html.slime b/lib/philomena_web/templates/topic/show.html.slime index 48fc274e..e912bcd6 100644 --- a/lib/philomena_web/templates/topic/show.html.slime +++ b/lib/philomena_web/templates/topic/show.html.slime @@ -11,9 +11,9 @@ h1 = @topic.title => link(@forum.name, to: Routes.forum_path(@conn, :show, @forum)) ' » => link(@topic.title, to: Routes.forum_topic_path(@conn, :show, @forum, @topic)) - /a href=posts_path(forum_id: @forum.id, subject: @topic.title) - / i.fa.fa-fw.fa-search> - / | Search Posts + a href=Routes.post_path(@conn, :index, pq: "topic_id:#{@topic.id}") + i.fa.fa-fw.fa-search> + ' Search Posts .flex.flex--wrap.block__header.block__header--light .flex--fixed = pagination