Commit Graph

43 Commits

Author SHA1 Message Date
Javi Martín
45c1f93562 Add a link to skip to the main content
While people using screen readers already have keyboard shortcuts to
jump to the <main> tag, there are people who navigate the page with the
keyboard using just the tab key, and for them, this link provides a way
to save time and start reading the main content instead of having to
manually go through all the navigation links every time a new page is
loaded.

Note that we had to add an additional `width: 0` rule because
Foundation's `element-invisible` would apply `1px` and the test checking
for `visible: :hidden` would faile.
2024-03-23 00:35:47 +01:00
Javi Martín
2b962f2789 Use a <main> tag on every page
Many pages had this tag, but many other didn't, which made navigation
inconsistent for people using screen readers.

Note that there are slight changes in two pages:

* The homepage now includes the banner and the content of the
  `shared/header` element inside the <main> tag
* The budgets index now includes the banner inside the <main> tag

I see both potential advantages and disadvantages of this approach,
since banners aren't necessarily related to the main content of a page
but on the other hand they aren't the same across pages and people using
screen readers might accidentally skip them if they jump to the <main>
tag.

So I'm choosing the option that is easier to implement.

Note we're adding a `public-content` class to the <main> element in the
application layout. This might be redundat because the element could
already be accessed through the `.public main` selector, but this is
consistent with the `admin-content` class used in the admin section, and
without it the <main> element would sometimes have an empty class
attribute and we'd have to use `if content_for?(:main_class)` or
`tag.main` which IMHO makes the code less consistent.

The Capybara::DSL monkey-patch is only done on the `visit` method
because it's the only reliable one. Other methods like `click_link`
generate AJAX requests, so `expect(page).to have_css "main", count: 1`
might be executed before the AJAX request is finished, meaning it
wouldn't properly test anything.
2024-03-23 00:35:43 +01:00
Javi Martín
ad26c5cf9f Fix background images with special characters
Just like we did for budgets, we're doing the same thing in all the
places where we render background images attached by either regular
users or administrators.

This way we correctly render background images with characters like
brackets or quotes.
2023-06-27 15:06:30 +02:00
Javi Martín
44e3a393a0 Move navigation and footer partials to components
This way it'll be easier to decide when they should be rendered.

In order to be consistent, we're using the `Layout` module for both
components; previously, the navigation partial was in the `shared`
folder while the footer partial was in the `layout` folder, which IMHO
didn't make much sense.
2023-01-16 14:22:23 +01:00
Javi Martín
2c0ede3aaa Use the dir attribute in dashboard and mailer layouts
We forgot to do so in commit d827768c0. In order to avoid the same
mistake in the future, we're extracting a method to get these
attributes. We're also adding tests, since we didn't have any tests to
check that the `dir` attribute was properly set.
2022-11-11 01:39:29 +01:00
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
Javi Martín
d827768c07 Set HTML dir attribute in RTL languages
This way properties flex layouts text direction will work properly.
2021-08-16 17:47:34 +02:00
Javi Martín
bb2e2fa0a3 Move main <h1> tag inside main header
A <header> tag is the natural place to have headings.

Since we already had the logo there, IMHO it makes sense to merge both
the <h1> tag and the logo together. We were already doing so in the
devise layout.

From the sceen reader users' point of view, having a link with the text
"CONSUL logo" is a bit confusing, since it seems to imply the link will
get us to the CONSUL logo. Using the organization name as the text of
the link makes more sense.

One thing changes, though. Before this commit, the first thing on the
page a screen reader user would hear about would be the organization
name. Now the language selector and the top links are announced before
the organization name is read. That's fine, since the actual first thing
these users will hear is the content of the <title> tag, which contains
the organization name as well.
2020-11-23 18:05:43 +01:00
Javi Martín
d4a360c7fb Simplify main layout styles
We were using a "push" div in order to force the footer to the bottom,
and were using a wrapper with a minimum height and negative margins.

The same thing can be accomplished using flex and making the wrapper
fill the empty space, which in my humble opinion simplifies the code and
makes it easier to follow.

