unscrew quick tags (fixes philomena-dev/philomena#51)

This commit is contained in:
Luna D 2020-10-20 23:18:53 +02:00
parent d96b45f32e
commit 49547108a3
No known key found for this signature in database
GPG key ID: 81AF416F2CC36FC8
4 changed files with 292 additions and 705 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
= for slice <- Enum.chunk_every(@data, 10) do = for slice <- Enum.chunk_every(@data, 10) do
div div
= for map <- slice do = for map <- slice do
- [{header, tag_name}] = Enum.to_list(map) - [header, tag_name] = Enum.to_list(map)
= header = header
' . ' .

View file

@ -1,9 +1,9 @@
= for {heading, maps} <- @data do = for [heading, maps] <- @data do
div div
strong = heading strong = heading
br br
= for {name, alias_name} <- maps do = for [name, alias_name] <- maps do
=> name => name
' - ' -
= tag_link @tags[alias_name], alias_name = tag_link @tags[alias_name], alias_name

View file

@ -115,14 +115,15 @@ defmodule PhilomenaWeb.TagView do
end end
defp names_in_tab("season", data) do defp names_in_tab("season", data) do
data Enum.map(data, fn [_number, name] -> name end)
|> Enum.flat_map(&Map.values/1)
end end
defp names_in_tab("shorthand", data) do defp names_in_tab("shorthand", data) do
data data
|> Map.values() |> Enum.map(fn [_title, tags] -> tags end)
|> Enum.flat_map(&Map.values/1) |> IO.inspect(label: "after map")
|> Enum.flat_map(&Enum.map(&1, fn [_shorthand, tag] -> tag end))
|> IO.inspect(label: "after flatmap")
end end
defp names_in_tab(_mode, _data), do: [] defp names_in_tab(_mode, _data), do: []