Commit graph

43 commits

Author SHA1 Message Date
Andy Allan
8dc5de1a0f
Merge pull request #4646 from tomhughes/turbo-pagination
Use turbo for pagination
2024-08-21 19:12:31 +01:00
Tom Hughes
754a0a9cb5 Merge remote-tracking branch 'upstream/pull/5069' 2024-08-21 19:04:06 +01:00
Tom Hughes
edddaab122 Use turbo for pagination 2024-08-20 14:44:10 +01:00
Anton Khorev
6c4b028232 Record revokers when deactivating blocks by editing 2024-08-19 15:21:59 +03:00
Anton Khorev
cff4c63713 Add deactivates_at date to user blocks
Block deactivation dates that take needs_view-block views into account were derived using updated_at. This was possible because inactive blocks couldn't be edited and their updated_at date wouldn't change. With editing of inactive blocks enabled deactivation date needs to be saved explicitly.
2024-08-19 14:33:20 +03:00
Anton Khorev
cfaae9eadd Don't update ends_at when editing inactive blocks 2024-08-17 13:02:20 +03:00
Anton Khorev
323b7032ba Prevent reactivating inactive blocks 2024-08-15 12:59:49 +03:00
Anton Khorev
2764591a7d Allow revokers to edit revoked blocks 2024-07-26 03:38:27 +03:00
Anton Khorev
51708d6238 Allow to edit inactive blocks 2024-07-24 04:43:13 +03:00
Anton Khorev
134f9e2df1 Use before/after pagination on users page 2024-03-29 18:21:15 +03:00
Anton Khorev
366ffd9bd0 Add revoke all blocks action 2024-01-07 15:15:28 +03:00
Anton Khorev
3443533ce3 Add revoke all blocks page title 2024-01-07 15:15:28 +03:00
Anton Khorev
ba53dc7b04 Create an empty revoke all blocks page 2024-01-07 15:15:28 +03:00
Anton Khorev
8c32e63492 Set block ends_at to exactly created_at + duration 2023-12-27 06:48:00 +03:00
Anton Khorev
4ceebefefa Move user lookup and error render to concerns 2023-08-21 17:29:55 +03:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
mmd-osm
c49e400aa3 Prevent CSRF bypass unblocking users 2021-02-09 20:39:04 +00:00
Tom Hughes
c2af89c00e Fix rubocop Style/SoleNestedConditional warnings 2020-09-02 18:54:55 +01:00
Tom Hughes
ea59d95f4a Fix some new rubocop warnings 2020-08-06 22:27:30 +01:00
Andy Allan
368ce0000d Migrate UserBlocksController to use CanCanCan 2018-11-07 13:07:08 +01:00
Andy Allan
a0de9b780d Use lazy lookups for user_blocks translations 2018-04-25 12:03:58 +08:00
Andy Allan
7b2af50f4a Refactor @this_user to @user
Historically we used @user for the currently logged in user, but
this was changed to `current_user` in 2017.
2018-04-11 11:42:33 +08:00
Tom Hughes
1f2ac59d1d Fix new rubocop warnings 2018-03-26 19:00:03 +01:00
Andy Allan
d581f17665 Avoid using or comparing explicit model ids
The code is easier to read using higher-level concepts.
2017-10-22 21:58:09 +01:00
Andy Allan
6f89da05d1 Use current_user to represent the currently logged in user.
This is already used by the oauth plugin, and is a general rails convention.
2017-07-12 16:10:50 +01:00
Tom Hughes
fe1e28b4f4 Fix more parameter sanitisation issues and add tests 2017-06-29 20:52:57 +01:00
Tom Hughes
2af0840ff3 Fix style issues found by new rubocop version 2015-04-14 09:38:24 +01:00
Tom Hughes
dbe165bbb3 Fix some rubocop rails style issues 2015-02-26 00:12:54 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Tom Hughes
34e3e51456 Cleanup trailing whitespace 2015-02-20 08:56:16 +00:00
Tom Hughes
f0feca800d Replace attr_accessible with strong parameters 2013-09-21 11:35:46 +01:00
Matt Amos
851de28303 Added redactions resource 2012-04-05 13:50:15 +01:00
Tom Hughes
311f7ddd6e Factor out common code for looking up users 2012-03-21 22:22:33 +00:00
Tom Hughes
a9824dbc2e Use one "no_such_user" view everywhere 2012-03-21 21:47:09 +00:00
Tom Hughes
e1d873cde9 Add functional tests for user blocks
Also fixes various issues in the code discovered while writing
the tests, and adds some named routes for user blocks.
2012-03-19 11:26:02 +00:00
Tom Hughes
2351d02ed5 Fix mass assignment errors with user blocks 2012-03-09 23:15:39 +00:00
Tom Hughes
e23744bd8d Add :warning and :error flash messages which can be styled separately to
the existing :notice messages.

Also reviewd all existing flash messages and changed them to be errors or
warnings when appropriate and checked that those which are not followed by
a redirect are done as flash.now[] instead of flash[].
2009-11-01 13:07:46 +00:00
Matt Amos
1009788043 Fix wrong comment. 2009-10-02 10:46:19 +00:00
Matt Amos
77851bac7b Added better messages and error handling in a couple of places. Added integration checks to ensure that the blocking is actually working. Tests FTW. 2009-09-30 17:39:42 +00:00
Matt Amos
95c3d640a4 Tried to DRY the user_blocks controller. Moved the configuration of the blocking periods into application.yml. 2009-09-30 15:44:29 +00:00
Matt Amos
ca06b3c7b1 New migration to add better auditing to user_roles and better column names there and on user_blocks. Added a helper for displaying block status messages. 2009-09-29 16:44:03 +00:00
Matt Amos
daa2496024 First version of blocking feature. Allows both time-based (for map protection) and notice-based (for education) blocks on users. Also introduces user roles and a simple UI for displaying and administering these. 2009-09-28 16:01:00 +00:00