Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #54 from uktrade/fix/remove-govuk-font-logo
Browse files Browse the repository at this point in the history
Update content and styling
  • Loading branch information
mforner13 authored May 24, 2021
2 parents e4ab6b8 + 82e37fd commit 2049ac9
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 76 deletions.
7 changes: 5 additions & 2 deletions cypress/integration/home_page_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ describe('The Home Page', () => {
})
it('displays the correct text', () => {
cy.get('h1').contains(
`Update supply chain information`
'Update supply chain information'
)
cy.get('p').contains("It's important to keep your departmental action plan records up to date. This is so we can work towards constantly improving the UK's supply chain resilience.")
cy.get('h2').contains('Complete your monthly update')
cy.get('li').contains('You need to complete your monthly update for 5 supply chains')
cy.lastWorkingDay().then(deadline => {
cy.get('li').contains( `You need to complete your monthly update for 5 supply chains by ${deadline}`)
})
cy.get('li').contains(
'Select a supply chain to provide your regular monthly update or to update wider details.'
)
Expand Down
11 changes: 0 additions & 11 deletions cypress/integration/task_list_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ describe('The Supply Chain Tasklist Page', () => {
it('displays enabled submit button', () => {
cy.get('button').contains('Submit monthly update')
})
it('links to the strategic action summary page', () => {
cy.get('a').contains('View strategic action summary')
.should('have.attr', 'href')
.and('equal', `/${supplyChain.slug}/strategic-actions/`)
})
it('links to the supply chain summary page', () => {
cy.get('a').contains('View supply chain summary')
.should('have.attr', 'href')
.and('equal', `/${supplyChain.slug}/summary/`)

})
})

const completedSC = supplyChains[1].fields
Expand Down
8 changes: 8 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,11 @@ Cypress.Commands.add(
}
)

Cypress.Commands.add(
'lastWorkingDay',
() => {
cy.exec('env PYTHONPATH=defend_data_capture python defend_data_capture/scripts/get_last_working_day_this_month.py').then(result => {
cy.wrap(result.stdout)
})
}
)
6 changes: 1 addition & 5 deletions defend_data_capture/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
@function frontend-font-url($filename) {
@return url("~govuk-frontend/govuk/assets/fonts/" + $filename);
}

@function frontend-image-url($filename) {
@return url("~govuk-frontend/govuk/assets/images/" + $filename);
}

$govuk-font-url-function: frontend-font-url;
$govuk-font-family: "Arial";
$govuk-image-url-function: frontend-image-url;

@import "~govuk-frontend/govuk/all";
Expand Down
21 changes: 21 additions & 0 deletions defend_data_capture/scripts/get_last_working_day_this_month.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from supply_chains.utils import (
get_last_day_of_this_month,
get_last_working_day_of_a_month,
)


def get_date_suffix(day):
if 4 <= day <= 20 or 24 <= day <= 30:
return "th"
else:
return ["st", "nd", "rd"][day % 10 - 1]


def get_formatted_deadline():
deadline = get_last_working_day_of_a_month(get_last_day_of_this_month())
suffix = get_date_suffix(deadline.day)
print(deadline.strftime(f"%A %d{suffix} %B %Y"))


if __name__ == "__main__":
get_formatted_deadline()
30 changes: 6 additions & 24 deletions defend_data_capture/supply_chains/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,12 @@
<header role="banner">
<div class="govuk-header" data-module="govuk-header">
<div class="govuk-header__container govuk-width-container">
<div class="govuk-header__logo">
<a href="#" class="govuk-header__link govuk-header__link--homepage">
<span class="govuk-header__logotype">
<svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36">
<path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2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9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
<image src="/assets/images/govuk-logotype-crown.png" xlink:href="data:," display="none" class="govuk-header__logotype-crown-fallback-image" width="36" height="32"></image>
</svg>
<span class="govuk-header__logotype-text">
GOV.UK
</span>
</span>
</a>
</div>
<div class="govuk-header__content">
<a href="/" class="govuk-header__link govuk-header__link--service-name">
Resilience tool
</a>
<span class="app-header-span">
<p class="app-header-item">{{ request.user }} - {{ request.user.gov_department.name }}</p>
</span>
</div>
<a href="/" class="govuk-header__link govuk-header__link--service-name">
UK supply chain resilience tool
</a>
<span class="app-header-span">
<p class="app-header-item">{{ request.user }} - {{ request.user.gov_department.name }}</p>
</span>
</div>
</div>
<div class="govuk-phase-banner govuk-width-container">
Expand All @@ -56,9 +41,6 @@
This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it.
</span>
</span>
<span class="app-switch-to-tool-link">
<a class="govuk-link govuk-link--no-visited-state" href="#">Switch to tool</a>
</span>
</p>
</div>
</header>
Expand Down
5 changes: 0 additions & 5 deletions defend_data_capture/supply_chains/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

{% block body %}
<h1 class="govuk-heading-xl">Update supply chain information</h1>

<p class="govuk-body">
It's important to keep your departmental action plan records up to date. This is so we can work towards constantly improving the UK's supply chain resilience.
</p>
<div class="govuk-inset-text">
Find more information on the data you provide in the <a class="govuk-link" href="#">UK supply chian resilience tool</a>.
</div>

<h2 class="govuk-heading-l"> Complete your monthly update</h2>
<ul class="govuk-list govuk-list--bullet">
<li>
Expand Down
30 changes: 1 addition & 29 deletions defend_data_capture/supply_chains/templates/task_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,35 +117,7 @@ <h2 class="govuk-heading-l tasklist-actions-header">Monthly strategic actions<br
</button>
</form>
{% else %}
<br>
<br>
<a href={% url 'index' %} class="govuk-button govuk-button--secondary">Back to home</a>
{% endif %}


<h2 class="govuk-heading-l">Strategic action summary</h2>
<p class="govuk-body">
Make sure you have updated and completed all relevant sections.
</p>
<p class="govuk-body">
This includes: Description of the action, impact, strategic action framework category and depedencies
</p>
<p class="govuk-body">
<a href={% url 'strategic-action-summary' view.supply_chain.slug %} class="govuk-link">View strategic action summary</a>
</p>

<h2 class="govuk-heading-l">Supply chain summary</h2>
<p class="govuk-body">
Make sure you have updated and completed all relevant sections.
</p>
<p class="govuk-body">
This includes: Key information, vulnerability assessment, scenario assessment, maturity self assessment, risk monitoring and archived strategic actions
</p>
<p class="govuk-body">
<a href={% url 'supply-chain-summary' view.supply_chain.slug %} class="govuk-link">View supply chain summary</a>
</p>

<br>
<a href={% url 'index' %} class="govuk-button govuk-button--secondary">Back to home</a>


{% endblock %}

0 comments on commit 2049ac9

Please sign in to comment.