* . * updates * update specs * expand profile field before deleting * expand auth section in rspec test * expand smtp settings summary in rspec * update user experience section specs * more spec tweaks Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
46 lines
2.5 KiB
Text
46 lines
2.5 KiB
Text
<% @grouped_profile_fields.each do |group| %>
|
|
<article id="profile-field-group-<%= group.id %>" class="row my-3">
|
|
<div class="card w-100">
|
|
<div class="card-header">
|
|
<div class="card-header__information">
|
|
<div class="fw-bold fs-l"><%= group.name %></div>
|
|
<div class="fw-bold fs-s"> (<%= group.profile_fields.length %>)</div>
|
|
<% if group.description %>
|
|
<div class="fs-s group__description"><%= group.description %></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="card-header__actions">
|
|
<%= render partial: "add_profile_field_modal", locals: { group: group, dom_safe_name: dom_safe_name(group.name) } %>
|
|
<%= render partial: "edit_group_modal", locals: { group: group, dom_safe_name: dom_safe_name(group.name) } %>
|
|
<%= button_to "Delete Group", admin_profile_field_group_path(group), data: { confirm: "Are you sure?" }, method: :delete, class: "crayons-btn crayons-btn--danger mx-1" %>
|
|
<button id="<%= dom_safe_name(group.name) %>Header" data-toggle="collapse" class="crayons-btn crayons-btn--secondary mx-1"
|
|
data-target="#<%= dom_safe_name(group.name) %>BodyContainer" aria-expanded="false" aria-controls="<%= dom_safe_name(group.name) %>BodyContainer">
|
|
Toggle
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="<%= dom_safe_name(group.name) %>BodyContainer" class="collapse hide p-3" aria-labelledby="<%= dom_safe_name(group.name) %>Header">
|
|
<% if group.profile_fields.empty? %>
|
|
<div> There are no profile fields configured for this group. </div>
|
|
<% else %>
|
|
<% group.profile_fields.each do |field| %>
|
|
<details class="crayons-card mb-4" id="profile-field-<%= field.id %>">
|
|
<summary class="crayons-subtitle-2 p-5"><%= field.label %></summary>
|
|
<div id="<%= field.attribute_name %>_container" class="p-5 pt-0">
|
|
<div class="form-group grid p-6 mb-6 gap-1">
|
|
<%= form_for [:admin, field] do |form| %>
|
|
<%= render "profile_field_form", form: form, group: group %>
|
|
<%= form.submit class: "btn btn-primary" %>
|
|
<% end %>
|
|
<%= button_to "Delete Profile Field", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary mx-auto" %>
|
|
</div>
|
|
</div>
|
|
</details>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<% end %>
|