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,9 +1,9 @@
= for slice <- Enum.chunk_every(@data, 10) do
div
= for map <- slice do
- [{header, tag_name}] = Enum.to_list(map)
- [header, tag_name] = Enum.to_list(map)
= header
' .
= tag_link @tags[tag_name], tag_name
br
br

View file

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

View file

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