Commit Graph

2910 Commits

Author SHA1 Message Date
Chris Hill-Scott
810b613bc2 Remove nl2br Jinja filter
This was used when the code for previewing SMS templates lived in the
admin. ⌘F seems to suggest it’s not used anywhere else.
2016-12-20 11:10:38 +00:00
Chris Hill-Scott
5411fc4c7f Merge pull request #1057 from alphagov/pricing-on-product
Show pricing and number of services on product page
2016-12-19 12:49:30 +00:00
Chris Hill-Scott
ed1b7aad07 Add number of services to product page
One of the user needs that we identified is not wanting to be the first
to use it. It feels like a much less risky choice if there are already
other people in government using it.

The easiest way to communicate this is with counts of how many services.
The count of departments is good because it shows breadth, where the
count of services shows depth.

Hard coded for now because we have no automatic way of splitting our
test services from real live services.
2016-12-19 12:40:57 +00:00
Chris Hill-Scott
acdbba694e Use ‘pence’ in full
This matches what we now do on the product page.

From the GOV.UK style guide:
> Write out pence in full: calls will cost 4 pence per minute from a landline.

– https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#money
2016-12-19 12:40:37 +00:00
Chris Hill-Scott
a4e5c4a3bc Add pricing to the product page
‘How much does it cost’ is one of the user needs that we identifed for
the product page.

Cost is not the primary reason someone would use Notify (they’re more
likely to cite ease, or that it’s ‘official’). However if you _don’t_
mention cost then it looks like we’re hiding something or that there’s
a catch. So putting it on the page allays fears that people might have,
rather than pushing them towards using it.

Visually I’ve dropped the size of the `<h2>`s on this page so that
there’s enough difference between them and the big numbers. The idea of
the big numbers being big is to catch people’s attention as they scroll
down the page, by breaking up the rythmn.
2016-12-19 12:22:11 +00:00
minglis
0b0bd54a3e Merge pull request #1056 from alphagov/box-shadow-colour
Fix button shadow colour on product page
2016-12-16 15:19:06 +00:00
minglis
86b4ba6985 Merge pull request #1055 from alphagov/quis-patch-1
Fix misaligned sidebar on the tour
2016-12-16 15:15:54 +00:00
minglis
00564917a6 Merge pull request #1054 from alphagov/ie-product-css-fixes
Fix images on product page in older version of IE
2016-12-16 15:15:42 +00:00
Chris Hill-Scott
d4ab469a33 Fix button shadow colour on product page
The button was inheriting a green box shadow from the default GOV.UK
button style, which is typically used on a white background. On the blue
background, a darker blue shadow looks better I think.

The 15% darkening is the same as used by the default green button:
a3fe44e00e/stylesheets/design-patterns/_buttons.scss (L36)
2016-12-16 15:11:50 +00:00
minglis
c98a9e89f0 Merge pull request #1053 from alphagov/remove-session-protection
Switched off session protection
2016-12-16 14:31:34 +00:00
Chris Hill-Scott
cb1a26c37d Fix misaligned sidebar on the tour
Got broken when we moved the service name out of the nav.
2016-12-14 16:40:50 +00:00
Chris Hill-Scott
ecf7f5a1b5 Merge pull request #1037 from alphagov/pdf-preview
Render letter templates as PNGs and PDFs
2016-12-14 17:16:48 +01:00
Chris Hill-Scott
3713bad569 Include content count bug fix
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/102
2016-12-14 15:51:03 +00:00
Chris Hill-Scott
922a27e74b Use more sensible version number for html5lib
html5lib version numbers look like 0.999, 0.9999, etc.

This was making people unhappy, so they’ve added version numbers like
1.0b1, 1.0b2, etc which map to the numbers with lots of nines.

The equivalent version for 0.9999999 (7 nines) is 1.0b8 😐
2016-12-14 15:02:54 +00:00
Chris Hill-Scott
1c679ae621 Make breaking change not use rendered template
The breaking change page was taking the rendered template and saving
that if the user confirmed the change. This meant that templates could
be saved with `<span class="placeholder">…</span>` in their subject line
for example.

