Commit Graph

307 Commits

Author SHA1 Message Date
Chris Hill-Scott
28b18bdac8 Thin the borders around the letter preview
1px borders match the keylines that we use on email template previews.
2017-01-04 15:53:13 +00:00
Chris Hill-Scott
6271b427aa Don’t skew bottom half of letter in folded state
Skewing the letter results in a bunch of slightly-off-vertical diagonal
lines. This is a bit visually jarring when everything else on the page
lines up vertically or horizontally.

This commit makes the bottom half of the letter straight, by offsetting
it instead of transforming it. The ‘fold’ now has depth, so it has to
be drawn in somehow, that’s what the `:before` is doing.
2017-01-04 15:53:13 +00:00
Chris Hill-Scott
83a9d3ad42 Make the letter unfold slightly on hover
This might be taking the skeumorphism too far (especially with the
animation). But it’s a way of indicating that the letter will ‘unfold’
if you click it. Might revert this, but let’s see how it feels.
2017-01-04 15:53:12 +00:00
Chris Hill-Scott
6f7255d842 Draw the folded half of the letter with CSS
Users might wonder why they can’t see the whole letter. We should make
it obvious that it’s because the letter is folded. We can use CSS to
draw the bottom half of the page behind the top half. With some
transforms this makes it look like the letter is actually folded.

It’s a bit skeumorphic but:
- I think it achives the desired effect
- the way we show emails and text messages is also mildly skeuomorphic
2017-01-04 15:53:12 +00:00
Chris Hill-Scott
a5ddf93287 Restrict letter previews to their folded height
The letter previews take up too much space on the page (more than a
typical email or text message). This means that users have to scroll too
much.

When we send the real letters they will be folded in half to fit in the
envelope.

So by showing the letter previews on the page cropped to half the
letter’s height:
- it reduces the need for scrolling
- it gives an accurate preview of how the letter will be delivered

This is acheived without hard-coding any heights by using a little-known
quirk of CSS, namely that padding set as a percentage is calculated from
the width of the element, even for top/bottom padding. This means that
we can always set the ratio of the displayed letter to be A4 folded in
half – the square root of 2.
2017-01-04 15:53:12 +00:00
Chris Hill-Scott
69d986ddfa Outline text in HM Government logo
Non-outlined text requires the correct font to be installed to display
properly.

Outlined text is the shapes of the letters converted to vector, so it
doesn’t need any font installed to display.

Since we don’t have the right fonts installed on the boxes yet, this
will make things look better.
2016-12-19 14:47:48 +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
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
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
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
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
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
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
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
fc2ea8aeb8 Merge pull request #1044 from alphagov/fix-alignment-usage
Fix alignment of year label on usage
2016-12-06 10:23:13 +01:00
Chris Hill-Scott
62cb7b5d53 Fix alignment of year label on usage
It got pushed down too far when we added the switch service bar in
https://github.com/alphagov/notifications-admin/pull/1029

This commit fixes it so that the text aligns with the baseline of the
`<h1>`.
2016-12-05 13:02:19 +00:00
Chris Hill-Scott
18d11aa013 Move code for rendering messages/templates → utils
Utils is better structured to handle the logic of what thing to show
for what template type, especially now that what we show for different
template types in different contexts has diverged significantly.

See https://github.com/alphagov/notifications-utils/commit/6b39c1a for
an example of this code moving into utils

Depends on and implements:
https://github.com/alphagov/notifications-utils/pull/84

The main reason for doing this is to get Paul’s fix for the misaligned
CSV columns: https://github.com/alphagov/notifications-utils/pull/87
2016-12-05 12:11:54 +00:00
Chris Hill-Scott
b6ad19fa31 Fix heading spacing on dashboard with 0 templates 2016-11-18 15:50:56 +00:00
Chris Hill-Scott
257fa7f9bb Shift propositional navigation down
This seems to be a custom thing done on Tim and Stephen’s prototype to
re-align the proposition nav. Not sure if it’s better or worse.
2016-11-18 12:00:01 +00:00
Chris Hill-Scott
ee78d0bf59 Move switch service out of black header
Also following the pattern work that Tim and Stephen have done.
2016-11-18 12:00:01 +00:00
Chris Hill-Scott
bfe234b535 Use two-weight GOV.UK Notify logo
Based on the work Tim, Stephen et. al have done on patterns for admin
interfaces across GaaP.

See their prototype here:
https://govuk-product-page-prototypes.herokuapp.com/govuk-notify
2016-11-18 11:59:40 +00:00
Chris Hill-Scott
48496eefde Merge pull request #1024 from alphagov/add-letters-templates-2
Let users upload a CSV file of addresses against a letter template
2016-11-15 17:57:28 +01:00
Imdad Ahad
eaa246bd26 Use SASS var for border colour and correct closing tbody tag 2016-11-14 16:00:45 +00:00
Chris Hill-Scott
88631a680c Sprinkle letter throughout the app
Let users create/edit/delete letter templates.

