mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
39 lines
No EOL
1.4 KiB
Text
39 lines
No EOL
1.4 KiB
Text
elixir:
|
|
route = fn p -> Routes.comment_path(@conn, :index, p) end
|
|
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route
|
|
|
|
.column-layout
|
|
.column-layout__left
|
|
.block
|
|
.block__content
|
|
h3 Search Comments
|
|
|
|
= form_for @conn, Routes.comment_path(@conn, :index), [as: :comment, method: "get", class: "hform"], fn f ->
|
|
.field = label f, :author, "Author"
|
|
.field = text_input f, :author, class: "input hform__text", placeholder: "Author (* is wildcard)"
|
|
|
|
.field = label f, :image_id, "Image ID"
|
|
.field = number_input f, :image_id, class: "input hform__text", placeholder: "Image ID"
|
|
|
|
.field = label f, :body, "Body"
|
|
.field = textarea f, :body, class: "input input--wide", placeholder: "Body"
|
|
|
|
.field = label f, :sf, "Sort by"
|
|
.field
|
|
=> select f, :sf, ["Creation Date": "posted_at", "Relevance": "_score"], class: "input"
|
|
=> select f, :sd, ["Descending": "desc", "Ascending": "asc"], class: "input"
|
|
|
|
.field
|
|
= submit "Search", class: "button button--state-primary"
|
|
|
|
.column-layout__main
|
|
.block
|
|
.block__header
|
|
= pagination
|
|
|
|
= for {comment, body} <- @comments do
|
|
= render PhilomenaWeb.CommentView, "_comment_with_image.html", image: comment.image, comment: comment, body: body, conn: @conn
|
|
|
|
.block
|
|
.block__header.block__header--light
|
|
= pagination |