2023-03-05 17:23:16 +01:00
|
|
|
defmodule ChiyaWeb.NoteHTML do
|
|
|
|
use ChiyaWeb, :html
|
|
|
|
|
2023-06-20 20:28:45 +02:00
|
|
|
embed_templates("note_html/*")
|
2023-03-05 17:23:16 +01:00
|
|
|
|
|
|
|
@doc """
|
|
|
|
Renders a note form.
|
|
|
|
"""
|
2023-06-20 20:28:45 +02:00
|
|
|
attr(:changeset, Ecto.Changeset, required: true)
|
|
|
|
attr(:action, :string, required: true)
|
|
|
|
attr(:channels, :list, required: true)
|
|
|
|
attr(:tags, :list, required: true)
|
2023-06-23 06:38:31 +02:00
|
|
|
attr(:selected_channels, :list, required: true)
|
2023-03-05 17:23:16 +01:00
|
|
|
|
|
|
|
def note_form(assigns)
|
2023-03-05 23:25:49 +01:00
|
|
|
|
2023-04-10 19:22:28 +02:00
|
|
|
def tags_to_string(tags), do: Enum.map_join(tags, ", ", fn t -> t.name end)
|
2023-03-05 17:23:16 +01:00
|
|
|
end
|