Commit Graph

22 Commits

Author SHA1 Message Date
Chris Hill-Scott
d9da219b7e Use a macro for form tags
This will stop us repeatedly forgetting to add `novalidate` and
`autocomplete='off'` to our forms (which is how most of them are set
up).

It uses sensible defaults, based on how we most-commonly configure
forms:
- most of our forms are `post`ed (but this can be overridden)
- `autocomplete` should only be enabled where it makes sense, otherwise
  it’s more annoying than useful (but this can be overriden)
- we should never be using HTML5 form validation because our own error
  styles and messages are better
2018-09-19 12:43:15 +01:00
Chris Hill-Scott
063f9cc081 Enable numeric keypad for text message code
If you’re signing in on a phone, it’s easier to type the two factor code
with a numeric keypad. The most reliable way to get the numeric keypad
to show up on multiple devices is:
- `type='tel'` (not `type='number'` because that’s only meant for
  numbers, not string of digits, ie `01234` is not a number)
- `pattern='[0-9]*'`, without which it doesn’t work on iOS

Based on the guidance here:
- https://github.com/alphagov/govuk-design-system-backlog/issues/74
- https://docs.google.com/document/d/1wozIhOdt6wvlgqVReauUnlsJI-3fqUlNuQFwUI7tqAA/edit
2018-05-08 10:55:42 +01:00
Chris Hill-Scott
57069e427d Add some letter spacing to two factor textbox
Entering, or reading back sequences of digits is easier when they’re a
bit more spaced out.

This is because we read words as shapes, but read numbers
digit-by-digit.

So this commit adjusts the tracking of the type to put a bit more space
in for textboxes that are going to accept digits.
2017-10-16 17:12:16 +01:00
Chris Hill-Scott
135ff1ee77 Include service name in page <title>
In pages specific to a service (e.g. dashboard and sub pages) the title
needs to distinguish which service it applies to. This is mainly to give
context to screen reader users who could be managing multiple services.

Implementing this uses template inheritance:

`page_title` includes `per_page_title` includes `service_page_title`

‘GOV.UK Notify’ is inserted into every page title.

Pages that set `service_page_title` get the service name inserted too.
2017-02-14 11:53:53 +00:00
Chris Hill-Scott
aa166856b4 Change 'verification code' to 'security code'
Extensive testing on Verify has shown that this is understood better.
2016-08-22 11:46:07 +01:00
Adam Shimali
56c3401a39 Requesting a resend of verify code for a user that has not completed
registration will allow user to check and modify mobile number.

Registered (active) users will only be able to request resend to their
existing registered number.
2016-06-13 16:31:54 +01:00
Chris Hill-Scott
c551fd43e0 Reword 2FA page to match email confirmation 2016-04-23 16:24:48 +01:00
Martyn Inglis
5429107f93 Removed remember me checkbox
- remember me functionality always applied.
2016-03-07 14:39:20 +00:00
Nicholas Staples
c959678c49 Remember me functionality added and tested.
Merge extra.

Fixed comment.
2016-02-24 17:32:15 +00:00
Chris Hill-Scott
382cfa2907 Make page titles consistent
This commit modifies the HTML `<title>` tags for all the pages. It makes two
main changes:
- make the title tag match the `<h1>` of the page, for better or worse
- put the service name after the page title, seperated by an en dash, as per
  GOV.UK
2016-02-08 09:23:51 +00:00
Chris Hill-Scott
2d1af953ed Add autofocus module to two factor page 2016-02-02 16:39:28 +00:00
Chris Hill-Scott
9767ee1511 Make two factor textbox consistent with verify textboxes
- make the field the same width (5em to match length of code)
- move ‘haven’t received…’ link underneath the textbox instead of underneath
  the button
2016-02-02 16:36:11 +00:00
Henry Hadlow
c4023bf0fb Make headings .heading-large instead of .heading-xlarge 2016-02-02 14:06:07 +00:00
Chris Hill-Scott
3f45dbf09d Replace tabs with two spaces for consistency 2016-02-01 16:57:29 +00:00
Chris Hill-Scott
9cf6dfa6f2 Tidy up inconsistencies in forms
Wherever possible, use the macros.
2016-02-01 16:55:46 +00:00
Chris Hill-Scott
2ef1057180 Make spacing and position of banners consistent
Banners should always be the first thing on the page.

Because headers already have padding we don’t want to put padding on the
container.

So banners should also have top padding to distance then from the red bar.

They should also sit in the 3/4 column if the page has side navigation. This
commit adds a new template (`withoutnav_template.html`) which extends
`admin_template.html`. All views then extend one or the other, never the
`admin_template.html` directly. This means that `admin_template.html` doesn’t
have to make decisions about where the flash messages are displayed.
2016-02-01 13:52:46 +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
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
Nicholas Staples
921c10a1fa Merge with master. 2016-01-06 10:55:45 +00:00
Nicholas Staples
0ebacd6929 Refactor for code_not_received, sign_in, two_factor and verify. 2016-01-05 17:08:50 +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 Hill-Scott
2f980ab622 Move all pages into their own directory
There are a lot of pages. It seems like a good idea to keep them in one place,
so they don’t get mixed up with partials and layouts.
2015-12-11 09:48:52 +00:00