Commit Graph

2326 Commits

Author SHA1 Message Date
Javi Martín
a2a6ae7bdd Use a caption to identify budget phases table
This makes the table easier to identify when writing tests and using
screen readers.

Since we do not render any other table captions anywhere else, we're
making the caption invisible so only screen reader users will be
affected by this change.
2021-03-11 19:37:58 +01:00
Javi Martín
cbe3d515b9 Extract file with CSS for budget phases table 2021-03-11 19:37:58 +01:00
decabeza
c4e7bf0938 Improve budget phases form layout
Dates are grouped in a fieldset and activating the phase is more
prominent.
2021-03-11 19:37:58 +01:00
decabeza
f35a88cf4f Make finished budgets layout wider 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
46e80bf430 Extract budget phases to a component 2021-03-09 16:37:47 +01:00
Javi Martín
d1675750b8 Fix a chrome bug in versions lower than 86
https://bugs.chromium.org/p/chromium/issues/detail?id=375693
2021-03-08 10:51:22 +01:00
taitus
d26607183e Add sdg help page
In this page we will render a list of clickable Goals icons that will show their
targets and related local targets

Co-authored-by: Senen <senenrodero@gmail.com>
2021-03-02 14:45:18 +01:00
Javi Martín
d741ccdb36 Extract related list selector styles to mixin 2021-03-02 14:45:17 +01:00
taitus
522684cd2f Adapt targets component to render on sdg help page
This component was rendered on different pages so there were no conflicts
with static id's.
Now in the SDG help page we are going to render them all at once, so we
convert the static identifiers to dynamic.
2021-02-26 16:36:40 +01:00
taitus
4a880fc1c5 Render header on sdg index page
We no longer show the static header when we have created a
custom header.
2021-02-26 16:20:57 +01:00
Senén Rodero Rodríguez
1d6490e22f Update sdg management homepage to render header cards 2021-02-26 16:16:51 +01:00
Javi Martín
683af5de60 Merge pull request #4371 from consul/all_budgets_filter
Add filter to display all budgets in admin section
2021-02-26 14:47:19 +01:00
Javi Martín
da7846c6d5 Merge pull request #4361 from consul/sdg_per_budget_stats
Split investment projects statistics by participatory budget
2021-02-26 14:41:13 +01:00
Senén Rodero Rodríguez
ebe8903c75 Investment projects statistics by participatory budget
The more recent budgets show first.

The current budget will only show the amount of sent investments
until the winner's phase.
2021-02-26 14:08:45 +01:00
Javi Martín
45517f659e Add SDG goals/targets to legislation proposals 2021-02-24 20:42:53 +01:00
decabeza
2f636eaf77 Add completed info on finished budgets 2021-02-23 18:39:45 +01:00
Julian Herrero
28caabecdf Refactor participatory budgets in draft mode
Previously the draft mode was a phase of the PB, but that had some
limitations.

Now the phase drafting disappears and therefore the PB can have the
status published or not published (in draft mode).

That will give more flexibility in order to navigate through the
different phases and see how it looks for administrators before
publishing the PB and everybody can see.

By default, the PB is always created in draft mode, so it gives you
the flexibility to adjust and modify anything before publishing it.
2021-02-23 17:05:24 +01:00
decabeza
d0534b78da Improve admin budgets form structure
Co-Authored-By: Javi Martín <javim@elretirao.net>
2021-02-23 16:11:13 +01:00
Julian Herrero
b1cb981980 Add help text in budgets admin index
Co-authored-by: decabeza <alberto@decabeza.es>
2021-02-18 23:40:40 +01:00
Javi Martín
435747764c Group links to create budgets with the heading
We're going to add help content here and having a floating button would
make the button disappear when creating content for mobile phones.

I'm not sure having the link in the <header> tag is semantically
correct, but is consistent to what we did to create local targets in the
SDG content section.

Note we're changing the style of the link to create local targets so
it's consistent with the link to create budgets/groups/headings.
2021-02-18 23:40:40 +01:00
Javi Martín
14b4c6fb85 Merge pull request #4362 from consul/admin_styles
Add new admin tables and forms styles
2021-02-18 19:39:03 +01:00
Javi Martín
1481b0dc50 Use a less bright white color as default
The color #fff provides higher contrast, which can cause problems to
users who experience migraines with bright colors or dyslexic users who
might see some kind of shadows around the text because of the bright
color.

So even if it isn't a big improvement, we're slighty reducing the
contrast in order to slightly reduce this problem.
2021-02-18 15:46:16 +01:00
decabeza
4dad04ae3f Add new styles for admin forms 2021-02-18 15:46:16 +01:00
decabeza
16dc5821d1 Add margin to all h3 admin headers 2021-02-18 15:46:16 +01:00
decabeza
428c1695f2 Add new styles for admin tables 2021-02-18 15:46:16 +01:00
decabeza
a45ab81885 Fix SCSS-Lint QualifyingElement warning 2021-02-18 15:46:16 +01:00
Javi Martín
0839c5ea75 Adjust new notifications icon position
It was hard to know where the numbers were coming from; they depended on
the padding of the link and the size of the notification icon size. So
we're using variables to make it more explicit.

