Commit Graph

21 Commits

Author SHA1 Message Date
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
Senén Rodero Rodríguez
e4cd02c6a9 Extract proposals geozones to a component 2023-06-19 11:15:37 +02:00
Javi Martín
1a902a9671 Use polymorphic_path instead of taggables_path
We forgot to make this change when we started using "resolve" to
generate polymorphic nested resources.

The taggables_path method can be replaced with the polymorphic_path of a
class. It even works with nested resources, given the current page
already has the nested resources params (in this case, `budget_id` for
investments).
2021-01-09 14:17:21 +01:00
Julian Herrero
7fe6285fe3 Use double quotes in app/views/proposals 2019-03-19 12:16:50 +01:00
decabeza
6c5513ab38 replaces back_link partial to back_link_to helper 2017-07-26 18:22:45 +02:00
Alberto Garcia Cabeza
5c1e1f96ea deletes unused wrap class 2016-10-25 16:23:45 +02:00
rgarcia
9e910a834b Displays badge for official positions 2016-06-20 21:37:25 +02:00
Alberto Garcia Cabeza
7320d17bea Moves back links inside a partial 2016-04-26 13:04:57 +02:00
Alberto Garcia Cabeza
cb4ea3f540 Improves styles for investment project share 2016-03-31 10:53:21 +02:00
Alberto Garcia Cabeza
3ec0971b37 Replaces icons i tags for span 2016-03-14 19:32:48 +01:00
Alberto Garcia Cabeza
97db98fd3e Removes html role attributes 2016-03-14 19:31:15 +01:00
Alberto Garcia Cabeza
84f044c131 Improves website accessibility 2016-03-08 14:00:06 +01:00
rgarcia
a4ff3c6a6d displays categories and districts correctly capitalized 2016-02-19 18:21:45 +01:00
rgarcia
9a767caa27 avoids duplicate categories 2016-02-17 20:07:28 +01:00
rgarcia
d6e3cb5520 displays proposal summary instead of description 2016-02-17 19:52:45 +01:00
rgarcia
f730d7f0d6 removes shadow effect in proposal description 2016-02-16 17:16:04 +01:00
rgarcia
f3de8892e8 removes link in proposal description 2016-02-16 17:15:26 +01:00
rgarcia
14ddeaaa2e displays sidebar in proposal summary page 2016-02-16 13:58:58 +01:00
rgarcia
42fdc52329 adds specs for proposal summary 2016-02-16 13:53:39 +01:00
Alberto Garcia Cabeza
1158e764ca Adds styles to proposals summary 2016-02-16 13:04:40 +01:00
rgarcia
6540092bcd displays the top 3 proposals for every category 2016-02-16 12:17:37 +01:00