CJ_Clippy aa75c224fc
Some checks failed
ci / build (push) Failing after 23m29s
ci / Tests & Checks (push) Failing after 3m32s
move services/bright to apps/bright
2025-02-10 08:16:50 -08:00

30 lines
707 B
Elixir

defmodule BrightWeb.VodHTML do
use BrightWeb, :html
alias BrightWeb.TorrentHTML
embed_templates "vod_html/*"
@doc """
Renders a vod form.
"""
attr :changeset, Ecto.Changeset, required: true
attr :action, :string, required: true
def vod_form(assigns)
def stream_opts(changeset) do
existing_ids =
changeset
|> Ecto.Changeset.get_change(:stream, [])
|> Enum.map(& &1.data.id)
for stream <- Bright.Streams.list_streams(),
do: [
key:
"#{stream.id} | #{stream.date} | #{stream.vtubers |> Enum.map(& &1.display_name) |> Enum.join(", ")}",
value: stream.id,
selected: stream.id in existing_ids
]
end
end