Skip to content

Commit

Permalink
add more breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall committed Aug 13, 2024
1 parent 39077da commit 4985517
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/controllers/OrganisationsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const organisationsController = {
try {
const lpa = req.params.lpa

const organisationResult = await datasette.runQuery(`SELECT name, organisation FROM organisation WHERE organisation = '${lpa}'`)
const organisation = organisationResult.formattedData[0]

const datasetsFilter = ['article-4-direction',
'article-4-direction-area',
'conservation-area',
Expand Down Expand Up @@ -87,10 +90,7 @@ const organisationsController = {
}, [0, 0, 0])

const params = {
organisation: {
name: lpaOverview.name,
organisation: lpaOverview.organisation
},
organisation,
datasets,
totalDatasets,
datasetsWithEndpoints,
Expand Down Expand Up @@ -183,7 +183,7 @@ const organisationsController = {
const datasetId = req.params.dataset

try {
const organisationResult = await datasette.runQuery(`SELECT name FROM organisation WHERE organisation = '${lpa}'`)
const organisationResult = await datasette.runQuery(`SELECT name, organisation FROM organisation WHERE organisation = '${lpa}'`)
const organisation = organisationResult.formattedData[0]

const datasetResult = await datasette.runQuery(`SELECT name FROM dataset WHERE dataset = '${datasetId}'`)
Expand Down Expand Up @@ -377,7 +377,8 @@ const organisationsController = {
dataset,
errorHeading,
issueItems,
entry
entry,
issueType
}

res.render('organisations/issueDetails.html', params)
Expand Down
2 changes: 0 additions & 2 deletions src/services/performanceDbApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ ORDER BY
}, {})

return {
name: result.formattedData[0].name,
organisation: result.formattedData[0].organisation,
datasets
}
},
Expand Down
22 changes: 22 additions & 0 deletions src/views/organisations/datasetTaskList.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% extends "layouts/main.html" %}

{% from 'govuk/components/task-list/macro.njk' import govukTaskList %}
Expand All @@ -10,6 +12,26 @@

{{ super() }}

{{ govukBreadcrumbs({
items: [
{
text: "Home",
href: "/manage"
},
{
text: "Organisations",
href: '/organisations'
},
{
text: organisation.name,
href: '/organisations/' + organisation.organisation
},
{
text: dataset.name
}
]
}) }}

{% endblock %}

{% block content %}
Expand Down
33 changes: 33 additions & 0 deletions src/views/organisations/issueDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% from 'govuk/components/error-summary/macro.njk' import govukErrorSummary %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/pagination/macro.njk" import govukPagination %}
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set serviceType = 'Submit'%}

Expand All @@ -12,7 +13,39 @@
{% set pageName %}{{organisation.name}} - {{dataset.name}} - Issues{% endset %}
{%endif%}

{% block beforeContent %}

{{ super() }}

{{ govukBreadcrumbs({
items: [
{
text: "Home",
href: "/manage"
},
{
text: "Organisations",
href: '/organisations'
},
{
text: organisation.name,
href: '/organisations/' + organisation.organisation
},
{
text: dataset.name,
href: '/organisations/' + organisation.organisation + '/' + dataset.dataset
},
{
text: issueType
}
]
}) }}

{% endblock %}

{% block content %}


<div class="govuk-grid-row">
{% include "includes/_dataset-page-header.html" %}
</div>
Expand Down

0 comments on commit 4985517

Please sign in to comment.