Commit graph

18 commits

Author SHA1 Message Date
Anton Khorev
3df14c5a40 Report deactivates_at as block read date 2025-01-07 13:19:33 +03:00
Anton Khorev
7e8fd5d7b7 Check deactivates_at to report if block was read after its end date 2025-01-06 21:10:18 +03:00
Anton Khorev
f7b0e87973 Remove "expired unread" short block status
It was supposed to mean that the block is past its end date but still wasn't read by the user. That turned out to be confusing because although it said "expired", such blocks were active.
2025-01-03 11:37:32 +03:00
Anton Khorev
156c526c22 Change block end column to display strictly ends_at
Could display when block was viewed before. That's going to be unintuitive if sorting by different times is introduced.
2024-12-04 10:48:03 +03:00
Anton Khorev
30da09c5a1 Rearrange data in blocks table to start/end/status columns 2024-12-04 10:48:03 +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
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Andy Allan
71be435886 Fix case when user block durations are slightly negative
The output from ActiveSupport::Duration is wildly unhelpful in those cases

Fixes #3210
2021-06-09 15:16:35 +01:00
Andy Allan
5ce14cfa4d Ensure that short duration blockss are shown as '0 hours'
Passing `:count => nil` means that i18n.t will return the hash of translations, so use a default value of 0 when checking for hours to prevent this.

Refs #3210
2021-06-09 14:17:56 +01:00
Andy Allan
847536c80d Avoid some uses of html_safe
We can use `html_safe` on non-interpolated strings, since that's trusted content.
2020-10-28 14:45:20 +01:00
Andy Allan
5e06815214 Use friendly_date_ago helper for user_blocks
Refs #2255

Removes two unused translations.
2019-06-19 18:04:08 +02:00
Andy Allan
90ac07d071 Allow user_blocks to be created for longer periods
This avoids admins from having to manually change end periods in the database
2019-05-15 11:30:28 +02:00
Andy Allan
a0de9b780d Use lazy lookups for user_blocks translations 2018-04-25 12:03:58 +08:00
Simon Poole
998a84a1b4 Small improvement to block status display 2017-02-18 18:08:25 +01:00
Tom Hughes
4676179879 Improve display of user block timestamps
Display the creation time, as a friendly date with a tooltip for
the exact time, and add a tooltip to the expiry time.

Fixes #923 and #996
2015-06-25 17:44:20 +01:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
34e3e51456 Cleanup trailing whitespace 2015-02-20 08:56:16 +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