Skip to content

Commit

Permalink
Merge pull request #1852 from DFE-Digital/improve-task-list-design
Browse files Browse the repository at this point in the history
Improve task list designs
  • Loading branch information
thomasleese authored Dec 8, 2023
2 parents 87bbe2b + 62eaced commit eae342c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.sass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ul.autocomplete__menu {
margin-bottom: 0;
}

.app-table__center {
text-align: center;
.app-table__center_right {
text-align: right;
vertical-align: middle;
}
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 @@ -21,7 +21,7 @@
<%= simple_format @professional_standing_request.verify_note %>
</td>

<td class="govuk-table__cell app-table__center">
<td class="govuk-table__cell app-table__center_right govuk-!-padding-right-1">
<%= render(StatusTag::Component.new(@professional_standing_request.status)) %>
</td>
</tr>
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 eae342c

Please sign in to comment.