frenzy/lib/frenzy_web/live/edit_pipeline_live.html.heex

36 lines
1.4 KiB
Plaintext
Raw Normal View History

<h1>Edit <%= @pipeline.name %></h1>
2022-09-14 02:10:57 +00:00
<a href={Routes.pipeline_path(FrenzyWeb.Endpoint, :edit, @pipeline.id, json: "")} class="btn btn-primary">Edit as JSON</a>
2020-07-18 14:44:14 +00:00
<%= for {stage, index} <- Enum.with_index(@pipeline.stages) do %>
<div class="card mt-4">
<div class="card-header container-fluid">
<div class="row">
<div class="col">
<h4 class="m-0"><%= stage["module_name"] %></h4>
</div>
2022-09-14 02:25:11 +00:00
<div class="col text-end">
2020-07-18 16:23:50 +00:00
<%= content_tag :button, "Move Up", [phx_click: :move_up, phx_value_index: index, disabled: index == 0, class: "btn btn-secondary btn-sm"] %>
2020-06-09 03:27:40 +00:00
2020-07-18 16:23:50 +00:00
<%= content_tag :button, "Move Down", [phx_click: :move_down, phx_value_index: index, disabled: index == length(@pipeline.stages) - 1, class: "btn btn-secondary btn-sm"] %>
2020-06-09 03:27:40 +00:00
2022-09-14 02:10:57 +00:00
<button phx-click="delete_stage" phx-value-index={index} class="btn btn-danger btn-sm">Delete</button>
</div>
</div>
</div>
<div class="card-body">
2023-06-25 20:45:59 +00:00
<%= component_for(stage, index) %>
</div>
</div>
<% end %>
2022-09-14 02:10:57 +00:00
<%= form_for :stage, "#", [class: "mt-4 mb-4", phx_submit: :add_stage], fn f -> %>
2022-09-14 02:25:11 +00:00
<div class="row mb-2">
<label class="col-sm-2 col-form-label" for="module_name">Module</label>
<div class="col-sm-10">
2022-09-14 02:25:11 +00:00
<%= select f, :module_name, @stages, class: "form-select" %>
</div>
</div>
<%= submit "Add Stage", class: "btn btn-primary" %>
2022-09-14 02:10:57 +00:00
<% end %>