Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary card #2251

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions src/components/summary-list/card-with-actions/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: Summary in a card with a title and actions
layout: layout-example.njk
---

{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{{ govukSummaryList({
card: {
title: {
text: "University of Gloucestershire"
},
actions: {
items: [
{
href: "#",
text: "Delete choice",
visuallyHiddenText: "of University of Gloucestershire"
},
{
href: "#",
text: "Withdraw",
visuallyHiddenText: "from University of Gloucestershire"
}
]
}
},
rows: [
{
key: {
text: "Course"
},
value: {
html: "English (3DMD)<br>PGCE with QTS full time"
}
},
{
key: {
text: "Location"
},
value: {
html: "School name<br>Road, City, SW1 1AA"
}
}
]
}) }}

{{ govukSummaryList({
card: {
title: {
text: "University of Bristol"
},
actions: {
items: [
{
href: "#",
text: "Delete choice",
visuallyHiddenText: "of University of Bristol"
},
{
href: "#",
text: "Withdraw",
visuallyHiddenText: "from University of Bristol"
}
]
}
},
rows: [
{
key: {
text: "Course"
},
value: {
html: "English (Q3X1)<br>PGCE with QTS full time"
}
},
{
key: {
text: "Location"
},
value: {
html: "School name<br>Road, City, SW2 1AA"
}
}
]
}) }}
223 changes: 223 additions & 0 deletions src/components/summary-list/card-with-title/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
---
title: Summary in a card with a title
layout: layout-example.njk
---

{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{{ govukSummaryList({
card: {
title: {
text: "Lead tenant"
}
},
rows: [
{
key: {
text: "Age"
},
value: {
html: "38"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "age"
}
]
}
},
{
key: {
text: "Nationality"
},
value: {
html: "UK national resident in UK"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "nationality"
}
]
}
},
{
key: {
text: "Working situation"
},
value: {
html: "Part time – less than 30 hours a week"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "working situation"
}
]
}
}
]
}) }}

{{ govukSummaryList({
card: {
title: {
text: "Person 2"
}
},
rows: [
{
key: {
text: "Details known"
},
value: {
html: "Yes"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "whether details are known"
}
]
}
},
{
key: {
text: "Relationship to lead tenant"
},
value: {
html: "Partner"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "relationship to lead tenant"
}
]
}
},
{
key: {
text: "Age"
},
value: {
html: "42"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "age"
}
]
}
},
{
key: {
text: "Working situation"
},
value: {
html: "Unable to work because of long-term sickness or disability"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "working situation"
}
]
}
}
]
}) }}

{{ govukSummaryList({
card: {
title: {
text: "Person 3"
}
},
rows: [
{
key: {
text: "Details known"
},
value: {
html: "Yes"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "whether details are known"
}
]
}
},
{
key: {
text: "Relationship to lead tenant"
},
value: {
html: "Child"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "relationship to lead tenant"
}
]
}
},
{
key: {
text: "Age"
},
value: {
html: "7"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "age"
}
]
}
},
{
key: {
text: "Working situation"
},
value: {
html: "Child under 16"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "working situation"
}
]
}
}
]
}) }}
Loading