add redirect stub to gallery show page

This commit is contained in:
byte[] 2019-11-18 09:25:56 -05:00
parent 38447e7e9c
commit bdec219d23
2 changed files with 6 additions and 3 deletions

View file

@ -4,7 +4,7 @@ defmodule PhilomenaWeb.GalleryController do
alias Philomena.Galleries.Gallery alias Philomena.Galleries.Gallery
import Ecto.Query import Ecto.Query
plug :load_resource, model: Gallery, only: [:show], preload: [:creator, thumbnail: :tags] plug :load_resource, model: Gallery, only: [:show]
def index(conn, params) do def index(conn, params) do
galleries = galleries =
@ -24,7 +24,10 @@ defmodule PhilomenaWeb.GalleryController do
render(conn, "index.html", galleries: galleries, layout_class: "layout--wide") render(conn, "index.html", galleries: galleries, layout_class: "layout--wide")
end end
def show(_conn, _params) do def show(conn, _params) do
# stub
conn
|> redirect(to: Routes.search_path(conn, :index, q: "gallery_id:#{conn.assigns.gallery_id}"))
end end
defp parse_search(%{"gallery" => gallery_params}) do defp parse_search(%{"gallery" => gallery_params}) do

View file

@ -12,7 +12,7 @@ header.header
i.fa.fa-upload i.fa.fa-upload
form.header__search.flex.flex--no-wrap.flex--centered action="/search" method="get" form.header__search.flex.flex--no-wrap.flex--centered action="/search" method="get"
input.input.header__input.header__input--search#q name="q" title="For terms all required, separate with ',' or 'AND'; also supports 'OR' for optional terms and '-' or 'NOT' for negation. Search with a blank query for more options or click the ? for syntax help." value=assigns[:search_query] placeholder="Search" autocapitalize="none" input.input.header__input.header__input--search#q name="q" title="For terms all required, separate with ',' or 'AND'; also supports 'OR' for optional terms and '-' or 'NOT' for negation. Search with a blank query for more options or click the ? for syntax help." value=(assigns[:search_query] || @conn.params["q"]) placeholder="Search" autocapitalize="none"
button.header__search__button type="submit" title='Search' button.header__search__button type="submit" title='Search'
i.fa-embedded--search i.fa-embedded--search