Commit Graph

38 Commits

Author SHA1 Message Date
Chris Hill-Scott
4cb535a2e1 Add progressive enhancement to service switcher
- by default, the menu is open
- if Javascript is enabled/loaded, the links are hidden, and visual cues (▶) to
  show that it can be opened are added
- clicking it opens and closes it
2016-01-12 11:47:02 +00:00
Chris Hill-Scott
732efd25c7 Refactor markup
Strips it down to only what’s necessary

As a separate commit for easier diffing.
2016-01-12 11:47:02 +00:00
Chris Heathcote
8dbf266e87 Design showing opened service switcher 2016-01-12 11:47:02 +00:00
Chris Heathcote
6645f23def Remove dashboard title 2016-01-12 11:47:02 +00:00
Chris Heathcote
884e4e8057 Added in bar containing service name, user name/link to profile and sign out 2016-01-12 11:47:02 +00:00
Chris Hill-Scott
e8fe8c50ba Add a WTForms-compatible textbox macro
This macro:
- accepts a WTForm form field as a parameter
- renders a form field which follows the GOV.UK Elements patterns, both visually
  and in markup terms

It then changes any page which uses either:
- the old, non-WTForms macro or
- the old, WTFforms `render_field` macro

…to use this new macro and removes both of the old ones.

It also adds the option to display hint text above the textbox.
2016-01-11 15:20:00 +00:00
Chris Hill-Scott
85b0b4af21 Replace message_status component with banner
Message status was almost identical to banner, visually and semantically.
This consolidates the two into one component.

This means adding an extra parameter which controls whether or not the banner
has a tick (with and without a tick are the only two variations currently).
2016-01-11 14:27:31 +00:00
Rebecca Law
a860f713d2 Implementation of the new_password endpoint.
Found a way to create the token that does not need to persist it to the database.
This requires proper error messages, written by people who speak menglis good.
2016-01-11 12:23:07 +00:00
Chris Hill-Scott
4d10eec1e2 Rename submit_form component to page_footer
Submit form was
- a confusing name in itself
- not descriptive, because it also has an optional ‘back’ link

This commit also puts this component in as many pages as possible, stripping
out any hard-coded buttons and links.

It replaces any usage of buttons for ‘back’, because these are links, not
buttons (ie they don’t change any data).
2016-01-08 15:02:08 +00:00
Chris Hill-Scott
0b62d1e755 Add confirm loop
For pages where
- we want you to be sure that you want to do what you’re about to do
- we want to be sure it’s you trying to do the thing

This adds a page that asks the user to confirm their password.
2016-01-08 14:59:30 +00:00
Chris Hill-Scott
3989d1b576 Add pages for ‘service settings’ flow
Adds the pages and wires them together, so that it’s possible to click
through them.

The wording is not quite English, but attempts to be an rough description of
what the consequences are for each of the four actions.
2016-01-08 14:56:14 +00:00
Chris Hill-Scott
3ed415fb75 Enhance message textbox by styling placeholders
Users can add placeholders to their messages, eg

> …your vehicle ((registration number))

when the message is sent, this gets replaced with the data the user uploads, eg

> …your vehicle LC12 BFL

We reckon that it will be useful to see that the placeholder has been
recognised, ie that its syntax is correct, before uploading any data.

We reckon that the best way to do this is by styling it differently to the rest
of the text that the user types.

This is not a trivial problem. There are two possible ways to do it:

1 Write a Google Docs-style text rendering engine, which completely replaces
  the native HTML `<textarea>` with a custom control, and programme what should
  happen when the user types something that looks like a placeholder, or
  presses an arrow key, or makes a selection, or…
2 Leave the `<textarea>` in place, unmodified, and duplicate layers in front
  of/behind it to visually replace a placeholder with the blue lozenge

Unsurprisingly, this commit implements 2.

There are four layers. Each layer contains live-updated copy of the text in the
textbox, and each is styled differently:
- one layer behind the textbox to make the blue background
- the textbox itself
- a layer with the white text, which overlays the black text of the textbox
- a layer with an inner shadow to knock back the brackets

This is because of some interesting limitations:
- The text in the foreground and background must occupy the same physical space,
  so no deleting characters from the duplicated layers
- Words can’t be split up into multiple elements,
  eg `<span>((</span>regist…`:—this results in slightly different kerning to
  `((regis…`, which messes up the alignment of the layers
- The textbox can’t be completely overlapped with a block of colour, because
  the cursor disappears behind it. Trying to edit text when you can’t see the
  cursor is hard.

Implementation

Technically this makes use of Paul Hayes work on Javascript modules in the
GOV.UK frontend toolkit[1].

It also makes use of the `oninput` event to detect changes to the textbox’s
contents. This is much more performant than `onkeydown`, `onpaste`, etc. Without
it the delay between user input and the layers all updating is too slow and you
see misalignment of the layers.

1. https://github.com/alphagov/govuk_frontend_toolkit/pull/227
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
450c7aaeaa Remove log of activity from single notification
Having the full history of the message is more information than is necessary.
We should only show what stage the message is at, and the time that it reached
that stage.

We can do research later on to find out if users understand or care about the
different stages.
2016-01-05 13:31:54 +00:00
Chris Hill-Scott
d4a03a40c8 Add message history 2016-01-05 13:31:54 +00:00
Chris Hill-Scott
034c70bc97 Add a banner ✔ 2016-01-05 13:31:54 +00:00
Chris Hill-Scott
2acf599c04 Add big number component…
…and count the messages to display some totals
2016-01-05 13:31:53 +00:00
Chris Hill-Scott
aa0663cad8 Add messages to the current job’s history
This mocks out a data structure for a job’s messages, and renders this data:
- on the notification page, as a table, which links through to…
- …the page for an indidivual message
2016-01-05 13:31:53 +00:00
Chris Hill-Scott
6bdc0d3fce Tidy up navigation code
- use SASS variables for colours and spacing
- make navigation an include not a macro (because it doesn’t take any
  parameters)
