2023-03-05 17:23:16 +01:00
|
|
|
defmodule ChiyaWeb.NoteHTML do
|
|
|
|
use ChiyaWeb, :html
|
|
|
|
|
|
|
|
embed_templates "note_html/*"
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Renders a note form.
|
|
|
|
"""
|
|
|
|
attr :changeset, Ecto.Changeset, required: true
|
|
|
|
attr :action, :string, required: true
|
2023-03-05 23:25:49 +01:00
|
|
|
attr :channels, :list, required: true
|
2023-03-05 17:23:16 +01:00
|
|
|
|
|
|
|
def note_form(assigns)
|
2023-03-05 23:25:49 +01:00
|
|
|
|
|
|
|
def selected_channels(changeset), do: Enum.map(changeset.data.channels, fn c -> c.id end)
|
2023-03-05 17:23:16 +01:00
|
|
|
end
|