From b35bac062abca70ae37fb83b2da912dd3e8e1c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 7 Apr 2025 16:07:21 +0200 Subject: [PATCH] feat: somewhat useable ui --- lib/putzplan_web/live/task_live/index.ex | 70 +++++++++++++++++++----- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/lib/putzplan_web/live/task_live/index.ex b/lib/putzplan_web/live/task_live/index.ex index 579cb42..6ea1d09 100644 --- a/lib/putzplan_web/live/task_live/index.ex +++ b/lib/putzplan_web/live/task_live/index.ex @@ -18,6 +18,21 @@ defmodule PutzplanWeb.TaskLive.Index do rows={@streams.tasks} row_click={fn {_id, task} -> JS.navigate(~p"/tasks/#{task}") end} > + <:col :let={{id, task}}> + <.link phx-click={JS.push("complete", value: %{id: task.id})}> + + + + + + <:col :let={{_id, task}} label="Description">{task.description} <:col :let={{_id, task}} label="Due">{format_date(task.due)} @@ -27,20 +42,47 @@ defmodule PutzplanWeb.TaskLive.Index do <.link navigate={~p"/tasks/#{task}"}>Show - <:action :let={{_id, task}}> - <.link patch={~p"/tasks/#{task}/edit"}>Edit - - <:action :let={{_id, task}}> - <.link phx-click={JS.push("complete", value: %{id: task.id})}>Complete - - <:action :let={{id, task}}> - <.link - phx-click={JS.push("delete", value: %{id: task.id}) |> hide("##{id}")} - data-confirm="Are you sure?" - > - Delete - - + + <:col :let={{id, task}}> + <.link patch={~p"/tasks/#{task}/edit"}> + + + + + + + <:col :let={{id, task}}> + <.link + phx-click={JS.push("delete", value: %{id: task.id}) |> hide("##{id}")} + data-confirm="Are you sure?" + > + + + + + <.modal :if={@live_action in [:new, :edit]} id="task-modal" show on_cancel={JS.patch(~p"/tasks")}>