27 lines
1.5 KiB
Plaintext
27 lines
1.5 KiB
Plaintext
<%= turbo_frame_tag @collection, :workflows do %>
|
|
<header>
|
|
<h2 class="divider txt-large">Workflows</h2>
|
|
<div>Use a Workflow to track progress in this Collection</div>
|
|
</header>
|
|
|
|
<div class="flex flex-wrap gap justify-center">
|
|
<% Workflow.all.each do |workflow| %>
|
|
<div class="workflow-preview txt-align-start border-radius <%= 'workflow-preview--selected' if workflow == collection.workflow %>">
|
|
<%= button_to collection_workflow_path(collection), method: :patch, aria: { label: workflow == collection.workflow ? "Stop using this workflow" : "Use this workflow" } do %>
|
|
<%= hidden_field_tag "collection[workflow_id]", workflow == collection.workflow ? "" : workflow.id %>
|
|
<strong class="txt-small overflow-ellipsis flex-item-no-shrink"><%= workflow.name %></strong>
|
|
<ul class="list-style-none txt-xx-small margin-none flex flex-column gap-half">
|
|
<% workflow.stages.each do |stage| %>
|
|
<li class="overflow-ellipsis flex align-center gap-half min-width">
|
|
<span class="workflow-preview__swatch btn btn--circle" style="--btn-background: <%= stage.color.present? ? stage.color : Card::Colored::DEFAULT_COLOR %>;"></span>
|
|
<span class="overflow-ellipsis"><%= stage.name %></span>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<%= link_to "Manage workflows", workflows_path, class: "btn btn--plain txt-link", data: { turbo_frame: "_top" } %>
|
|
<% end %>
|