mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
*D (only deleted, no merges) search opt
This commit is contained in:
parent
ae476b45d8
commit
45e3d2801d
5 changed files with 13 additions and 2 deletions
|
@ -24,6 +24,7 @@ defmodule Philomena.Images.Elasticsearch do
|
|||
downvoter_ids: %{type: "keyword"},
|
||||
downvoters: %{type: "keyword"},
|
||||
downvotes: %{type: "integer"},
|
||||
duplicate_id: %{type: "integer"},
|
||||
faves: %{type: "integer"},
|
||||
favourited_by_user_ids: %{type: "keyword"},
|
||||
favourited_by_users: %{type: "keyword"},
|
||||
|
@ -118,6 +119,7 @@ defmodule Philomena.Images.Elasticsearch do
|
|||
upvoter_ids: image.upvoters |> Enum.map(& &1.id),
|
||||
downvoter_ids: image.downvoters |> Enum.map(& &1.id),
|
||||
deleted_by_user_id: image.deleter_id,
|
||||
duplicate_id: image.duplicate_id,
|
||||
galleries:
|
||||
image.gallery_interactions |> Enum.map(&%{id: &1.gallery_id, position: &1.position}),
|
||||
namespaced_tags: %{
|
||||
|
|
|
@ -73,6 +73,9 @@ defmodule PhilomenaWeb.ImageLoader do
|
|||
defp maybe_show_deleted(filters, true, "only"),
|
||||
do: [%{term: %{hidden_from_users: false}} | filters]
|
||||
|
||||
defp maybe_show_deleted(filters, true, "deleted"),
|
||||
do: [%{term: %{hidden_from_users: false}}, %{exists: %{field: :duplicate_id}} | filters]
|
||||
|
||||
defp maybe_show_deleted(filters, true, _param),
|
||||
do: [%{term: %{hidden_from_users: true}} | filters]
|
||||
|
||||
|
|
|
@ -23,3 +23,9 @@
|
|||
i.fa.fa-minus
|
||||
i.fa.fa-exclamation>
|
||||
span.hide-mobile.hide-limited-desktop Hide Deleted
|
||||
|
||||
= if del != "deleted" do
|
||||
a href=@route.(Keyword.put(@params, :del, "deleted")) title="Only Deleted (Strict)"
|
||||
i.fa.fa-minus
|
||||
i.fa.fa-object-group>
|
||||
span.hide-mobile.hide-limited-desktop Exclude Merges
|
||||
|
|
|
@ -20,7 +20,7 @@ header.header
|
|||
input type="hidden" name="sd" value=@conn.params["sd"]
|
||||
|
||||
= if hides_images?(@conn) do
|
||||
= select f, :del, [{"-D", ""}, {"+D", 1}, {"DO", "only"}], name: "del", class: "input header__input", autocomplete: "off"
|
||||
= select f, :del, [{"-D", ""}, {"+D", 1}, {"*D", "deleted"}, {"DO", "only"}], name: "del", class: "input header__input", autocomplete: "off"
|
||||
|
||||
button.header__search__button type="submit" title="Search"
|
||||
i.fa-embedded--search
|
||||
|
|
Loading…
Reference in a new issue