-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed all custiom SummaryList components to use thew govuk_summary_…
…list component
- Loading branch information
1 parent
9668bc7
commit c6c354e
Showing
6 changed files
with
244 additions
and
275 deletions.
There are no files selected for viewing
255 changes: 131 additions & 124 deletions
255
cosmetics-web/app/views/notifications/_component_details.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 20 additions & 47 deletions
67
cosmetics-web/app/views/notifications/_contact_person_details.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,20 @@ | ||
<%= govukSummaryList( | ||
classes: "govuk-!-margin-bottom-8", | ||
rows: [ | ||
{ | ||
key: { text: "Name" }, | ||
value: { text: contact_person.name }, | ||
actions: { | ||
items: [ | ||
{ | ||
href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "name"), | ||
text: "Edit", | ||
classes: "govuk-link--no-visited-state", | ||
visuallyHiddenText: "the name" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
key: { text: "Email" }, | ||
value: { text: contact_person.email_address }, | ||
actions: { | ||
items: [ | ||
{ | ||
href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "email_address"), | ||
text: "Edit", | ||
classes: "govuk-link--no-visited-state", | ||
visuallyHiddenText: "email address" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
key: { text: "Telephone" }, | ||
value: { text: contact_person.phone_number }, | ||
actions: { | ||
items: [ | ||
{ | ||
href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "phone_number"), | ||
text: "Edit", | ||
classes: "govuk-link--no-visited-state", | ||
visuallyHiddenText: "the telephone number" | ||
} | ||
] | ||
} | ||
}, | ||
] | ||
) %> | ||
<%= govuk_summary_list do |summary_list| | ||
summary_list.with_row do |row| | ||
row.with_key { "Name" } | ||
row.with_value { contact_person.name } | ||
row.with_action(text: "Edit", href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "name"), visually_hidden_text: "the name") | ||
end; | ||
|
||
summary_list.with_row do |row| | ||
row.with_key { "Email" } | ||
row.with_value { contact_person.email_address } | ||
row.with_action(text: "Edit", href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "email_address"), visually_hidden_text: "email address") | ||
end; | ||
|
||
summary_list.with_row do |row| | ||
row.with_key { "Telephone" } | ||
row.with_value { contact_person.phone_number } | ||
row.with_action(text: "Edit", href: edit_responsible_person_contact_person_path(contact_person.responsible_person, contact_person, field: "phone_number"), visually_hidden_text: "the telephone number") | ||
end; | ||
|
||
end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
<%= govukSummaryList( | ||
classes: "opss-summary-list-mixed", | ||
rows: [ | ||
<%= govuk_summary_list do |summary_list| | ||
|
||
if component.ph_range_not_required? | ||
{ | ||
key: { text: "pH" }, | ||
value: { text: t(component.ph, scope: [:component_ph, :check_your_answers]) }, | ||
} | ||
summary_list.with_row do |row| | ||
row.with_key { "pH" } | ||
row.with_value { t(component.ph, scope: [:component_ph, :check_your_answers]) } | ||
end; | ||
elsif component.minimum_ph == component.maximum_ph | ||
{ | ||
key: { text: "Exact pH" }, | ||
value: { text: component.minimum_ph }, | ||
} | ||
summary_list.with_row do |row| | ||
row.with_key { "Exact pH" } | ||
row.with_value { component.minimum_ph } | ||
end; | ||
else | ||
{ | ||
key: { text: "pH range" }, | ||
value: { text: "#{component.minimum_ph} to #{component.maximum_ph}" }, | ||
} | ||
summary_list.with_row do |row| | ||
row.with_key { "pH range" } | ||
row.with_value { "#{component.minimum_ph} to #{component.maximum_ph}" } | ||
end; | ||
end | ||
] | ||
) %> | ||
|
||
end %> |
Oops, something went wrong.