Commit graph

53 commits

Author SHA1 Message Date
Anton Khorev
ff0569829f Don't update deactivates_at if block was already viewed 2024-11-13 01:41:11 +03:00
Tom Hughes
fb6042e35c Avoid adjusting time by a number of days
Using hours instead of days avoids test failures when moving
past a point in time when the clocks change.
2024-10-25 19:30:27 +01:00
Anton Khorev
258104dfdf Remove revoke block action 2024-08-23 13:34:08 +03:00
Anton Khorev
cc2a72bdd7 Remove revoke block pages 2024-08-23 13:23:29 +03:00
Anton Khorev
3a8b8af53b Stop testing revoke block buttons 2024-08-23 12:55:20 +03:00
Anton Khorev
76736bab4f Change submit button on block edit page when can only revoke 2024-08-22 14:01:54 +03:00
Anton Khorev
11a7bf7e0e Remove duration controls for blocks that can only be revoked by editing 2024-08-22 14:01:54 +03:00
Anton Khorev
5e7ab68721 Let all moderators revoke blocks by editing 2024-08-22 14:01:54 +03:00
Anton Khorev
67a5809c8a Show edit buttons on active blocks to all moderators 2024-08-22 14:01:54 +03:00
Tom Hughes
754a0a9cb5 Merge remote-tracking branch 'upstream/pull/5069' 2024-08-21 19:04:06 +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
Tom Hughes
71d459c71c Merge remote-tracking branch 'upstream/pull/5091' 2024-08-18 11:59:42 +01:00
Anton Khorev
1e62ae4b18 Remove /user_blocks/new route 2024-08-17 14:03:27 +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
6f5167b866 Don't order by id when getting last records 2024-08-07 05:08:27 +03:00
Anton Khorev
5e0cf6b0ce Move check_block_buttons method to other private methods 2024-07-26 03:42:11 +03:00
Anton Khorev
2764591a7d Allow revokers to edit revoked blocks 2024-07-26 03:38:27 +03:00
Anton Khorev
d88cb014cb Show edit links for revoked blocks to revokers 2024-07-25 04:05:31 +03:00
Anton Khorev
6ec1947e90 Show edit links for inactive blocks on block pages 2024-07-24 04:55:59 +03:00
Anton Khorev
d750cc3e80 Show edit links for inactive blocks in block lists 2024-07-24 04:44:59 +03:00
Anton Khorev
51708d6238 Allow to edit inactive blocks 2024-07-24 04:43:13 +03:00
Anton Khorev
a3282b8542 Select closest value to remaining duration when editing a block 2024-07-22 18:58:43 +03:00
Tom Hughes
e3c43e4a1a Add validation for before/after parameters to pagination concern 2024-04-11 10:08:20 +01:00
Anton Khorev
134f9e2df1 Use before/after pagination on users page 2024-03-29 18:21:15 +03:00
Anton Khorev
8557179976 Simplify link_to user calls on block pages 2024-03-20 04:27:58 +03:00
Anton Khorev
fa00a38664 Shorten user path helper calls in tests 2024-03-19 07:07:00 +03:00
Anton Khorev
0b901889da Count only tbody rows when testing tables 2024-03-18 01:31:12 +03:00
Anton Khorev
bde2faac58 Remove assert_response when followed by assert_redirected_to 2024-03-03 10:56:50 +03:00
Anton Khorev
366ffd9bd0 Add revoke all blocks action 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
8682b58154 Add revoke all blocks link 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
Tom Hughes
e8af4b85bf Fix new rubocop warnings 2023-09-26 18:42:57 +01: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
f75eb6fe9e Refactor more controller tests 2020-04-27 22:24:28 +01:00
Tom Hughes
7a1615bc55 Fix rubocop-minitest warnings 2020-04-15 19:07:13 +01:00
Tom Hughes
ccdec3ed4c Attempt to send pretty 403 errors to web browsers 2018-11-08 19:09:56 +00:00
Andy Allan
368ce0000d Migrate UserBlocksController to use CanCanCan 2018-11-07 13:07:08 +01:00
Andy Allan
3ec67ea2d3 Rename user_controller to users_controller 2018-10-03 15:31:10 +02:00
Andy Allan
100babbe6c Just pass the object, rather than the id, to _path methods where possible 2018-09-10 11:09:30 +08:00
Tom Hughes
fe1e28b4f4 Fix more parameter sanitisation issues and add tests 2017-06-29 20:52:57 +01:00
Tom Hughes
03408b6294 Update get/post etc to remove use of deprecated syntax 2017-06-27 08:26:44 +01:00
Andy Allan
86822ea225 Remove remaining references to fixtures. 2017-06-01 11:00:50 +01:00
Andy Allan
02f7fb96e5 Use users factory for user_blocks_controller tests. 2017-03-05 16:34:59 +00:00
Andy Allan
23c3168c55 Replace user_blocks fixture with a factory.
Traits are used here to make the tests easier to read, and the
different traits can be combined where necessary.
2016-10-19 10:57:40 +01:00
Tom Hughes
081ac24295 Fix rubocop warnings 2015-11-19 21:41:33 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00