Commit Graph

136 Commits

Author SHA1 Message Date
Adam Shimali
1d038c1021 Better page title 2016-01-08 09:44:00 +00:00
Adam Shimali
d64e3b81fb Add basic error pages 2016-01-07 15:54:05 +00:00
Nicholas Staples
7001d8261d Fix for security hole with setting session['user_id'] before second factor of authentication has been authorised. 2016-01-07 12:43:10 +00:00
Nicholas Staples
0a4ea6ca2e Merge branch 'master' into provide_logout_link 2016-01-06 17:06:04 +00:00
Nicholas Staples
5905229714 Logout functionality and test added. 2016-01-06 16:40:38 +00:00
Nicholas Staples
6fc39d1814 Add in macro import to our template, not govuk_template 2016-01-06 11:37:59 +00:00
Nicholas Staples
921c10a1fa Merge with master. 2016-01-06 10:55:45 +00:00
Nicholas Staples
f2732eed14 Added back in span element in form. 2016-01-06 10:22:36 +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
ba48707371 Add routing and pages for managing templates
So that users can see what it the flow is like to:
- add new templates
- edit existing templates
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
5e0777b696 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-06 09:39:42 +00:00
Nicholas Staples
0ebacd6929 Refactor for code_not_received, sign_in, two_factor and verify. 2016-01-05 17:08:50 +00:00
Nicholas Staples
1f520116f0 Sign in view, form and template refactored. 2016-01-05 14:30:06 +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
cad5698754 Add big numbers to dashboard
A suggestion of what high-level information users might need on the dashboard
page.
2016-01-05 13:31:54 +00:00
Chris Hill-Scott
31e6e53d46 Make data consistent from dashboard -> job
- adds a table of recent activity to the job page, which is shared by the
  dashboard page
- uses the same filename and message template as the first job shown on the
  dashboard
- sets the time of file uploads/message delivery/message sending to always
  match ‘just now’
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
Nicholas Staples
7693ba8a18 Update register view form and template. 2016-01-05 12:41:20 +00:00
Rebecca Law
785c413cde Move and rename macro.html
Remove print statements
Fix code style
2016-01-04 15:50:26 +00:00
Rebecca Law
ac05f6931e Refactor add-service form such that the dao is not exposed in the forms. 2016-01-04 15:31:50 +00:00
Rebecca Law
b2f544a165 110880218: Completed implementation of resend the verificaton code 2015-12-31 13:16:59 +00:00
Rebecca Law
64812c1614 109898688: All codes are valid until one code is used, then they are all marked used.
Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active.
There is still a problem with the validate_sms_code and validate_email_code method.
2015-12-17 14:33:20 +00:00
Rebecca Law
bd8bb3c926 109898688: Implementation of text-not-received and email-not-received 2015-12-17 14:33:20 +00:00
Pete Herlihy
7ddf2b0a9c Updated direct URLs to method ones 2015-12-16 14:12:24 +00:00
Pete Herlihy
a7e6fc340a Added some data and links to the dashboard to give it a 'flavour' 2015-12-16 13:51:46 +00:00
Pete Herlihy
a534441fa0 Merge pull request #30 from alphagov/new-nav
Create side navigation for logged in pages
2015-12-15 15:17:25 +00:00
Chris Heathcote
6fa29e769d Rolling back to thirds 2015-12-15 13:57:19 +00:00
Chris Heathcote
1ad5f7f8e6 Trialling 1/4 width nav 2015-12-15 13:48:23 +00:00
Chris Heathcote
17850dc170 Changed nav urls to be url_fors 2015-12-15 10:52:24 +00:00
Rebecca Law
23b5cffbe8 110067722: Update template with the form. 2015-12-15 10:32:26 +00:00
Chris Heathcote
89189f2e35 Add URLs to main nav; add user profile to nav 2015-12-14 16:58:43 +00:00
Chris Heathcote
15c9269a80 Added main nav to logged in pages 2015-12-14 16:53:07 +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
8a34fa7e0a Use Flask for routing
This commit:
- replaces links that look like buttons with forms and submit buttons
- splits the view code for SMS into its own file
- moves the routing into the Python by adding handling for `post` requests
- uses Flask’s `url_for` to generate URLs, rather than hard coding them (so that
  it’s easier to change the URLs)
- chages the URLs for sending text messages
2015-12-11 09:49:38 +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