Commit graph

83 commits

Author SHA1 Message Date
Anton Khorev
23a4adaa91 Add block tab to show block pages 2024-04-08 13:26:38 +03:00
Anton Khorev
5273b43578 Add "Blocks by user" nav tab to block list/show pages 2024-04-03 13:05:48 +03:00
Anton Khorev
031dc0fe1b Add "Blocks on user" nav tab to block list/show pages 2024-04-03 12:17:01 +03:00
Anton Khorev
1861bcf640 Add "Blocks by Me" nav tab to block list/show pages 2024-04-03 11:51:52 +03:00
Anton Khorev
288b8e1104 Add "Blocks on Me" nav tab to block list/show pages 2024-04-03 11:42:21 +03:00
Anton Khorev
a57472d282 Add "All Blocks" nav tab to block list/show pages 2024-04-03 11:31:06 +03:00
Anton Khorev
2a9888a642 Change revoke block buttons to danger style
Because revoke buttons on block show pages are also danger buttons.
2024-04-02 18:39:35 +03:00
Anton Khorev
47b4b51e08 Move edit/revoke block buttons to the bottom 2024-04-02 18:39:35 +03: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
1ff7b6217a Add controls to revoke all blocks page 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
Andy Allan
bc9c492c48 Use friendly_date helpers for revoking user blocks 2023-11-15 19:44:10 +00:00
Andy Allan
934d81aa55 Bootstrap 5: Replace all form-group classes with mb-3 2022-07-20 14:42:57 +01:00
Andy Allan
e80d74ae73 Bootstrap 5: Add form-label class to hand-crafted form labels
This is done automatically for forms created by bootstrap_form
2022-07-20 14:41:56 +01:00
Andy Allan
02a6ec60ec Bootstrap 5: Update manual select boxes to use form-select class 2022-07-20 14:41:55 +01:00
Harry Wood
80c639a6b5 Add newline to align with blocks_by
`blocks_on.html.erb` is almost identical to `block_by.html.erb`. Add a newline to align with the other file (makes it easier to see the more subtle important difference)
2022-03-05 02:45:50 +00:00
Tom Hughes
29e9857145 Improve behaviour of secondary action lists when wrapping
Based on https://stackoverflow.com/a/31732902 this ensure that when
a secondary action list wraps the additional lines don't start with
an item delimiter by pushing it to the left, outside of a parent nav
element which then hides it.
2021-08-21 15:38:00 +01:00
Andy Allan
536dee8fc7 Use named paths for various user blocks links 2021-08-12 17:57:40 +01:00
Tom Hughes
e842c7be97 Add missing autocomplete attributes 2021-07-27 19:36:47 +01:00
Tom Hughes
2c5e981684 Fix erblint warnings 2021-06-05 07:40:55 +01:00
Andy Allan
2955fe4d4b Refactor user blocks information to use a dl
This also standardises the labels to have the colon, in common with
oauth_clients#show.
2021-04-28 17:28:30 +01:00
Andy Allan
02bfc46ab3 Move duration to its own line, so that it can be clearly labelled 2021-04-28 16:01:03 +01:00
polarbearing
b4e2f8e34f
Show the crafted duration of a block independent of the reading time
Fixes #3143.
Not tested by myself. Treat like pseudocode, I don't speak Ruby.
2021-03-23 12:37:14 +01:00
Andy Allan
fd6273cfb8 Refactor user_blocks revoke form to use bootstrap 2021-02-03 13:44:52 +00:00
Andy Allan
e94a8a45ba Refactor user_blocks form to use bootstrap
Further refactoring could involve a virtual attribute for duration.
2021-01-14 10:03:11 +00:00
Tobias Jordans
b470e01f84 Break long URLs where richtext is used.
For example on the blog post show page.

This uses https://getbootstrap.com/docs/4.4/utilities/text/#word-break to break long URLs on the blog post show view.
2020-12-27 22:11:36 +01:00
Andy Allan
627f2493fa Refactor away from global form control styling
This enables forms to be converted one-by-one to bootstrap. Without this
refactoring, these global styles interfere with form control styling from
bootstrap.

The rearrangement of the search and directions styling is to solve CSS selector specitivity issues.
2020-07-01 17:23:02 +02:00
Andy Allan
b8c1bbb4f8 Remove unnecessary h() calls on model attributes
These were necessary in the rails 2.x era, but not now.
2020-03-18 14:33:30 +01:00
Andy Allan
5fdada204c Use bootstrap table striping to replace hand-cycled table stripes
This cuts down on the complexity of having to use the `cycle` function
and makes the templates easier to read. CSS-based striping has been
around for many years.

The CSS is in order to keep our custom colour for striped tables.
2020-03-18 12:14:24 +01:00
Tom Hughes
1c062165f6 Avoid double escaping a name 2020-01-09 11:05:08 +00:00
Andy Allan
bff3676d93 Avoid double-escaping display names when sent through the translation system
They are escaped properly without the h() call, and doing that just double-escapes them
2020-01-08 19:07:18 +01:00
Andy Allan
217f616630 Use _html suffix to avoid using raw when displaying translated strings
This is safer than raw, since any user input is still escaped.
2019-12-20 14:32:00 +01:00
Andy Allan
13f0591605 Wrap table header rows in thead 2019-12-11 17:22:23 +01:00
Andy Allan
fb709531ba Convert various moderator? tests to use cancancan permissions checks 2019-10-23 11:26:16 +02:00
Andy Allan
e5d8bd539f Use friendly_date_ago for user blocks
Refs #2255
2019-06-19 18:04:08 +02:00
Andy Allan
54e0c7afb2 Use distance_in_words_ago scope for user blocks
Refs #2255
2019-06-19 18:04:08 +02:00
Andy Allan
97ff32f528 Use built-in form sumbit translation keys for user blocks 2019-06-12 16:07:18 +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
Tom Hughes
7cd7354673 erblint: prefer symbolic logical operators over and/or/not 2019-03-27 18:47:51 +00:00
Tom Hughes
3af16f6337 erblint: fix remaining single quoted strings 2019-03-27 16:15:19 +00:00
Andy Allan
74b91c0e3e erblint: Add or remove curly braces around hash parameters as required 2019-03-27 10:30:48 +01:00
Andy Allan
aa9e9a5eb1 Whitespace fixes for user_blocks erb files 2019-03-26 20:23:35 +00:00
Andy Allan
a0de9b780d Use lazy lookups for user_blocks translations 2018-04-25 12:03:58 +08:00
Andy Allan
736ff9b1a0 Use lazy translation lookups for the user_blocks partials. 2018-04-18 14:20:41 +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
Andy Allan
9f84c6f46e Use user_path links. Fixes #1785 2018-03-21 11:33:45 +08:00
Andy Allan
c819bec8b7 Use a current_user helper for accessing the logged in user in all views. 2017-07-27 10:07:51 +01:00
Tom Hughes
fe1e28b4f4 Fix more parameter sanitisation issues and add tests 2017-06-29 20:52:57 +01:00