Commit graph

249 commits

Author SHA1 Message Date
Andy Allan
c8f0a81eb7 Rework sidebar to use padding on the sidebar_content div
This saves every header, list, paragraph etc having to sort out their own padding. The couple of instances where we want edge-to-edge can be acheived using the negative margin spacing utilities.

The padding is based on $spacer so that it can be adjusted automatically via bootstrap configuration.

This also means that we can remove many (mis-)uses of the browse-section class, which is only supposed to be for cases where there are multiple browse-sections in sequence (e.g. multiple nodes in the node history browse pages).
2021-06-16 15:45:58 +01:00
Tom Hughes
f064a18a16 Add tests for OAuth2 2021-05-18 12:05:33 +01:00
Andy Allan
094d6c8bb9 Move confirmation methods into ConfirmationsController 2021-04-07 16:05:32 +01:00
Andy Allan
f18baae22e Refactor login/logout into sessions controller
Certain controller methods are shared with oauth-based logins, and these have been
moved to a concern.
2021-03-24 11:32:46 +00:00
Tom Hughes
3512d6303c Fix new rubocop warnings 2021-03-23 19:48:13 +00:00
Andy Allan
38ad8fbc36 Use login_path instead of explicit controller and actions
This makes future refactoring easier.
2021-03-10 14:31:55 +00:00
Tom Hughes
1f136a84a6 Prevent CSRF bypass with login form 2021-02-10 20:39:23 +00:00
Tom Hughes
5912a8011b Update to Omniauth 2.x
This requires converting all use of the /auth endpoints
to use the POST method as GET is no longer supported.
2021-02-02 19:49:03 +00:00
Andy Allan
cc8bb7c6a5 Refactor user registration form to use bootstrap 2021-01-20 15:38:10 +00:00
Andy Allan
da2277505f Ensure that test utility methods are marked as private
This allows us to enable the check for test method names.
2020-10-28 11:49:01 +01:00
Andy Allan
86a5e198f7 Refactor test to use general basic_authorization_header method
There's no need for this test to have its own version of the method.
2020-10-28 11:33:51 +01:00
Tom Hughes
abca51e4d8 Fix some Style/StringConcatenation warnings 2020-08-09 19:48:16 +01:00
Tom Hughes
75e135869e Fix Style/ExplicitBlockArgument warnings 2020-08-09 19:06:04 +01:00
Tom Hughes
2d3972249c Fix some rubocop todos 2020-08-02 19:38:58 +01:00
Tom Hughes
bf22c69286 Improve locale selection algorithm
Don't include locales which only have rails translations in
the candidates, and ensure that user specified options take
priority over less specific variants of earlier choices.
2020-06-04 17:33:11 +01:00
Tom Hughes
6f342c7616 Switch oauth integration tests to use new shared helper 2020-05-05 18:04:48 +01:00
Andy Allan
f885cfe0f5 Rename form-row to standard-form-row to avoid clashing with a bootstrap class 2020-01-15 17:16:11 +01:00
Tom Hughes
473da378b7 Remove fallback to hostip.info
We haven't used hostip.info in production for years, except
for when we did so by accident, leading to a two hour partial
outage when it went down.
2020-01-06 19:14:12 +00:00
Andy Allan
c4c1f8ded3 Reformat params hashes to avoid super-long lines 2019-12-18 15:58:37 +01:00
Andy Allan
7595e5a4dd Use squiggly heredocs instead of rails strip_heredoc
Squiggly heredocs were introduced in ruby 2.3 and I prefer the ability
to indent the closing heredoc marker.
2019-12-11 10:54:19 +01:00
Tom Hughes
1f4d48eaf3 Fix some deprecation warnings 2019-11-24 11:05:02 +00:00
Andy Allan
b7893df84e Refactor diary entries to use create and update methods
This brings it slightly more into line with resourceful routing.
2019-05-29 15:37:23 +02:00
Simon Poole
b89e6c2274 Update user_creation_test for new parameter 2019-05-13 16:54:29 +02:00
Simon Poole
e30813bbb1 Rubocop fixes and increase per method complexity limit from 23 to 25 2019-05-13 16:54:29 +02:00
Simon Poole
51c84869c4 Fix tests for change in users_controller, add test for missing read_tou 2019-05-13 16:54:29 +02:00
Tom Hughes
9e759dc030 Expect CORS preflight responses to not have a content type
https://github.com/cyu/rack-cors/pull/180
2019-03-28 08:45:58 +00:00
Andy Allan
d102c9aaf4 Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Tom Hughes
d2ff1491b4 Avoid CSP issues with OpenID login
To avoid Chrom getting upset about sending form data to sites
that our policy doesn't allow, even when it isn't, use Javascript
to jump straight to Omniauth as the direct OpenID based login
buttons were already doing.

Fixes #1909
2019-02-25 11:46:12 +00:00
Andy Allan
35a2d66e19 Remove require_terms_agreed configuration option
This has been set to true for 6 years in production. Refs #2097

As per other user settings, we set the terms as seen by default for tests,
and we can override that when necessary for specific tests.
2019-02-06 15:50:57 +01:00
Andy Allan
3795da4014 Remove the require_terms_seen configuration option
This option has been set to 'true' for over six years in production.

Refs #2097
2019-02-06 14:54:56 +01:00
Andy Allan
ed8e15c8f0 Remove user_roles integration test since it is not meaningful
This test has not been meaningful for a long while, since both check_success and check_fail contain exactly the same code.

Additionally, the test doesn't cover any integrations (beyond logging in), and so it is only covering the same ground as the controller test.
2018-11-28 17:22:31 +01:00
Andy Allan
252b9ef08a Pluralize changesets controller 2018-11-14 10:34:28 +01:00
Andy Allan
26777c4464 Pluralize diary entries controller 2018-11-07 16:31:04 +01:00
Andy Allan
b54362d458 Use deliver_later for all email sending 2018-10-31 16:38:12 +01:00
Andy Allan
3ec67ea2d3 Rename user_controller to users_controller 2018-10-03 15:31:10 +02:00
Wil
a182820139 Resolve 96 Rubocop Lint/AmbiguousRegexpLiteral conflicts 2018-09-10 11:28:16 +08:00
Andy Allan
19c26e70a3 Rename user#view to user#show 2018-09-05 14:21:01 +08:00
Tom Hughes
cb3c4ec09b Update for rubocop 0.54.0 2018-05-17 19:39:25 +01:00
Andy Allan
e1c62f1bf2 Remove if_user and similar methods
Rather than hiding features based on CSS, just avoid including them
in the output. Fixes #1862
2018-05-16 13:05:20 +08:00
Tom Hughes
b590fdccfc Fix rubocop warnings 2018-01-24 14:37:37 +00:00
Tom Hughes
4e9144fba2 Add support for compressed request bodies 2018-01-24 14:25:02 +00:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Tom Hughes
8c513beec6 Update rack-cors and fix tests for changes in behaviour 2017-07-31 21:55:01 +01:00
Tom Hughes
4874219ab8 Mark account suspended flash message as HTML safe
Fixes #1590
2017-07-19 00:31:03 +01:00
Tom Hughes
3893fd72a9 Fix some tests for changes in rails 5 2017-06-27 08:26:44 +01:00
Tom Hughes
03408b6294 Update get/post etc to remove use of deprecated syntax 2017-06-27 08:26:44 +01:00
Tom Hughes
07673278f1 Remove deprecated get_via_direct and post_via_redirect methods 2017-06-06 00:03:39 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
95eda2d381 Update bundle 2017-06-02 00:08:30 +01:00