Let them upload a CSV file or send a test against a letter template.

Big assumption at the moment is that addresses only have one line, and
therefore one column in the CSV file.
2016-11-14 14:51:26 +00:00
Chris Hill-Scott
4a0c860a04 Make border around letter neater
The drop shadow stolen from GOV.UK was a bit crude; this commit makes
it a bit more refined.

Also makes things line up a bit better.
2016-11-14 14:51:26 +00:00
Imdad Ahad
7e269a454a Show more granular email & sms counts on platform admin page 2016-11-14 14:46:26 +00:00
Chris Hill-Scott
fb410496dc Add letter component
Similar to the components we have for previewing email and text
messages.

Style stolen from PDF thumbnail at
https://www.gov.uk/government/publications/honey-bees
2016-11-14 14:29:13 +00:00
Chris Hill-Scott
a36f38edb8 Remove banner for trial mode message
The yellow banner didn’t make this information much more noticeable,
and it made some people miss the request to go live link because it
wasn’t blue.

This commit brings the design back to where it was as of this PR:
https://github.com/alphagov/notifications-admin/pull/904
2016-11-04 14:05:32 +00:00
Chris Hill-Scott
4ae28386a6 Always show live key, reword key labels
This is trying to resolve these confusions:

- that you’re in trial mode, which means you can’t have a live key yet (
  or you can but it wont work, which is what we used to have)
- what does simulate mean

The create key page is the right place to resolve these confusions
because it’s where users are actively reading.

This commit also removes the trial mode banner from API integration
page because this where users _aren’t_ actively reading. A whole bunch
of users weren’t seeing this banner at all.

The implementation of the disabled API key options is kinda clunky
because WTForms doesn’t have a native way of doing this.

¯\_(ツ)_/¯
2016-11-04 14:05:30 +00:00
Chris Hill-Scott
103e09e3a0 Make the UI more performant by not reflowing
Fixes the height of the component until it’s loaded so that it doesn’t
causes the page to reflow while it’s rendering the buttons.

Stops the options being shown and then immediately hiding on initial
page load.
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
8a01e6af36 Make it say later today
Categories before:

> Now, today, tomorrow, Friday…

Categories after:

> Now, later today, tomorrow Friday…

This reduces the ambiguity of ‘now’ vs ‘today’, and keeping the word
‘later’ suggests what this features is about.

This implementation here is a bit hacky, but it works…
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
a78d9d5048 Group choices for scheduling a job by day
The options for scheduling a job by time should be grouped by day,
because a long list of 96 options is not very usable.

On the server side, this commit generates label for the next 4 days in
a friendly format (ie today/tomorrow/Sunday/Monday)

The Javascript component for choosing a time was built in a kind of
old-school jQuery way, where it manipulated the elements on the page.
The complexity of introducing groups of options was just too much for
this pattern, because it involves storing a lot of state in the DOM.

This commit completely rewrites the JS to:

- read the initial options and groups from the HTML and store them
  in the object
- use Hogan to completely re-render the UI from a series of Mustache
  templates, each of which represents a state of the UI and takes the
  inital options and groups
- filter the choices to show when the today/tomorrow/… buttons are
  clicked
2016-10-31 09:14:05 +00:00
bandesz
df313ad3d4 Add minimal 404 page for Cloudfront 2016-10-27 13:13:49 +01:00
Imdad Ahad
2a2a733a41 Fix 500s when requesting json after logged out:
* Update permissions decorator to make sure user is logged in first, else 401
* Stop further ajax json calls on failure
2016-10-21 14:24:21 +01:00
Chris Hill-Scott
f561bfe603 Show expander arrow for all browsers
The polyfill we use for details/summary only renders the arrow if the
browser doesn’t natively support the feature.

The latest versions of Firefox _do_ now support the feature (after 5
years), but for some reason they don’t draw the arrow. So this commit
forces the arrow to be polyfilled in all browsers, and hides the browser
default one, for those browsers that do render it.
2016-10-12 15:55:53 +01:00
Chris Hill-Scott
c13f1aa5d1 Fix API log page in Firefox
The details of each notification were not being hidden on page load in
Firefox.

Firefox does not natively support the `<details>` element, so we
polyfill it.

Because of the way the polyfill is written[1]

1. There can’t be any `<div>` elements inside the `<summary>` (this
   commit changes them to be `<span>`s instead, and adds CSS to make
   sure they wrap as before)
2. The contents to be shown/hidden must be wrapped in a `<div>` (which
   this commit adds)

***

1. 48fde82c72/public/javascripts/govuk/details.polyfill.js (L90)
2016-10-12 15:28:38 +01:00