We could further simplify the code by removing the wrapper div or the
footer wrapper, although I'm not sure the benefits overcome potential
inconveniences caused to other institutions who might have custom styles
based on the existence of these wrappers.
2020-11-23 18:04:55 +01:00
Pierre Mesure
232e6c7f11 Replace old Spanish text with org name 2019-11-09 19:38:13 +01:00
Javi Martín
025923ac4e Set current locale as HTML language in all layouts
The same way it's done in the application layout. Not doing so causes
accessibility issues affecting screen reader users.
2019-10-25 15:34:40 +02:00
Javi Martín
89402bdbf6 Use raw instead of html_safe
They do the exact same thing; however `html_safe` might confuse
developers into thinking it will make the HTML safe. Using `raw` makes
it clear that we're inserting the text without escaping it.
2019-10-08 19:10:13 +02:00
Julian Herrero
4df9a1a1b4 Move HTML settings to content blocks settings page
- Rename html settings keys
- Show html settings next to content blocks page
- Hide html settings from configuration tab
2019-03-19 19:45:34 +01:00
Julian Herrero
25ed245689 Use double quotes in app/views/layouts 2019-03-19 12:16:50 +01:00
decabeza
a2bf8a85f4 Fixes logo header on devise layout 2018-07-31 18:08:09 +02:00
Javier Martín
6e4f697cea Extract partial with common <head> tags. 2018-06-24 02:43:59 +02:00
Amaia Castro
8143fe1037 Site customization: images uploads 2017-04-06 17:00:04 +02:00
Alberto Garcia Cabeza
508de35320 polishes forms styles on devise views 2017-01-09 19:10:15 +01:00
Alberto Garcia Cabeza
201a222cd3 improves styles for omniauth buttons 2017-01-09 18:49:29 +01:00
Alberto Garcia Cabeza
42d147a462 changes general styles for devise layout 2017-01-09 18:07:04 +01:00
Alberto Garcia Cabeza
d8b4af5add adds meta description and keywords 2016-12-30 17:17:46 +01:00
kikito
8bcbe86064 Refactor layout flash usage and move to a partial 2016-04-28 12:46:27 +02:00
Alberto Garcia Cabeza
08a17f3b0e Makes generic logos and avatars, and removes unused images 2016-04-21 14:05:30 +02:00
Alberto Garcia Cabeza
e181206054 Adds main tag on layouts 2016-03-14 19:32:49 +01:00
Alberto Garcia Cabeza
5615f19ba9 Fixes some classes for foundation 6 2016-02-29 13:52:31 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
Alberto Garcia Cabeza
3164fe7be1 Improves layout and footer for auth pages 2016-01-14 11:18:04 +01:00
Alberto Garcia Cabeza
8d12f61a45 Adds meta tags for IE 2015-10-14 16:14:07 +02:00
Alberto Garcia Cabeza
2ca4557f2d Improves accesibility 2015-10-13 16:48:37 +02:00
Alberto Garcia Cabeza
4a25cdc282 Fixes sticky footer on devise layout 2015-10-01 14:16:28 +02:00
Alberto Garcia Cabeza
738a64dcef Adds footer on devise layout 2015-09-28 13:46:54 +02:00
Alberto Garcia Cabeza
bf08cb582f Adds title on close alerts link 2015-09-28 13:46:54 +02:00
Alberto Garcia Cabeza
747c604127 Fixes styles for mobile version 2015-09-12 18:05:15 +02:00
Alberto Garcia Cabeza
96f8ea4415 Changes title and updates email header image 2015-09-07 09:22:52 +02:00
Alberto Garcia Cabeza
eedd919424 Improves styles and texts for devise pages 2015-09-07 00:16:54 +02:00
Álvaro Durán Tovar
92ae988251 adds close button to alert boxes, also adds
data-alert attribute to enable javascript
on them
2015-09-06 19:54:12 +02:00
Alberto Garcia Cabeza
22f579f376 Improves styles for auth pages mobile version 2015-09-05 00:31:19 +02:00
Alberto Garcia Cabeza
a75cbefe8d Styles for header,footer,filters, alerts and pages 2015-09-04 15:19:50 +02:00
rgarcia
137ca75055 adds favicon to other layouts 2015-09-02 22:34:16 +02:00
Alberto Garcia Cabeza
13fe1dcb9f Changes bg images, adds favicon and alerts styles 2015-08-29 00:33:40 +02:00
rgarcia
4839081ad2 uses simple_captcha instead of recaptcha [#51] 2015-08-10 20:24:56 +02:00
Alberto Garcia Cabeza
f9cb8151ff Adds styles for authentication pages 2015-08-06 20:53:14 +02:00
rgarcia
515d083633 use custom layout for devise controllers 2015-08-06 16:01:01 +02:00