diff --git a/app/assets/stylesheets/workflows.css b/app/assets/stylesheets/workflows.css index 21e36b9c6..a2b852b43 100644 --- a/app/assets/stylesheets/workflows.css +++ b/app/assets/stylesheets/workflows.css @@ -28,4 +28,40 @@ } } } + + .workflow-preview { + --border-size: 3px; + + flex: 1 1 30%; + max-inline-size: 33%; + padding: 0.5em 1em; + + button { + --hover-size: 0; + + appearance: none; + background: transparent; + border: none; + cursor: pointer; + inline-size: auto; + margin: 0; + max-inline-size: 100%; + outline: 0; + padding: 0; + text-align: left; + } + } + + .workflow-preview--selected { + --border-color: var(--color-link); + } + + .workflow-preview__swatch { + --btn-size: 1em; + --btn-border-radius: 50%; + --btn-border-size: 0; + --hover-size: 0; + + cursor: auto; + } } diff --git a/app/views/collections/edit.html.erb b/app/views/collections/edit.html.erb index 2cd90e5c3..bfaf7c6fd 100644 --- a/app/views/collections/edit.html.erb +++ b/app/views/collections/edit.html.erb @@ -78,19 +78,34 @@
- Workflows - <%= form_with model: @collection, url: collection_workflow_path(@collection), local: true, method: :patch, data: { controller: "form" } do |form| %> - <%= form.label :workflow_id, "Use a Workflow to track progress in this Collection.", class: "flex justify-center margin-block-end" %> - <%= form.select :workflow_id, Workflow.all.map { |w| [w.name, w.id] }, { include_blank: "Choose…" }, class: "input input--select full-width", data: { action: "change->form#submit" } %> - <% end %> -

<%= link_to "Manage workflows", workflows_path, class: "btn btn--plain txt-link" %>

- - - Auto-Close Cards <%= select_tag :closure, options_for_select(Card::Closeable::AUTO_CLOSE_OPTIONS, Card::Closeable::AUTO_CLOSE_AFTER), { class: "input input--select full-width margin-block-end", data: { action: "change->form#submit" } } %> + + + Workflows +
Use a Workflow to track progress in this Collection.
+
+ <% Workflow.all.each do |workflow| %> +
+ <%= button_to collection_workflow_path(@collection), method: :patch do %> + <%= hidden_field_tag "collection[workflow_id]", workflow.id %> + <%= workflow.name %> +
    + <% workflow.stages.each do |stage| %> +
  • + + <%= stage.name %> +
  • + <% end %> +
+ <% end %> +
+ <% end %> +
+

<%= link_to "Manage workflows", workflows_path, class: "btn btn--plain txt-link" %>

+ <%= form_with model: @collection, class: "txt-align-center", method: :delete do |form| %>