Skip to content

Commit

Permalink
Remove indentation on some task lists
Browse files Browse the repository at this point in the history
This has been requested by the designer.
  • Loading branch information
thomasleese committed Dec 6, 2023
1 parent 26bda84 commit 62eaced
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
16 changes: 9 additions & 7 deletions app/components/task_list/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<ol class="app-task-list">
<% sections.each do |section| %>
<li>
<h2 class="app-task-list__section">
<% if sections.count > 1 %>
<span class="app-task-list__section-number"><%= section[:number] %>. </span>
<% end %>
<% if (title = section[:title]).present? %>
<h2 class="app-task-list__section">
<% if sections.count > 1 %>
<span class="app-task-list__section-number"><%= section[:number] %>. </span>
<% end %>

<%= section[:title] %>
</h2>
<%= title %>
</h2>
<% end %>

<ul class="<%= section[:title].present? ? 'app-task-list__items' : 'app-task-list__items-no-indentation' %>">
<ul class="<%= section[:indentation] == false ? 'app-task-list__items-no-indentation' : 'app-task-list__items' %>">
<% section[:items].each do |item| %>
<li class="app-task-list__item">
<% status_id = "#{section[:number]}-#{section[:key]}-#{item[:key]}-status" %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/task_list/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def sections
.map do |section, index|
section.merge(
number: index + 1,
key: section[:title].parameterize,
key: section[:title]&.parameterize,
items:
section[:items].map do |item|
item.merge(key: item[:name].parameterize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= render(TaskList::Component.new(
[
{
title: "",
indentation: false,
items: [
{
name: "Request LoPS verification",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[
{
title: "Qualifications",
indentation: false,
items: @qualification_requests.map do |qualification_request|
{
name: qualification_title(qualification_request.qualification),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[
{
title: "Work references",
indentation: false,
items: @reference_requests.each_with_index.map do |reference_request, index|
{
name: work_history_name_and_duration(reference_request.work_history, most_recent: index.zero?),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[
{
title: "LoPS",
indentation: false,
items: [
{
name: region_teaching_authority_name(@application_form.region, context: :assessor).upcase_first,
Expand Down

0 comments on commit 62eaced

Please sign in to comment.