This commit fixes it so that it uses whatever data the user submitted,
not the rendered version of this.
2016-12-14 14:32:07 +00:00
Chris Hill-Scott
dc63de0f4e Incorporate breaking utils changes
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/94
2016-12-14 14:32:07 +00:00
Martyn Inglis
994032a76f Switched off session protection
Many departments are reporting being logged out during usage of the app
This may be because they present differing IP addresses to Notify on different requests due to outbound proxies and so on
Swicthing session protection to None means and IP change won't log a user out.
2016-12-14 14:07:08 +00:00
imdadahad
b02b4fbd71 Merge pull request #1052 from alphagov/add-link-to-net-client
Add link to .NET client under API docs
2016-12-14 13:17:07 +00:00
Imdad Ahad
3ccfc34d0f Update documentation page with .NET client link 2016-12-13 13:32:20 +00:00
Chris Hill-Scott
ae356fc741 Use PDF link renderer to preview letters
Depends on and implements:
- [x] https://github.com/alphagov/notifications-utils/pull/84
- [ ] https://github.com/alphagov/notifications-utils/pull/86
2016-12-13 10:34:19 +00:00
Chris Hill-Scott
43296469d6 Add endpoint for generating an image of a letter
The PDF preview is all good, but it’s hard, finickeity and feels dirty
to embed a PDF in a web page. It’s a more natural thing to embed an
image in a web page.

So this commit adds another endpoint to return an image of a letter
template. It generates this image from the PDF preview, so the stack
looks like:

1. `template.png` (generated in admin)
2. `template.pdf` (generated in admin)
3. HTML preview (generated by a `Renderer` in utils)
4. `Template` instance
5. serialised template from API
6. Template stored in database

The library used to convert the PDF to an image is Wand[1], which binds
to ImageMagick underneath. So in order to get this working locally on a
Mac you will probably need to do:
`brew install imagemagick ghostscript cairo pango`.

To get it working on Ubuntu/EC2 is an exercise left to the reader…

1. http://docs.wand-py.org/en/0.4.4/
2016-12-13 10:34:18 +00:00
Chris Hill-Scott
d0f90eac7e Add an endpoint for generating a PDF of a letter
Previewing a letter is different to previewing an email or text message
because:

- a letter has a layout
- the layout is fixed, ie it doesn’t depend on the user’s device
- the ‘send yourself a test’ feature won’t be as useful because it has
  a lead time, so the feedback loop will be much longer

For these reasons a HTML-only preview of the letter won’t be enough (we
don’t think). A PDF is more appropriate because:

- it can replicate the layout of the letter exactly
- it is a print format, so the user could even print themselves a copy
  locally to get a feel for how it will look

This commit makes use of Flask WeasyPrint [1] to take a HTML
representation of the letter, convert it to a PDF and serve it back to
the user.

The actual work to generate the HTML and specify the layout is done in
utils, same as we do for rendering other messages.

1. https://pythonhosted.org/Flask-WeasyPrint/
2016-12-13 10:34:18 +00:00
Chris Hill-Scott
4f72cc20ef Use patched version of WeasyPrint
Reasons here: 99718c2caf
2016-12-13 10:34:18 +00:00
Rebecca Law
0a69f1797a Merge pull request #1047 from alphagov/invitation-expiry-msg
Invitation expiry msg
2016-12-13 10:00:33 +00:00
Leo Hemsted
466d0b10ac Merge pull request #1051 from alphagov/inactive-service
users can't edit inactive services
2016-12-12 14:59:30 +00:00
Chris Hill-Scott
c45c70c771 Make SVGs 100% wide
Internet Explorer 11 and below don’t scale SVG images properly when
they’re used in `<img>` tags. See
https://gist.github.com/larrybotha/7881691 for details.

This manifested itself as the SVG images on the product page being
smaller when viewed in IE11 than other browsers.

This commit explicitly sets them the be 100% wide, which seems to fix
the problem.
2016-12-12 10:44:42 +00:00
Chris Hill-Scott
721837e61c Don’t show hero image on IE8
IE8 doesn’t support background-size, so the image appears too big, the
text overlaps it, and everything becomes a mess.
2016-12-12 10:44:07 +00:00
Chris Hill-Scott
1a75daef55 Merge pull request #1050 from alphagov/letter-assets
Add assets for letter previews
2016-12-09 17:24:59 +01:00
Leo Hemsted
2419f0d8a9 write tests for @minglis 's code 🙁 2016-12-09 16:09:47 +00:00
Leo Hemsted
d56b7b9a58 block inactive services from making stateful changes
in the NotifyAdminAPIClient, which all api traffic goes through, return
403 for any stateful requests (post, put and delete), if the following
criteria have been met:
* a current_service is set
    (this prevents checks being carried out on non-service related
     updates, eg editing user details)
* the service is not active
* the current user is not a platform admin

so platform admins can still update anything.

Note: Without any specific error handling, the user will see a generic
403 page. This is fine, probably - it's a relatively niche case that
you'll be editing a service you can't get to anyway
2016-12-09 16:09:42 +00:00
Imdad Ahad
a935d28116 Add link to .NET client under API docs 2016-12-09 16:08:51 +00:00
Leo Hemsted
255ce158b7 block inactive services from making stateful changes
in the NotifyAdminAPIClient, which all api traffic goes through, return
403 for any stateful requests (post, put and delete), if the following
criteria have been met:
* a current_service is set
    (this prevents checks being carried out on non-service related
     updates, eg editing user details)
