Commit Graph

132 Commits

Author SHA1 Message Date
Javi Martín
ad6dd54da2 Simplify rule to display support alert 2021-06-14 12:51:41 +02:00
Javi Martín
57628a78d9 Move investment votes partial to a component
This way changing it will be easier.
2021-06-14 12:51:41 +02:00
Javi Martín
d18a6f863b Merge pull request #4547 from consul/phases_image_alt
Fix accessibility issues in budgets index
2021-06-14 12:48:55 +02:00
Javi Martín
8b1e48b4ea Fix duplicate support_title I18n key
The key was declared twice and so the first one ("Support this project")
was overwritten.

We're grouping all keys related to the investment list together in order
to reduce the chances of this issue happening again (or, at least, in
this part of the code).
2021-06-12 13:20:39 +02:00
Javi Martín
edaa2d2de8 Fix missing alt attribute in phases images
An image without an alt text is invalid HTML and is confusing for screen
reader users.

This is just a quick patch which partially solves this problem. The
image doesn't necessarily need to be a decorative one, so administrators
should have the option to provide an alternative text for the images.
2021-06-12 01:23:14 +02:00
decabeza
0273156c20 Update single heading budget view
Co-Authored-By: Julian Herrero <microweb10@gmail.com>
2021-06-11 19:32:21 +02:00
decabeza
122195e33c Show a preview list of investments in the budget landing page
Note one of the tests dealing with random results is a bit flaky; since
it's a permutation selecting 7 objects out of 12, it will fail about
once every 4 million times. We think this is acceptable.

Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
2021-06-11 19:32:21 +02:00
Julian Herrero
db9ac79e05 Add main link to each phase of the budget
Co-authored-by: decabeza <alberto@decabeza.es>
2021-06-09 21:51:39 +02:00
Julian Herrero
43ad69bbaf Allow attaching an image to budget phases
Co-authored-by: decabeza <alberto@decabeza.es>
2021-06-09 21:47:58 +02:00
Julian Herrero
dcad390933 Ability to attach an image to budgets
Co-authored-by: decabeza <alberto@decabeza.es>
2021-06-09 21:33:08 +02:00
decabeza
d78f2e03ad Render link to budget header
- Allow to define a link (text and url) on budget form for render on the budget
header.
- Improve styles

Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
2021-06-09 19:16:55 +02:00
decabeza
090f1bcddb Not showing the phase description in the budget header
This description of the current phase is already being displayed on the same page
in the section "Participatory budgets phases"
2021-06-09 16:03:33 +02:00
decabeza
4adb7236dc Add title to budget header 2021-06-09 16:03:33 +02:00
Javi Martín
cf4e6d2c64 Improve budget phase HTML ID
Some browsers might not recognize an ID as valid when it starts with a
number.
2021-04-07 14:32:49 +02:00
Alberto
048ca61207 Improve styles for budgets voting phase 2021-03-24 15:50:25 +01:00
Alberto
896fee6e99 Improve icon to remove investment from ballot
Note we're absolutely positioning the link instead of the icon; that way
keyboard users will be able to focus on the icon. Until now, users would
focus on an empty link.

For the same reason, we couldn't use `click_link` with Capybara, since
it would fail to click an empty link. Now we can.

Co-authored-by: Javi Martín <javim@elretirao.net>
2021-03-24 15:48:24 +01:00
Javi Martín
fb8c476fb2 Extract component for ballot investment
Using component inheritance we can remove duplication and share the same
view.
2021-03-24 15:48:24 +01:00
decabeza
f3c7b59658 Fix heading tag hierarchy on budgets index 2021-03-18 15:03:22 +01:00
Julian Herrero
7e3dd47d5a Unify budget landing pages
There was a big difference between the current budget and a specific
budget landing page. This didn't really make too much sense. Also, it
was not possible to know how a draft participatory budget will look
before it was published.

By unifying those two views now they will look quite similar and it
will be possible for administrators to preview any draft budget and to
know how the budget will look like before actually publishing it.
2021-03-18 15:03:21 +01:00
Julian Herrero
f936c992e2 Extract footer for budgets to a component 2021-03-18 14:06:46 +01:00
decabeza
bbb4e04c7c Extract budget investment's info to a component 2021-03-18 13:59:09 +01:00
Javi Martín
4c23f639be Use heading name as link text
Using the name instead of using the name and the price is IMHO more
consistent with the rest of the application, particularly for screen
reader users. Writing texts clicking those links is also easier.

I think the main reason why we used the price as part of the link was so
the clickable area was bigger. We can accomplish the same result with
CSS.
2021-03-18 13:59:09 +01:00
Javi Martín
f1b707f549 Simplify styling headings with the same height
Using flex we don't have to rely on JavaScript to equalize the item.
Besides, we've had problems with JavaScript in the past.

We're also adjusting the width of the elements; previously, even though
we defined a width of 16.666% for each element, only five elements would
be on the same row. It happenend because these elements were styled with
inline-block and the generated HTML contained a newline character
between <li> tags, meaning a space character was introduced between
elements. The width of the mentioned space character wasn't being taken
into account when calculating the width.

Using flex, there's no space character between items and we have to
define the margin between them. We're taking this margin into account
when calculating the width.
2021-03-18 13:59:09 +01:00
Julian Herrero
16c582f282 Extract component for budget groups and headings 2021-03-18 13:59:09 +01:00
Javi Martín
6ae4a1cf09 Unify "current phase" text
We were using "actual phase" and then "current phase" right below it.
2021-03-11 19:37:58 +01:00
Javi Martín
4896c754a0 Extract budget subheader to a component 2021-03-11 19:37:58 +01:00
Julian Herrero
909071c48b Allow editing the name of budget phases
Co-authored-by: decabeza <alberto@decabeza.es>
2021-03-11 19:37:58 +01:00
Javi Martín
b37eaf19c6 Use a time HTML tag to display phases dates
Currently this change is barely beneficial (if at all), but it doesn't
harm and might be useful in some cases. For instance, the `datetime`
attributes generates a date containing time zone information, which the
text shown on the screen does not, and styling dates with CSS is now
easier.
2021-03-11 19:37:58 +01:00
decabeza
c0f9e4f045 Change budget phases design
Co-authored-by: Javi Martín <javim@elretirao.net>
2021-03-11 19:37:58 +01:00
Javi Martín
014d29b991 Extract method to get a budget phase title 2021-03-09 16:37:47 +01:00
Javi Martín
70cf956210 Extract method to check the current phase 2021-03-09 16:37:47 +01:00
Javi Martín
46e80bf430 Extract budget phases to a component 2021-03-09 16:37:47 +01:00