Commit graph

69 commits

Author SHA1 Message Date
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
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
Thomas Levine
d2a43c7e4a Standardize submit tags 2013-07-08 09:03:17 +01:00
Tom Hughes
1f7dd79daf Fix lists in rich text to display properly
Add a "richtext" class to anything which contains text rendered
by our rich text library, and move styles which were only being
applied to diary entries to apply to all rich text.
2013-01-24 14:54:26 +00:00
Saman Bemel-Benrud
a36f3558dd Site cleanup
I set out to do a quick and dirty typography overhaul to make things
more consistent and a bit cleaner, but I kept running into things I
didn't like, so this lead me down something of a rabbit hole of design
tweaks to the OSM site.

Goals here are to have better content hierarchy, better vertical
rhythm, more consistent UI, cleaner markup with less tables, all while
keeping the basics pretty much intact. There are a lot of things I
didn't touch even though they need to be updated (lots of tables where
stuff shouldn't be tables, mostly).

Basic overview of changes:

I added a new persistent header that helps segment pages. It's now
a lot easier to know what you're looking at. The header has a page
title, a description, plus a submenu of actions.

There is now a pattern of 20px/10px margins and padding for more
rhythm and breathing room throughout the site.

I know there are other problems here or things I've missed - would
love another set of eyes to look over this! I am still getting comfortable
working on the site - it's my first time ever digging into a ruby or rails
so I'm not familiar with the templating language yet.
2013-01-14 21:27:08 +00:00
Tom Hughes
78ff250c1d Add a paging control to the user blocks list 2012-07-18 21:36:40 +01:00
Tom Hughes
359371b31c Handle reason as a rich text area when editing a block 2012-03-19 11:24:47 +00:00
Tom Hughes
561f2f694a Add preview functionality to rich text controls 2012-03-17 16:36:57 +00:00
Tom Hughes
aa4205482a Treat all newly entered blocks of text as Markdown 2012-03-17 16:36:55 +00:00
Tom Hughes
e23313fbd4 Don't escape the heading as it contains a link 2012-03-09 23:15:40 +00:00
Tom Hughes
58d889436f Fix various routing and route generation errors 2012-03-09 23:15:39 +00:00
Tom Hughes
5718d455bc Don't escape the heading on a user block 2011-11-23 00:11:51 +00:00
Tom Hughes
4ab734ee1b Fixed escaping in title 2011-11-17 11:03:27 +00:00
Tom Hughes
bca0d5873b Removed bogus characters from form_for 2011-11-17 11:02:42 +00:00
Tom Hughes
22594361d5 Mark some strings that shouldn't be escaped as raw 2011-11-14 09:42:41 +00:00