The yes/no pattern didn’t work too well, because:
- it didn’t read naturally as a question and answer
- often users left them completely unclicked if they didn’t want to set
the permission (rather than clicking no)
This commit changes both the invite and edit user pages to use
checkboxes to set permissions. If also rewords these pages to read more
naturally, and explain what the permissions mean.
This meant changing some of the view logic around invites and
persmissions, and I ended up refactoring a bunch of it because I found
it hard to understand what was going on.
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.
There are now quite a few frontend components in the app.
It’s good to have a reference for them to:
- document for developers what patterns are available and how they are used
- check for regressions
- when working on one variation of a pattern you can check that your changes
don’t break other variations of it
- when changing the arguments to a pattern you can check that this doesn’t
change the expected arguments already in use
This commit adds a single page (`/_styleguide`) which has examples of all the
patterns.