memEx/lib/memex_web/live/pipeline_live/show.html.heex

57 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-11-24 14:31:16 -05:00
<div class="mx-auto flex flex-col justify-center items-stretch space-y-4 max-w-3xl">
<h1 class="text-xl">
<%= @pipeline.title %>
</h1>
<p><%= if @pipeline.tags, do: @pipeline.tags |> Enum.join(", ") %></p>
<textarea
id="show-pipeline-description"
class="input input-primary h-128 min-h-128"
phx-hook="MaintainAttrs"
phx-update="ignore"
readonly
phx-no-format
><%= @pipeline.description %></textarea>
<p class="self-end">
<%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %>
</p>
<div class="self-end flex space-x-4">
<.link class="btn btn-primary" navigate={Routes.pipeline_index_path(@socket, :index)}>
2022-11-24 14:31:16 -05:00
<%= dgettext("actions", "back") %>
</.link>
<%= if is_owner?(@pipeline, @current_user) do %>
2022-11-24 14:31:16 -05:00
<.link class="btn btn-primary" patch={Routes.pipeline_show_path(@socket, :edit, @pipeline)}>
<%= dgettext("actions", "edit") %>
</.link>
<% end %>
<%= if is_owner_or_admin?(@pipeline, @current_user) do %>
2022-11-24 14:31:16 -05:00
<button
type="button"
class="btn btn-primary"
phx-click="delete"
data-confirm={dgettext("prompts", "are you sure?")}
data-qa={"delete-pipeline-#{@pipeline.id}"}
>
<%= dgettext("actions", "delete") %>
</button>
<% end %>
</div>
</div>
2022-07-25 20:12:11 -04:00
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline)}>
<.live_component
module={MemexWeb.PipelineLive.FormComponent}
id={@pipeline.id}
2022-11-24 14:31:16 -05:00
current_user={@current_user}
2022-07-25 20:12:11 -04:00
title={@page_title}
action={@live_action}
pipeline={@pipeline}
return_to={Routes.pipeline_show_path(@socket, :show, @pipeline)}
/>
</.modal>
<% end %>