update liveview

This commit is contained in:
2022-11-16 21:11:02 -05:00
parent 2ce94fd6d1
commit 1f438d0fe5
32 changed files with 362 additions and 273 deletions

View File

@ -33,7 +33,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
{:noreply,
socket
|> put_flash(:info, "Pipeline updated successfully")
|> push_redirect(to: socket.assigns.return_to)}
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
@ -46,7 +46,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
{:noreply,
socket
|> put_flash(:info, "Pipeline created successfully")
|> push_redirect(to: socket.assigns.return_to)}
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, changeset: changeset)}

View File

@ -2,7 +2,7 @@
<h2><%= @title %></h2>
<.form
let={f}
:let={f}
for={@changeset}
id="pipeline-form"
phx-target={@myself}

View File

@ -32,18 +32,24 @@
<td>
<span>
<%= live_redirect("Show", to: Routes.pipeline_show_path(@socket, :show, pipeline)) %>
<.link navigate={Routes.pipeline_show_path(@socket, :show, pipeline)}>
<%= dgettext("actions", "Show") %>
</.link>
</span>
<span>
<%= live_patch("Edit", to: Routes.pipeline_index_path(@socket, :edit, pipeline)) %>
<.link patch={Routes.pipeline_index_path(@socket, :edit, pipeline)}>
<%= dgettext("actions", "Edit") %>
</.link>
</span>
<span>
<%= link("Delete",
to: "#",
phx_click: "delete",
phx_value_id: pipeline.id,
data: [confirm: "Are you sure?"]
) %>
<.link
href="#"
phx-click="delete"
phx-value-id={pipeline.id}
data-confirm={dgettext("prompts", "Are you sure?")}
>
<%= dgettext("actions", "Delete") %>
</.link>
</span>
</td>
</tr>
@ -51,4 +57,8 @@
</tbody>
</table>
<span><%= live_patch("New Pipeline", to: Routes.pipeline_index_path(@socket, :new)) %></span>
<span>
<.link patch={Routes.pipeline_index_path(@socket, :new)}>
<%= dgettext("actions", "New Pipeline") %>
</.link>
</span>

View File

@ -31,6 +31,13 @@
</ul>
<span>
<%= live_patch("Edit", to: Routes.pipeline_show_path(@socket, :edit, @pipeline), class: "button") %>
<.link patch={Routes.pipeline_show_path(@socket, :edit, @pipeline)} class="button">
<%= dgettext("actions", "Edit") %>
</.link>
</span>
|
<span>
<.link patch={Routes.pipeline_index_path(@socket, :index)}>
<%= dgettext("actions", "Back") %>
</.link>
</span>
| <span><%= live_redirect("Back", to: Routes.pipeline_index_path(@socket, :index)) %></span>