mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
readd ignored tag list
This commit is contained in:
parent
eabd51cb2d
commit
ad849e8bb8
3 changed files with 9 additions and 6 deletions
|
@ -59,10 +59,8 @@ defmodule PhilomenaWeb.TagController do
|
|||
render(
|
||||
conn,
|
||||
"show.html",
|
||||
tag: tag,
|
||||
body: body,
|
||||
tags: [{tag, body, dnp_entries}],
|
||||
search_query: search_query,
|
||||
dnp_entries: dnp_entries,
|
||||
interactions: interactions,
|
||||
images: images,
|
||||
layout_class: "layout--wide",
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: [{@tag, @body, @dnp_entries}], images: @images, header: "Images tagged #{@tag.name}", scope: [q: @search_query], route: fn p -> Routes.tag_path(@conn, :show, @tag, p) end
|
||||
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Images tagged #{@tag.name}", scope: [q: @search_query], route: fn p -> Routes.tag_path(@conn, :show, @tag, p) end
|
||||
|
||||
= render PhilomenaWeb.SearchView, "_form.html", conn: @conn
|
||||
= render PhilomenaWeb.SearchView, "_form.html", conn: @conn
|
||||
|
|
|
@ -22,6 +22,11 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
host |> to_string
|
||||
end
|
||||
|
||||
defp ignored_tag_list(nil), do: []
|
||||
defp ignored_tag_list([]), do: []
|
||||
defp ignored_tag_list([{tag, _body, _dnp_entries}]), do: [tag.id]
|
||||
defp ignored_tag_list(tags), do: Enum.map(tags, & &1.id)
|
||||
|
||||
def clientside_data(conn) do
|
||||
extra = Map.get(conn.assigns, :clientside_data, [])
|
||||
interactions = Map.get(conn.assigns, :interactions, [])
|
||||
|
@ -44,7 +49,7 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
fancy_tag_edit: if(user, do: user.fancy_tag_field_on_edit, else: true),
|
||||
fancy_tag_upload: if(user, do: user.fancy_tag_field_on_upload, else: true),
|
||||
interactions: Jason.encode!(interactions),
|
||||
ignored_tag_list: "[]"
|
||||
ignored_tag_list: Jason.encode!(ignored_tag_list(conn.assigns[:tags]))
|
||||
]
|
||||
|
||||
data = Keyword.merge(data, extra)
|
||||
|
|
Loading…
Reference in a new issue