Skip to content

Commit

Permalink
Add task list template
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto committed Dec 14, 2023
1 parent 30594d5 commit 65ed903
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

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

## 1.2.2

### Fixes
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"
}],
"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",
"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
107 changes: 107 additions & 0 deletions templates/task-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{% 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 %}

0 comments on commit 65ed903

Please sign in to comment.