neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
inky previews for the calendar and cronos, scribus form not entirely shit.
d0010b2 · gmorell · 2025-04-10 02:03
Files changed
modified
apps/room_sanctum/lib/room_sanctum/configuration/scribus.ex
+1
−1
@@ -24,6 +24,6 @@ defmodule RoomSanctum.Configuration.Scribus do
| 24 | 24 | def changeset(scribus, attrs) do |
| 25 | 25 | scribus |
| 26 | 26 | |> cast(attrs, [:name, :resolution, :configuration, :enabled, :ankyra, :color, :wait, :buffer, :theme, :vision]) |
| 27 | − |> validate_required([:name, :resolution, :vision, :enabled, :ankyra, :color, :wait, :buffer, :theme]) | |
| 27 | + |> validate_required([:name, :resolution, :vision, :enabled, :color, :wait, :buffer, :theme]) | |
| 28 | 28 | end |
| 29 | 29 | end |
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_query_live/show.ex
+1
−1
@@ -68,7 +68,7 @@ defmodule RoomSanctumWeb.QueryLive.Show do
| 68 | 68 | :cronos -> |
| 69 | 69 | RoomCronos.Worker.query_cronos( |
| 70 | 70 | # we want the query's name here |
| 71 | − socket.assigns.query.source.id, | |
| 71 | + socket.assigns.query.id, | |
| 72 | 72 | socket.assigns.query.query |
| 73 | 73 | ) |
| 74 | 74 |
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_scribus_live/form_component.ex
+38
−1
@@ -20,7 +20,7 @@ defmodule RoomSanctumWeb.ScribusLive.FormComponent do
| 20 | 20 | phx-submit="save" |
| 21 | 21 | > |
| 22 | 22 | <.input field={@form[:name]} type="text" label="Name" /> |
| 23 | − <.input field={@form[:resolution]} type="select" label="Resolution" options={["540x960"]} /> | |
| 23 | + <.input field={@form[:resolution]} type="select" label="Resolution" options={["180x180", "450x600", "540x960", "800x1280", "1404x1872"]} /> | |
| 24 | 24 | <.input |
| 25 | 25 | field={@form[:configuration]} |
| 26 | 26 | type="select" |
@@ -28,6 +28,43 @@ defmodule RoomSanctumWeb.ScribusLive.FormComponent do
| 28 | 28 | label="Configuration" |
| 29 | 29 | options={[]} |
| 30 | 30 | /> |
| 31 | + <div class="form-control"> | |
| 32 | + <.input field={@form[:vision]} type="select" label="Vision" options={[]}/> | |
| 33 | + </div> | |
| 34 | + <div class="form-control m-10"> | |
| 35 | + <.input field={@form[:enabled]} type="checkbox" label="Enabled" /> | |
| 36 | + </div> | |
| 37 | + <div class="form-control m-10"> | |
| 38 | + <.input field={@form[:show_name]} type="checkbox" label="Show Name" /> | |
| 39 | + </div> | |
| 40 | + <div class="form-control m-10"> | |
| 41 | + <.input field={@form[:show_time]} type="checkbox" label="Show Time" /> | |
| 42 | + </div> | |
| 43 | + <div> | |
| 44 | + <.input | |
| 45 | + field={@form[:color]} | |
| 46 | + type="select" | |
| 47 | + multiple | |
| 48 | + label="Configuration" | |
| 49 | + options={[:untouched, :gray16]} | |
| 50 | + /> | |
| 51 | + </div> | |
| 52 | + <div> | |
| 53 | + <.input field={@form[:wait]} type="number" label="Wait" /> | |
| 54 | + </div> | |
| 55 | + <div> | |
| 56 | + <.input field={@form[:buffer]} type="number" label="Buffer" /> | |
| 57 | + </div> | |
| 58 | + | |
| 59 | + <div> | |
| 60 | + <.input | |
| 61 | + field={@form[:theme]} | |
| 62 | + type="select" | |
| 63 | + multiple | |
| 64 | + label="Configuration" | |
| 65 | + options={[:inky, :color, :her, :afterdark]} | |
| 66 | + /> | |
| 67 | + </div> | |
| 31 | 68 | <:actions> |
| 32 | 69 | <.button phx-disable-with="Saving...">Save Scribus</.button> |
| 33 | 70 | </:actions> |
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_scribus_live/public.html.heex
+2
−2
@@ -24,8 +24,8 @@
| 24 | 24 | <% {_, :weather} -> %> <.i_weather entries={condense(k, p) |> preview(k)}> </.i_weather> |
| 25 | 25 | <% {_, :aqi} -> %> <.i_aqi entries={condense(k, p) |> preview(k)}> </.i_aqi> |
| 26 | 26 | <% {_, :ephem} -> %> <.i_ephem entries={condense(k, p) |> preview(k)}> </.i_ephem> |
| 27 | − <% {_, :calendar} -> %> <.p_calendar entries={condense(k, p) |> preview(k)}> </.p_calendar> | |
| 28 | − <% {_, :cronos} -> %> <.p_cronos entries={condense(k, p) |> preview(k)}> </.p_cronos> | |
| 27 | + <% {_, :calendar} -> %> <.i_calendar entries={condense(k, p) |> preview(k)}> </.i_calendar> | |
| 28 | + <% {_, :cronos} -> %> <.i_cronos entries={condense(k, p) |> preview(k)}> </.i_cronos> | |
| 29 | 29 | <% {_, :gitlab} -> %> <.p_gitlab entries={condense(k, p) |> preview(k)}> </.p_gitlab> |
| 30 | 30 | <% {_, :packages} -> %> <.p_packages entries={condense(k, p) |> preview(k)}> </.p_packages> |
| 31 | 31 | <% {_, :const} -> %> <.p_const entries={condense(k, p) |> preview(k)}> </.p_const> |
modified
apps/room_sanctum/lib/room_sanctum_web/live/live_preview.ex
+49
−0
@@ -388,6 +388,28 @@ use PhoenixHTMLHelpers
| 388 | 388 | """ |
| 389 | 389 | end |
| 390 | 390 | |
| 391 | + def i_calendar(assigns) do | |
| 392 | + ~H""" | |
| 393 | + <%= for e <- @entries.data do %> | |
| 394 | + <div class="flex items-center"> | |
| 395 | + <div class="w-1/4 lg:w-1/12"> | |
| 396 | + <i class={"fa-solid fa-3x fa-fw fa-calendar"}></i> | |
| 397 | + </div> | |
| 398 | + <div class="w-3/4 lg:w-11/12 mr-4"> | |
| 399 | + <div class="flex flex-col lg:flex-row justify-between"> | |
| 400 | + <div class="flex items-center justify-between lg:text-4xl lg:font-bold lg:gap-2"> | |
| 401 | + <div class="text-lg text-accent lg:text-4xl"><%= e.description %></div> | |
| 402 | + </div> | |
| 403 | + <div class="flex items-center justify-between lg:text-4xl lg:gap-8"> | |
| 404 | + <p><i class="fa-solid fa-fw fa-calendar"></i><span class="text-accent"><%= e.date_start %></span></p> | |
| 405 | + </div> | |
| 406 | + </div> | |
| 407 | + </div> | |
| 408 | + </div> | |
| 409 | + <% end %> | |
| 410 | + """ | |
| 411 | + end | |
| 412 | + | |
| 391 | 413 | def p_cronos(assigns) do |
| 392 | 414 | ~H""" |
| 393 | 415 | <%= for e <- @entries.data do %> |
@@ -407,6 +429,33 @@ use PhoenixHTMLHelpers
| 407 | 429 | """ |
| 408 | 430 | end |
| 409 | 431 | |
| 432 | + def i_cronos(assigns) do | |
| 433 | + ~H""" | |
| 434 | + <%= for e <- @entries.data do %> | |
| 435 | + <div class="flex items-center"> | |
| 436 | + <div class="w-1/4 lg:w-1/12"> | |
| 437 | + <i class={"fa-solid fa-3x fa-fw fa-clock"}></i> | |
| 438 | + </div> | |
| 439 | + <div class="w-3/4 lg:w-11/12 mr-4"> | |
| 440 | + <div class="flex flex-col lg:flex-row justify-between"> | |
| 441 | + <div class="flex items-center justify-between lg:text-4xl lg:font-bold lg:gap-2"> | |
| 442 | + <div class="text-lg text-accent lg:text-4xl"><%= e.name %></div> | |
| 443 | + </div> | |
| 444 | + <div class="flex items-center justify-between lg:text-4xl lg:gap-8"> | |
| 445 | + <p> | |
| 446 | + <%= case e.value do %> | |
| 447 | + <% true -> %> <i class="fa-solid fa-fw fa-check fa-2x"> </i> | |
| 448 | + <% false -> %> <i class="fa-solid fa-fw fa-remove fa-2x"> </i> | |
| 449 | + <% end %> | |
| 450 | + </p> | |
| 451 | + </div> | |
| 452 | + </div> | |
| 453 | + </div> | |
| 454 | + </div> | |
| 455 | + <% end %> | |
| 456 | + """ | |
| 457 | + end | |
| 458 | + | |
| 410 | 459 | def p_gitlab(assigns) do |
| 411 | 460 | ~H""" |
| 412 | 461 | <%= for e <- @entries.data do %> |
Parents: 8917b58