-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57fcdf3
commit 54a2a00
Showing
13 changed files
with
190 additions
and
92 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const AreaView = require('../models/area-view') | ||
const fwisService = require('../services/fwis') | ||
|
||
module.exports = { | ||
method: 'GET', | ||
path: '/area/{id?}', | ||
options: { | ||
handler: async (request, h) => { | ||
try { | ||
const { id } = request.params | ||
const data = await fwisService.get() | ||
|
||
return h.view('area', new AreaView(data, request.url.href, id)) | ||
} catch (err) { | ||
console.error(err) | ||
throw err | ||
} | ||
} | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends 'layout.html' %} | ||
|
||
{% from "date-input/macro.njk" import govukDateInput %} | ||
{% from "tabs/macro.njk" import govukTabs %} | ||
{% from "table/macro.njk" import govukTable %} | ||
{% from "table/macro.njk" import govukTable %} | ||
{% from "button/macro.njk" import govukButton %} | ||
|
||
{% set bodyClasses = "internal" %} | ||
|
||
{% block head %} | ||
<meta http-equiv="refresh" content="60"> | ||
{{super()}} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{{super()}} | ||
<div class="govuk-body"> | ||
|
||
<div class="govuk-inset-text"> | ||
Generated on | ||
<time id="updated-time">{{updateTime}}</time> | ||
</div> | ||
<div class="govuk-tabs"> | ||
<h2 class="govuk-tabs__title"> | ||
Area View | ||
</h2> | ||
|
||
<ul class="govuk-tabs__list"> | ||
<li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab" href="/"> | ||
Summary | ||
</a> | ||
</li> | ||
<li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab govuk-tabs__tab--selected" href="/area"> | ||
Area View | ||
</a> | ||
</li> | ||
<!-- <li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab" href="/severity"> | ||
Severity View | ||
</a> | ||
</li> | ||
<li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab" href="#past-year"> | ||
Past year | ||
</a> | ||
</li> --> | ||
</ul> | ||
|
||
<section class="govuk-tabs__panel" id="past-day"> | ||
{% if id %} | ||
<span style="float: right"> | ||
<a href="/area" class="govuk-link">Show All Areas</a> | ||
</span> | ||
<span class="govuk-caption-xl"> | ||
{{id}} | ||
</span> | ||
{% endif %} | ||
|
||
<h2 class="govuk-heading-l">Area View</h2> | ||
{% include "./partials/area.html" %} | ||
</section> | ||
</div> | ||
|
||
</div> | ||
<div> | ||
<a href="{{url}}" class="govuk-button">Refresh</a> | ||
</div> | ||
<div>For help and information please contact: <a href="mailto:wandlsupport@enviroment-agency.gov.uk">wandisupport@enviroment-agency.gov.uk</a></div> | ||
<script src="{{ assetPath }}/scripts/templates.js"></script> | ||
<script src="{{ assetPath }}/scripts/home.js"></script> | ||
{% endblock %} |
Oops, something went wrong.