* the service is not active
* the current user is not a platform admin

so platform admins can still update anything.

Note: Without any specific error handling, the user will see a generic
403 page. This is fine, probably - it's a relatively niche case that
you'll be editing a service you can't get to anyway
2016-12-09 15:44:58 +00:00
Chris Hill-Scott
f6b566fdf8 Merge pull request #1048 from alphagov/product-page-fixes
Fix a couple of things that got missed on the product page
2016-12-09 14:12:43 +01:00
Chris Hill-Scott
54d7306d77 Add assets for letter previews 2016-12-09 11:26:32 +00:00
Chris Hill-Scott
c72a19178b Remove duplicate <h2> definition 2016-12-07 17:02:03 +00:00
Chris Hill-Scott
82f6c20101 Add alt text for the images on the product page
The images are telling you stuff that is extra to the text on the page
so they should be explained for users who can’t see them.
2016-12-07 17:00:53 +00:00
Chris Hill-Scott
a56d945beb Merge pull request #1035 from alphagov/new-product-page
New product page part 1
2016-12-07 17:34:13 +01:00
Chris Hill-Scott
9ec2f2b5d0 Add a ‘team’ section
This addresses part of the ‘is Notify dependable’ group of needs.

The ones it specifically and partially addresses are:
- is it reliable
- how is it supported

There’s more to come in this section, we’re doing this bit now because
it’s a nice conclusion to the page.
2016-12-07 16:14:32 +00:00
Chris Hill-Scott
4af8206723 Reword and embiggen the headings
Also reword some of the `<p>`s so that they flow better from the
headings.

This was a bit me, and a bit sitting down and hammering this stuff out
with Stephen and Sheryll.
2016-12-07 16:14:32 +00:00
Chris Hill-Scott
63e13836b0 Add illustration to the ‘what is Notify’ section
Compliments the new tagline. Illustration by Stephen.

Only shown where there is space (ie on desktop).
2016-12-07 16:14:32 +00:00
Chris Hill-Scott
eca4fbbf54 Change tagline
The previous one didn’t communicate that this is a thing for sending
stuff to your users. The lede already explains that it’s a thing for
government.
2016-12-07 16:14:32 +00:00
Chris Hill-Scott
40d2d3f338 Space out items in blue box a bit
I went too far with tightening it up from the prototype. This is
somewhere in between.
2016-12-07 16:14:32 +00:00
Chris Hill-Scott
16226c9975 Remove ‘to your account’ from the sign in link
It’s getting a bit long now it’s not the only link; we say just ‘sign
in’ elsewhere.
2016-12-07 16:14:31 +00:00
Chris Hill-Scott
6072ec1e19 Add a grid of features to the home page
This is the first step towards a fully-fledged ‘product’ page.

The needs for the top, blue section of the page are:
- what is Notify?
- can I use it?
- can I test it out?
- how do I create a log in

The needs for the next section of this page (which is the only one added
by this commit) are:
- how will Notify help me work?
- will it work with my service?

This commit shows 4 features of Notify on the home page which address
those needs. They are illustrated because:

1. We want to catch people’s attention – users are reluctant to scroll
   on this page because they just want to click the ‘create account
   button’. But we hypothesize that they will get on better
   with Notify if they look at some of this stuff first.

2. The concepts that they’re talking about are hard to explain with just
   words because they’re quite abstract. The illustrations help us be
   more specific.

3. Feedback we got from user research was that the product page didn’t
   give users any sense of what it was like to actually use Notify.
2016-12-07 16:14:31 +00:00
Chris Hill-Scott
bbf3969525 Match type sizes to prototype 2016-12-07 16:14:31 +00:00
Chris Hill-Scott
f9d2034e4f Make the blue header on the home page full-width
This copies the style that Tim and Stephen have been developing for all
product pages.

It also pulls out the CSS for this into its own file, so that it could
potentially be reused.
2016-12-07 16:14:30 +00:00
Chris Hill-Scott
6cda78e7d5 Cover up the header bar 2016-12-07 16:14:30 +00:00
Chris Hill-Scott
403e133b80 Remove the phones 2016-12-07 16:14:30 +00:00
Chris Hill-Scott
92ad308fca Replace beta banner with beta badge
This is part of the new header style that Tim, Stephen et al have been
working on.

This means that we lose the feedback link, so I’m trying out having it
in the top right.
2016-12-07 16:14:30 +00:00
Chris Hill-Scott
397ad05db9 Make a full width base template
We need this because the top section of the new product page will be
going full-bleed.
2016-12-07 16:14:30 +00:00