app/views/emancipations/show.html.erb
<div class="row justify-content-between align-items-center pt-30 mb-30">
<div class="col-sm-auto dashboard-table-header">
<h1>Emancipation Checklist</h1>
<%= link_to @current_case.case_number, casa_case_path(@current_case) %>
</div>
<div class="col-sm-auto">
<span class="mt-md-0 text-center">
<%= link_to casa_case_emancipation_path(@current_case, format: :docx), class: "main-btn primary-btn btn-sm btn-hover" do %>
<i class="lni lni-download mr-10"></i>
Download Checklist
<% end %>
</span>
</div>
</div>
<!-- ========== card start ========== -->
<div class="card-style mb-40">
<% @emancipation_form_data.each do |category| %>
<h6 class="emancipation-category no-select" data-is-open="<%= emancipation_category_checkbox_checked(@current_case, category) ? "true" : "false" %>">
<div class="checkbox-style emacipation-category-input-label-pair">
<input
type="checkbox"
class="emancipation-category-check-box form-check-input"
value="<%= category.id %>"
<%= emancipation_category_checkbox_checked(@current_case, category) %>>
<div class="pt-10"><%= category.name %></div>
</div>
<% if category.emancipation_options.count > 0 %>
<span class="category-collapse-icon pt-10"><%= emancipation_category_collapse_icon(@current_case, category) %></span>
<% end %>
</h6>
<div class="category-options" style="<%= emancipation_category_collapse_hidden(@current_case, category) %>">
<% category.emancipation_options.each do |option| %>
<div class="check-item">
<% if category.mutually_exclusive %>
<input
type="radio"
id="O<%= option.id %>"
class="emancipation-radio-button"
name="C<%= category.id %>"
value="<%= option.id %>"
<%= emancipation_option_checkbox_checked(@current_case, option) %>>
<% else %>
<input
type="checkbox"
id="O<%= option.id %>"
class="emancipation-option-check-box"
value="<%= option.id %>"
<%= emancipation_option_checkbox_checked(@current_case, option) %>>
<% end %>
<label><%= option.name %></label>
</div>
<% end %>
<!-- The labels here intentionally do not have for attributes matching the inputs -->
<!-- This is because javascript sets the state of the checkbox depending on whether the ajax based saving was successful -->
</div>
<% end %>
</div>
<!-- card end -->