However, the code is now too complex, so we'll probably have to simplify
it in the future.
2021-02-18 14:45:48 +01:00
Javi Martín
4c289f2489 Simplify notification item HTML
Other than simplifying the view, we can write tests using `click_link`,
which makes the tests more robust. Clicking the `.icon-notification`
element was causing some tests to fail when defining a window height of
750 pixels in the `admin_budgets` branch.
2021-02-16 23:21:51 +01:00
Javi Martín
f11f2cd3dd Extract component to render notifications item 2021-02-16 00:00:49 +01:00
Javi Martín
b6c269008f Merge pull request #4358 from consul/sdg_related_list_fieldest
Improve goals/targets selector accessibility
2021-02-15 16:12:15 +01:00
Javi Martín
ab2b3a2671 Improve help messages in SDG selector
Hopefully now it's a bit more obvious that SDGs can be selected by
clicking on them and that the field to select goals and the field to
select targets/goals are related (since they're now part of the same
fieldset).
2021-02-15 15:48:25 +01:00
Javi Martín
6ecb6757a6 Use real check boxes to select goals
We were using list items with the checkbox role. This is probably
confusing since list items have a listitem role, and so we were
basically using a list with no listitem.

We could add a `<span role="checkbox">` tag inside the list item, but
using real checkboxes is probably easier. We're also adding a test to
verify the checkboxes native behavior is compatible with our code.

Note we're using the "enter" key to toggle the "checked" status of the
SDG. This is probably not intuitive for screen reader users who might
try to submit the form using the "enter" key after selecting a goal.

However, the alternative would be even less intuitive for sighted
keyboard users, since for them these icons look like links or buttons
and they would accidentally submit the form when trying to select a
goal.

Since we haven't come up with a better interface yet, for now we're
following the principle of least damage; we consider submitting the form
against a user's will is less annoying than forcing users to move to a
different field before being able to submit the form.

Also note we can't write `check` in the tests because Capybara will try
to click the checkbox, which is hidden by the image in the label.
2021-02-15 15:48:25 +01:00
Javi Martín
6ab78a5290 Merge pull request #4357 from consul/fix_tags_in_forms
Fix tags styles in forms
2021-02-15 15:36:15 +01:00
Javi Martín
e6437bb896 Fix tags styles in forms
These styles were broken in commit 2614de79c, since there we only
considered scenarios where the `tags` element is a list. In these forms, however, the `tags` element is a regular <div> tag.
2021-02-14 18:56:52 +01:00
Javi Martín
7ce61ced85 Use font awesome in social share icons
Since we've changed the facebook and twitter login icons, it makes sense
to use the same icons in social share links.

Besides, using font-awesome simplifies the code and prevents problems
with screen readers announcing the value of the `content:` CSS property.
2021-02-14 14:57:13 +01:00
Javi Martín
741f2fc141 Use icon width variable in SSB icons
The font size and the line-height were chosen according to the width of
the icon; we're now making it clear.
2021-02-14 14:42:40 +01:00
Javi Martín
60c3fd2fff Use google icon in sign in page
We were using the icon for google plus, which was confusing since google
plus no longer exists.

Note this change requires changing the font for these icons, since the
google icon is not present in the "icons" font. On the plus side, using
the font awesome icons we can simplify the code a little bit.
2021-02-09 19:12:47 +01:00
Javi Martín
b867243e83 Remove redundant background property
The property is overwritten for each icon.
2021-02-09 19:00:04 +01:00
Javi Martín
3ce86078e1 Remove unused styles for button-telegram
We only use the button-* classes in the sign in form, and there's no
"Sign in through Telegram" feature.
2021-02-09 18:19:17 +01:00
Javi Martín
5569663308 Use aria-expanded on column selector toggle button
This way screen reader users will be informed about what happens when
the button is clicked. We also simplify the HTML/JavaScript a little
bit.
2021-02-08 19:57:42 +01:00
Javi Martín
00dfa95902 Allow toggling the column selector with a keyboard
Using a button tag, it's possible for every user to "click" the element.
Besides, we don't need to call the `preventDefault` function, because
buttons with type "button" don't do anything by default.
2021-02-08 19:57:42 +01:00
Javi Martín
aed38aa3cf Fix styles for mobile icons in featured proposals
We were only adding styles for facebook and twitter, meaning telegram
and whatsapp looked out of place.
2021-02-08 16:31:26 +01:00
Javi Martín
abc81b30be Simplify styles for SSB icons
By using the same selector used by the social-share-button gem, we can
remove all the !important rules.
2021-02-08 16:31:26 +01:00
Javi Martín
68260360ef Remove unused styles
As far as I can see, the `.jumbo-budget` never had social share button
elements inside it.
2021-02-08 16:31:26 +01:00
Javi Martín
780660afc7 Use the icon-width variable to set SSB icon size
The same way we use it for SDG icons.
2021-02-08 16:31:26 +01:00
Javi Martín
0d8119a1e3 Use social-share-button whatsapp icon
We were using a custom icon because in the past social-share-button
didn't have support for whatsapp. But now that it does, we can remove
our custom icon.

Note we're using the `_app` suffix because that's the name of the icon
meant for mobile devices.
2021-02-08 16:31:26 +01:00
Javi Martín
ae8afc9b75 Remove duplication in social share button styles
All buttons were using the same styles, so we might as well style them
together.
2021-02-08 16:31:26 +01:00
Javi Martín
c5a56214c6 Remove redundant social share button styles
These styles were defined twice in our layout stylesheet.
2021-02-08 16:31:25 +01:00
Javi Martín
92a09f74b0 Remove obsolete tag list rule
This rule was added so the tag list wouldn't have an extra bottom
margin. However, the rule is already applied by the `.tags` selector
inside `.budget-investment` and it was conflicting with other lists
(goals and tags) we've added to thi investments index.
2021-02-04 12:32:03 +01:00