This PR allows users to delete their own accounts. The logic implemented matches
that currently used by the admins when they manually close accounts, although
there is room to be more complex in future e.g. completely removing accounts
with no content.
The error handling has been slightly adapted for namespaced controllers, by
anchoring the controller name with a leading forward slash.
Login may redirect to ouath2_authorizations#create which may then
redirect to arbitrary schemes if the application is already authorized
so we need to allow login to redirect to any scheme.
Fixes#3424
The user status is a bit complex, since there are various states and
not all transitions between them make sense.
Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
Without the ability defined, the user is still logged out, but then
the deny_access check redirects to the login page. The re-login attempt
would then fail anyway, with an error message, but let's fix the abilities
and use the intended page.
This allows rails to set the created_at automatically, and so avoids
us from having to do so in a callback. It also hides the unusual
db column name from the rest of the app.
"delete" is generally used for immediate SQL deletion without running
any callbacks or other ruby code, whereas "destroy" will trigger callbacks.
Although we don't currently use any callbacks, let's rename this method to
align better with the convention.
Because we are using an edge-to-edge layout for the flash messages,
the negative margins on the row were expanding the element offscreen.
Bootstrap provides a "no-gutter" class for removing these margins,
but that also drops the spacing between columns which we want to preserve.
So instead we use a margin override on the row only.
Additionally, drop some padding css in favour of a utility class
Fixes#3351
Bug was introduced in 3dd639c8d0
This avoids needing any floats. Also remove buttons class from two
locations, since there is a min-width on that class and it affects
the button styling negatively for standalone buttons
This makes future refactoring easier, since the elements will
retain their borders even if the hierarchy changes.
Also round some maps and the legale section since I think those now
look nicer.
This overrides the same variable from bootstrap. Since bootstrap
also comes with -sm and -lg variants defined by rem, our px-based
override doesn't sit nicely with those.
Fixes#3369
This makes the heading match the layout of the user's Notes page,
which also has a short heading and a subheading with a link.
Additionally, add a page title, again for consistency