* Prepare to drop profile columns from user * Update code and factory * Also remove unused constant * Move validation from user to profile * Remove Profiles::ExtractData service object * Add more comments * Simplify sameAs attribute generation * Obey me machine, I am your master * Fix condition order in guard clause * Temporarily disable callback * Fix specs * Reduce usage of Profile#refresh_attributes! * Remove leftover comment * Handle social media links differently * More spec fixes * Fix specs for admin profile fields controller * Fix specs after merge * Fix remaining specs * Update user show request spec * Add comment for follow_hiring_tag * Only save profile when user is valid * Fix seeds.rb for profile fields * Switch from before_save to after_save * Undo unrelated formattin change * Update spec/fixtures/files/profile_fields.csv Co-authored-by: Molly Struve <mollylbs@gmail.com> * Remove data update script and spec * Fix spec * Fix typo in comment * Fix typo in comment * Move article resave logic to service object * Move profile field creation to before(:suite) * Refactor error handling in Profiles::Update * Fix Profiles::Update specs and refactor * Temporarily disable spec * Add ProfileValidator * Clean up * Move DB ready check into app/lib * Refresh attributes after importing from CSV * Fix specs * Remove unused file * A girl has no name. A profile neither. * Fix specs * Add responds_to? check * Spec fix * Add name to user fields in profile settings page Co-authored-by: Molly Struve <mollylbs@gmail.com>
53 lines
2.8 KiB
Text
53 lines
2.8 KiB
Text
<% @grouped_profile_fields.each do |group| %>
|
|
<% group_name = group.name.gsub(/\s+/, "_") %>
|
|
<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, group_name: group_name } %>
|
|
<%= render partial: "edit_group_modal", locals: { group: group, group_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="<%= group_name %>Header" data-toggle="collapse" class="crayons-btn crayons-btn--secondary mx-1"
|
|
data-target="#<%= group_name %>BodyContainer" aria-expanded="false" aria-controls="<%= group_name %>BodyContainer">
|
|
Toggle
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="<%= group_name %>BodyContainer" class="collapse hide p-3" aria-labelledby="<%= 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| %>
|
|
<div id="profile-field-<%= field.id %>" class="card mt-3">
|
|
<%= render partial: "admin/shared/card_header",
|
|
locals: {
|
|
header: field.label,
|
|
state: "collapse",
|
|
target: "#{field.attribute_name}_container",
|
|
expanded: "false"
|
|
} %>
|
|
<div id="<%= field.attribute_name %>_container" class="card-body collapse hide" aria-labelledby="<%= field.attribute_name %>_container">
|
|
<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>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<% end %>
|