Commit Graph

17 Commits

Author SHA1 Message Date
Chris Hill-Scott
741a8856fa Remove the word ‘printable’
Don’t think it’s necessary. Makes things consistent with the sent letter
page, which only says ‘Download as a PDF’.

This inconsistency would be more glaring now these pieces of text appear
in the same place, in adjacent steps of a journey.
2018-11-22 12:36:29 +00:00
Chris Hill-Scott
7e4ef84635 Put sticky footers on check one-off page
This page is a good use case for sticky footers because the primary
action on the page would otherwise be off the bottom of the viewport.
2018-11-19 15:26:13 +00:00
Chris Hill-Scott
8200514461 Fix double error border 2018-11-01 14:45:12 +00:00
Chris Hill-Scott
d6b785d3fa Style ‘Download PDF’ link 2018-10-31 14:29:38 +00:00
Chris Hill-Scott
1675e6c8d2 Show error banner for one off letter in trial mode
In trial mode you can’t send letters. But it’s still useful to be able
to build up a letter to see how it work.

Best place to put this error is before someone tries to send a letter
for real.
2018-10-31 14:25:49 +00:00
Chris Hill-Scott
a79dfd1d6e Always show download link for PDF
This feature is useful for people to try the letter thing out and see
how it feels, maybe print one on their own printer before incurring
cost.
2018-10-31 14:22:27 +00:00
Chris Hill-Scott
e34ca2a8ee Make it clear which template you’re sending
The one downside of skipping the template page is that you no longer
get such strong confirmation that you’ve picked the correct template.
You still see the preview of the template, but it’s further down the
page, and the name of the template has disappeared.

This commit adds the name of the template to the page title, to:
- have some continuity from the previous page
- make it easier to double-check you’ve chosen the correct template
2018-08-09 11:56:15 +01:00
Chris Hill-Scott
3dab34cd38 Store template ID and original file name in URL
At the moment you can’t press refresh on the check page if there’s
errors. This is because the session gets cleared when there’s errors.
This is a bad user experience.

The data that this page is relying on (from the session) is:
- template ID
- original file name

Neither of these things need to be in the session because:
- they are not secret
- the user can modify them already (by choosing a different template or
  renaming their file locally)

So this commit additionally stores them in the URL.
2018-04-04 11:30:27 +01:00
Chris Hill-Scott
9aa4a7267a Use <button> not <input>s for form submission
Both `<button type='submit'>Submit<button>` and
`<input type='submit' value='Submit'>` can be used to submit a form.

We have historically[1] used `<input>` because it’s better-supported by
IE6 in that:
- the `submit` attribute is mandatory on `<button>`, not on `<input>`
- the `innerHTML` of a button will be submitted to the server, not the
  value (as in other browsers)

Reasons to now use `<button>` instead:
- IE6/7 support is no longer a concern (especially with deprecation of
  TLS 1.0 on the way)
- Because an `<input>` element can’t have children, the pseudo-element
  hack[2] used to ensure the top edge of the button is clickable doesn’t
  work. We’re seeing this bug[3] affect real users in research.

1. We inhereted our buttons from Digital Marketplace, here is me making
   that change in their code:  8df7e2e79e (diff-b1420f7b7a25657d849edf90a70ef541)
2. 24e1906c0d (diff-ef0e4eb6f1e90b44b0c3fe39dce274a4R79)

3. https://github.com/alphagov/govuk_elements/issues/545
2018-02-01 13:53:45 +00:00
Chris Hill-Scott
a604ed60b6 Remove value of download attribute on links
We should standardise on <a download> rather than
<a download="download"> everywhere. The value of the download attribute
tells the browser what filename to use, but is overridden by the
Content-Disposition HTTP header. Since it’s not being used, we should
remove it for the sake of disambiguation.
2018-01-02 16:52:17 +00:00
Chris Hill-Scott
a58d881647 Make one-off error refer to correct message type
This was hard coded to say ‘You can’t send to this phone number’ even
when you were trying to send an email.
2017-07-26 07:50:01 +01:00
Chris Hill-Scott
2291c4faf4 Make sure errors on one-off flow have red border
When I split up the error messages on the check CSV page into multiple
templates, I also reduced the repetition of wrapping `<div>`s and macro
calls by moving them up outside the conditional blocks (see
8e947f315d).

Unfortunately I didn’t make the same adjustments for the one-off flow,
which meant that errors on these pages lost their styling. This commit
re-adds the styling for these error messages.
2017-07-26 07:46:20 +01:00
Chris Hill Scott
dd52f60828 Fix page titles on preview page
Should match the `<h1>`
2017-07-04 14:28:12 +01:00
Leo Hemsted
ef4d3d111f help (aka tour) now works correctly throughout the notification flow 2017-06-30 11:49:03 +01:00
Leo Hemsted
87aeec1b8d add other send notification error branches and tests 2017-06-29 16:10:59 +01:00
Leo Hemsted
42e33ce9e6 make partials source-agnostic
they're currently expecting a RecipientsCSV object - but we won't
always have that available if we're handling a single notification.

So make the partials take generic variables, and then use a jinja with
block to pass in the correct values from either the check csv page or
the check notification page.

Additionally set the notification check page to show errors nicely -
hide the send button if there were problems, and replace the header
2017-06-29 15:33:31 +01:00
Leo Hemsted
40f805c230 add new endpoints for one-off flow
rather than creating a job, after entering the placeholders, you now
send a single notification. This means we don't clog up s3 by creating
lots of one line CSV files.
2017-06-29 12:40:03 +01:00