2016-01-05 13:22:08 +00:00
Chris Hill-Scott
ab190cb585 Make navigation column 1/4 width 2016-01-05 13:22:08 +00:00
Chris Hill-Scott
5ebeec08ae Use a Node-based tools for handling assets
…or how to move a bunch of things from a bunch of different places into
`app/static`.

There are three main reasons not to use Flask Assets:
- It had some strange behaviour like only
- It was based on Ruby SASS, which is slower to get new features than libsass,
  and meant depending on Ruby, and having the SASS Gem globally installed—so
  you’re already out of being a ‘pure’ Python app
- Martyn and I have experience of doing it this way on Marketplace, and we’ve
  ironed out the initial rough patches

The specific technologies this introduces, all of which are Node-based:
- Gulp – like a Makefile written in Javascript
- NPM – package management, used for managing Gulp and its related dependencies
- Bower – also package management, and the only way I can think to have
  GOV.UK template as a proper dependency

…speaking of which, GOV.UK template is now a dependency. This means it can’t be
modified at all (eg to add a global `#content` wrapper), so every page now
inherits from a template that has this wrapper. But it also means that we have a
clean upgrade path when the template is modified.

Everything else (toolkit, elements) I’ve kept as submodules but moved them to a
more logical place (`app/assets` not `app/assets/stylesheets`, because they
contain more than just SASS/CSS).
2016-01-05 13:12:35 +00:00
Chris Heathcote
1ad5f7f8e6 Trialling 1/4 width nav 2015-12-15 13:48:23 +00:00
Chris Heathcote
8939f710a9 Move navigation into its own css file 2015-12-14 17:05:39 +00:00
Chris Heathcote
ec020a42f4 Initial nav & implementation on dashboard 2015-12-14 16:37:15 +00:00
Chris Hill-Scott
7ac08e9a85 Simplify check and send SMS page
This commit:
- removes the row numbering so it’s easier to scan the list of phone numbers
- adds subheadings for 'first three' and 'last three'
- puts the 'see all' link at the end
2015-12-11 17:27:26 +00:00
Chris Hill-Scott
c6a73c287a Improvements to send SMS page
- make messages align horizontally
- change wording of step 2 (from Lorena)
2015-12-11 14:32:43 +00:00
Chris Hill-Scott
d2562889b8 Replace CSV preview with rendered messages
If there are less than 7 messages, show them all.

If there are more than 7, show the first and last three, and a link to the
remaining x.
2015-12-11 14:02:42 +00:00
Chris Hill-Scott
4c14e273c2 Try out previewing messages 2015-12-11 12:02:21 +00:00
Chris Hill-Scott
64f03bed06 Make labels blocks, put next to message templates 2015-12-11 11:39:52 +00:00
Chris Hill-Scott
703eed3d36 Add 'back' button 2015-12-11 09:49:39 +00:00
Chris Hill-Scott
dbc55e76b0 Add table of recipients
Uses an adapted version of the 'summary table' pattern from Digital Marketplace
frontend toolkit:
http://alphagov.github.io/digitalmarketplace-frontend-toolkit/summary-table.html
2015-12-11 09:49:38 +00:00
Chris Hill-Scott
c4df25c8db Add a non-JS template picker
We could do something with Javascript to only show the selected template. For
now this is something that works without Javascript.

This means we can put off getting the build and testing pipeline for Javascript
set up, which is a bigger and more unknown piece of work.
2015-12-11 09:49:38 +00:00
Chris Hill-Scott
73ccea4d1f Add GOV.UK Elements as a submodule
Since GOV.UK Elements is versionned now it makes sense to bring it in as a
dependency. This enforces a separation between what generic stuff we’re using
from Elements and what is specific to our app.

The benefit is that when the generic stuff changes it will be easy to bring
those changes in.

This commit also bumps GOV.UK frontend toolkit to the latest version (v4.5.0).
2015-12-11 09:49:31 +00:00
Chris Hill-Scott
1f39a0fe61 Hard code some data in the Python
This commit adds some stubbed data for the pages. The structure of the data
is just a proposal, but it gives the templates something to work with for now.
2015-12-11 09:48:59 +00:00
Chris Hill-Scott
b46872d2b9 Add a template filter for message placeholders
As a first guess placeholders can be added to messages with the
`((placeholder))` syntax.

This commit adds a Jinja template filter to convert strings containing
said-formatted strings into HTML, which can then be styled to highlight which
parts will be substituted in messages.
2015-12-11 09:48:59 +00:00
Chris Hill-Scott
a5f4580a7f Get SASS compilation working
Main thing that was missing was including the main CSS file in the template.

There are a few hacky bits here, like moving the whole of toolkit inside the
stylesheets directory.

Would arguably be cleaner using something that isn’t Flask Assets, but that’s
something for later.
2015-12-11 09:48:59 +00:00
Chris Heathcote
da80013ec9 Adding beta phase banner 2015-12-03 16:01:00 +00:00
Chris Heathcote
701ce482d4 Create base forms for registration and sign in
Created routes and forms for registration, sign in, and registration
from an invite.
Also tidied up assets folder, removed copy of fronted toolkit.
2015-11-26 10:18:37 +00:00
Rebecca Law
11d79951f3 Moved the templates into the app directory.
Added Manager to the app.py
2015-11-23 16:07:19 +00:00