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

Add task list page template #26

Merged
merged 7 commits into from
Dec 18, 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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Unreleased
## 2.0.0

- [#26 - Add task list page template](https://github.com/alphagov/govuk-prototype-kit-common-templates/pull/26)

## 1.2.2

Expand Down
7 changes: 6 additions & 1 deletion govuk-prototype-kit.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"pluginDependencies": [{
"packageName": "govuk-frontend",
"minVersion": "4.4.0"
"minVersion": "5.0.0"
frankieroberto marked this conversation as resolved.
Show resolved Hide resolved
}],
"sass": [
"/sass/_contents-list.scss",
Expand Down Expand Up @@ -54,5 +54,10 @@
"name": "Mainstream guide page",
"path": "/templates/mainstream-guide.html",
"type": "nunjucks"
},
{
"name": "Task list page (for GOV.UK Frontend >=5.0.0)",
"path": "/templates/task-list.html",
"type": "nunjucks"
}]
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govuk-prototype-kit/common-templates",
"version": "1.2.2",
"version": "2.0.0",
"description": "Common service page templates for the GOV.UK Prototype Kit",
"author": "GOV.UK Prototype team, UK Government Digital Service",
"license": "MIT",
Expand Down
98 changes: 98 additions & 0 deletions templates/task-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{% extends "layouts/main.html" %}

{% block pageTitle %}
Task list template – {{ serviceName }} – GOV.UK Prototype Kit
{% endblock %}

{% block beforeContent %}
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h1 class="govuk-heading-l">{{ serviceName }}</h1>

<h2 class="govuk-heading-m">[ Heading for first set of tasks ]</h2>

{% set completedStatus = {
text: "Completed"
} %}

{% set incompleteStatus = {
text: "Incomplete",
classes: "govuk-tag--blue"
} %}

{# To switch between the completed and incomplete statues, use some inline logic within the component below, like this: "status: (completedStatus if ... else incompleteStatus)" #}

{{ govukTaskList({
idPrefix: "first-section",
items: [
{
title: {
text: "Name of first task"
},
href: "#",
status: completedStatus
},
{
title: {
text: "Name of second task"
},
href: "#",
status: incompleteStatus
}
]
}) }}

<h2 class="govuk-heading-m govuk-!-margin-top-5">[ Heading for second set of tasks ]</h2>

{{ govukTaskList({
idPrefix: "second-section",
items: [
{
title: {
text: "Name of third task"
},
href: "#",
status: completedStatus
},
{
title: {
text: "Name of fifth task"
},
href: "#",
status: incompleteStatus
},
{
title: {
text: "Name of sixth task"
},
href: "#",
status: completedStatus
},
{
title: {
text: "Name of seventh task"
},
href: "#",
status: incompleteStatus
},
{
title: {
text: "Name of eighth task"
},
href: "#",
status: incompleteStatus
}
]
}) }}

<div class="govuk-!-margin-top-5">
{{ govukButton({ text: "Apply", href: "#" }) }}
</div>

</div>
</div>
{% endblock %}