Commit Graph

1644 Commits

Author SHA1 Message Date
Javi Martín
9dfff1864a Fix hover and current datepicker color
We were using the wrong color since commit e2d540d20 because, by using
`@extend`, the compiled CSS had the styles for `.ui-state-hover` appear
before the styles for `.ui-state-default`.
2022-10-23 18:55:38 +02:00
Javi Martín
5d37220282 Fix hover colors on buttons to show/hide content
We were setting the color to be the same as links, but forgot to do the
same on hover. Using the `link` mixin solves the issue.
2022-10-23 18:55:38 +02:00
Senén Rodero
760abffde9 Merge pull request #4993 from consul/refactor_public_polls
Refactor and simplify public polls views
2022-10-18 13:24:44 +02:00
Javi Martín
05cb72a398 Remove duplicate mixin in budget-investment-show
This mixin was being called twice for the `.budget-investment-show`
selector; once in the CSS including this code for all the "Show
participation" pages, and once in the CSS for budget investments.
2022-10-13 16:12:34 +02:00
Javi Martín
ef87abd8b7 Remove duplicate selector in partipation CSS
Thi line `.budget-investment-show,` was included twice, probably due to
issues while solving conflicts in git.
2022-10-13 16:07:01 +02:00
Javi Martín
c30b528f5a Remove obsolete spending proposals CSS selector
This selector isn't used since commit 24dde9c35.
2022-10-13 16:05:43 +02:00
Javi Martín
5a654d2984 Remove obsolete CSS for the dashboard clipboard
This code isn't used since we removed the copy link feature in commit
5bbf325c1.
2022-10-13 16:03:40 +02:00
Javi Martín
72f9aeb313 Remove obsolete CSS for the verification letter
This code has never been used; it was introduced in commit da86c5d6e,
maybe by accident.
2022-10-13 16:02:31 +02:00
Javi Martín
9b642a0a88 Remove obsolete CSS for the annotator editor
We don't use this editor but our own custom editor, meaning this code
isn't used since commits 54e59a8a5 and bf20c93e9.
2022-10-13 16:02:18 +02:00
Javi Martín
e66aab7d04 Remove obsolete CSS for the help page
This code isn't used since commit d679c1eb7.
2022-10-13 16:00:11 +02:00
Javi Martín
ae218090f4 Remove obsolete CSS for questions geozones
This code isn't used since commit ab63c18d0.
2022-10-13 16:00:07 +02:00
Senén Rodero Rodríguez
527d5691f7 Make poll feature work in browsers with javascript disabled
By using the Rails `button_to` helper (which generates a form), and adapting the
response to `html` and `js` formats, the feature works with or without javascript
enabled.
2022-09-22 17:39:57 +02:00
Sebastia
c33aa1d62c Merge pull request #4839 from consul/comments_count_investment
Add comments count on budget investments
2022-08-22 18:52:06 +02:00
taitus
2865ee286f Add comments count component
Remove all the translations that are left over after having unified them
in the component.
2022-08-19 15:40:51 +02:00
taitus
aec317e5e6 Unify annotations comment icon to new structure
Apply new structure in the section that shows the comments icon together
with the number of comments so that it is easier to unify them into one
component.

Please note that we updated the comment-number class to comments-count
in order to simplify the css in the new component in the next commit.
2022-08-19 15:40:50 +02:00
taitus
e6f2c5474d Unify comment icon on legislation summaries
This was the only place in the application where the comments icon was
included without the span with the class "icon-comments".

We unified with the rest of the application and removed the
"comments-count" class which is no longer needed.
2022-08-19 14:25:58 +02:00
taitus
0ca17c6fae Unify comment icon on legislation questions
Remove unnecessary span class "debate-comments".

We take advantage of this commit to also unify the format of the date
that appears next to the comments with the rest of the application. The
format that we removed is being used on the same page in the
"Participation phases" tab (I guess that was the reason for putting it
the same) but I think it makes more sense to use the date format that is
used in this kind section in the rest of the application.
2022-08-19 14:25:34 +02:00
taitus
3deba3b189 Unify comment icon on legislation annotation index
Apply new structure in the section that shows the comments icon together
with the number of comments so that it is easier to unify them into one
component.

In this case we make only the text clickable and not the icon as in the
rest of the application. We're keeping the color and text-decoration so
it looks the same way it has looked until now, but we might change it
in the future.
2022-08-19 14:25:34 +02:00
taitus
a32e249919 Remove   after icon-comments
At some other time we will try to remove all the  

For now we start with what we added after the comments icon.
2022-08-19 14:25:30 +02:00
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
decabeza
52e65ba031 Add comments count on budget investments 2022-08-02 13:40:48 +02:00
Javi Martín
03aa52c4a0 Remove unused CSS containing a typo
It was accidentally added in commit ddc4ff329. The issue had already
been fixed in commit 0950a98dd.
2022-06-03 20:16:00 +02:00
Javi Martín
1e1edc02e9 Fix warnings when compiling SCSS
Foundation was using `!global` for non-existing variables, which
generated a warning on our current version of Sass.

This is (mostly) fixed on the latest version of Foundation. However,
this latest version isn't included in the `foundation-rails` gem, so we
can't upgrade yet.

So we're defining these variables before Foundation does so.

See issue 12080 in the foundation/foundation-sites repository for more
information.
2022-06-01 12:04:17 +02:00
Javi Martín
bfe6c1862d Fix link and text selection in budget header
While reviewing commit 7702b551e, I forgot to test whether selecting
text in the budget header or clicking its link worked properly.

The negative index (-5) meant it was impossible to select its text or
click on its link.

The good news is the pseudoelement with a negative index (-1) is
considered a child of the .budget-header element, so having a negative
index will cause the pseudoelement to be render behind the content of
the .budget-header element but in front of the background of the
.budget-header element.

This is exactly what we want.

Originally, we didn't have a z-index in the .budget-header element,
meaning the pseudoelement was rendered behind the background of the
.budget-header element, meaning both backgrounds were visible. This was
OK when the background was a plain color, but it wasn't when the
background was an image.

To stress the fact that the budget header is only affected when we use
an image, I'm also moving the code inside the `.with-background-image`
selector, although it would be interesting to check whether it's a good
idea to add `z-index: 0` to the `full-width-background` mixin.
2022-05-03 21:00:08 +02:00
Javi Martín
d05fa803f2 Merge pull request #4814 from iraline/fix_background_4786
Fix background image from Participatory Budgets page
2022-05-03 20:22:16 +02:00
Javi Martín
e4e359339f Fix banner link on Chromium 101
After upgrading to Chrome/Chromium 101, the test "Cross-Site Scripting
protection banner URL" was failing with the message:

Element <a>...</a> is not clickable (...) Other element would receive
the click: <div class="banner" style="background-color:#FF0000;">...</
div>

The reason was that, when using the structure of a link with one <h2>
and one <h3> inside, previous versions of Chrome/Chromium considered the
margin between the <h2> and the <h3> part of the link.  Version 101 does
the same thing Firefox does and so clicking on the space between the
<h2> and the <h3> doesn't result in clicking the link.

In order to keep the previous behavior, we're adding a `display: block`
tag to a link.

Note that, in the future, we might change the structure of the banner,
since using <h3> as a subheading is discouraged by the W3C, and we
aren't sure about the usability of making the whole banner clickable.
But, for now, we're just fixing the issue so our test suite is green
again.
2022-05-02 15:11:22 +02:00
Javi Martín
fef39cad24 Move banner styles to their own stylesheet
Since we've already got a banner component, we follow the convention of
using one CSS file per component. We also reduce the number of lines in
the huge layout.scss file.

Now the sections in layout.scss from "17" to "19", just like they jump
from "08" to "10".
2022-05-02 15:00:51 +02:00
Iraline
7702b551ec Fixing background image from Participatory Budgets page 2022-04-27 09:13:44 -03:00
Sebastia
810a516078 Merge pull request #4806 from consul/budget_phases_hint
Add and improve hint information related to phases duration
2022-04-12 15:50:20 +02:00
taitus
703e28e6cd Add information to the phase table to clarify its functionality.
Add a help text on admin budget show page and improve text from Admin::Budgets::HelpComponent in order to
clarify its functionality when we are using the wizard.
2022-04-12 15:22:29 +02:00
Javi Martín
1c93a3cebb Simplify search results summary layout 2022-04-12 14:23:35 +02:00
Javi Martín
5c0aa42351 Remove duplication in search results summary
We were using very similar code for proposals, debates and investments,
so we might as well share the code between them.

Note we're using the `proposals.index.search_results` key even for
debates and investments. This will still work because the translations
shared the same text, but IMHO we should rename the key to something
like `shared.search_results_summary`. We aren't doing so because we'd
lose all the existing translations.
2022-04-12 14:23:14 +02:00
taitus
dbc51bcdcd Improve hint information related to duration phases
Specify that this field is for information purposes only and
does not automatically update phase status.

We also improve enable help text.
2022-04-12 13:23:59 +02:00
taitus
923c2a7ee2 Check labels styles
We are use a display: block style for labels containing check boxes inside
them, and the label has a width of 100%.

This means that clicking on the blank space on the right of the label text
will check/uncheck the checkbox. To avoid this behaviour we modify the
"display" attribute of the labels.

In order to prevent unexpected behaviour in terms_of_service form labels,
we add specific css for this case when define a checkbox within the
.actions class.
2022-04-04 18:55:56 +02:00
Javi Martín
abec716308 Show "not allowed" message on click
Defining a behavior on hover means making it different for people using
a keyboard or a touchscreen (most of the population, nowadays).

In this case, we had an accessibility issue where the message wouldn't
disappear once it appeared. That meant that, after tabbing through all
the links and buttons in, for instance, the debates index, the page
would be filled with "participation not allowed" messages, and in order
to see the information about how many people have voted, reloading the
page was required.

For touchscreen users the behavior was similar to what we get on hover,
although we've found some inconsistencies when trying to support several
elements on the same page.

We think in proposals it makes sense to hide the "support" button when
users click on it, and the same applies to the buttonsto support and
vote investment projects. However, we aren't hiding the buttons to
agree/disagree with a debate in order to keep the information about the
current number of people agreeing and disagreeing visible.

Note we're removing some support spec methods because after these
changes the duplication isn't as obvious as it was in the past.
2022-02-23 16:43:37 +01:00
Javi Martín
168575d606 Remove "not allowed" when supporting comments
Hovering over the votes showed a "participation not allowed" message
which was annoying when scrolling with the browser or simply moving the
mouse around the page. Furthermore, it hid the information about the
number of votes, links to show/collapse replies, ...

We're planning to change the behavior of all the "participation not
allowed" messages in order to show them on click instead of showing them
on hover (just like it's done on touchscreens). In the case of comments,
supports, however, there's very limited space in the part showing the
number of supports for comments, so adding this message without breaking
the layout is challenging.

So, for now, we're simply redirecting unauthenticated users to the login
page. If find an easy way to implement a better user interface in the
future to display the "participation not allowed" message, we might
change this behaviour.
2022-02-21 18:48:09 +01:00
Javi Martín
ecd34ca6ce Make participation not allowed text size consistent
Not sure whether small or normal is better, but at least it's the same.
2022-02-21 18:48:09 +01:00
Javi Martín
a0b4e35dbd Show login to comment message in annotations
This way it's consistent with what we get when there are no comments. It
only appears once on the page so it isn't overwhelming.
2022-02-21 18:48:09 +01:00
Javi Martín
9154614577 Always show not allowed message in legislation debates
This message is only shown in the `show` action, so it's shown at most
once in the whole page, so it doesn't take up too much space and it
isn't as overwhelming as if we were showing it on the index page, once
per debate.

We're only showing it when there are closed options, though, since
there's already a message to sign in to comment when the question
accepts open answers.
2022-02-21 18:48:09 +01:00
Javi Martín
aa2c551411 Use has-fa-icon in agree/disagree comment buttons
Note we're using the in-favor HTML class instead of the in_favor class
so we're consistent with our conventions for HTML classes and because we
use the in-favor class in similar places.

Also note the styles of the legislation process annotations/comments
buttons is now similar to the styles in the other sections. Previously,
the colors didn't have enough contrast and there was a very strange
margin between the "thumbs up" icon and the number of people agreeing
(that margin wasn't present between the "thumbs down" icon and the
number of people disagreeing).
2022-02-21 18:47:38 +01:00
Javi Martín
ba0d21b469 Use buttons to agree/disagree with comments
As mentioned in commits 5311daadf and bb958daf0, using links combined
with JavaScript to generate POST requests to the server has a few
issues.
2022-02-21 18:47:37 +01:00
Javi Martín
f970ddcb86 Fix agree/disagree alignment in medium screens
Using the `flex-with-gap` mixin we avoid the left margin in the second
element when the screen space isn't wide enough to show both buttons.

Setting the margins with CSS also allows as to simplify the view and
makes it easier to customize styles.
2022-02-21 18:47:37 +01:00
Javi Martín
d347da8a33 Use has-fa-icon in agree/disagree buttons
This way we can simplify the code in the views a little bit.
2022-02-21 18:47:37 +01:00
Javi Martín
eecaf5876e Move result percentages out of the voting buttons
Having buttons (previously links) with the text "I agree 75%" is
confusing; people might believe they're saying they only partially agree
with the content. Besides, the results percentages is a different piece
of information which shouldn't be related to whether one person
agrees/disagrees with the content.

This problem might be solved for people using screen readers since we
added the aria-label attribute. However, for sighted keyboard users, the
percentage was being outlined on focus as part of the button, which
might be confusing.
2022-02-21 18:47:37 +01:00
Javi Martín
86ad2df46d Unify code in debates/legislation vote links
We were using the same code to render links to agree and disagree, so we
can extract a new component for this code.

We're also adding component tests to make it easier to test whether
we're breaking anything while refactoring, although the code is probably
already covered by system tests.

Since the votes mixin was only used in one place, we're removing it and
moving most of its code to a new CSS file for the shared component.
2022-02-21 18:47:13 +01:00
Javi Martín
053ec31df6 Fix new session links in comments votes component
When there isn't a current user, the links can't be clicked, so there's
no real point in them being links.

When there's a current user and they cannot vote (for example, an
organization), having a link/button to an action they can't perform
isn't that useful IMHO. They get a message saying they aren't allowed to
vote but the message doesn't say why. However, in this case, many people
might try to click/touch the link/button and will wonder why nothing
happens, so we'll revisit this issue when we change the way we display
the "participation not allowed" messages.

Now the behavior is more similar to the one we get when voting
proposals/debates.
2022-02-21 18:47:13 +01:00
Javi Martín
4b42a68b6a Use the vote action to vote featured proposals
The action and the views were almost identical, with the supports
progress and the HTML classes of the success message element being the
only exceptions; we can use CSS for the styles instead.
2022-02-21 18:47:13 +01:00
Javi Martín
3e89a1dd53 Merge pull request #4301 from consul/unsubscribe
Include link to unsubscribe in email notifications
2022-01-21 20:43:43 +01:00
taitus
6d9e4a9330 Allow users to manage their notifications
The user can access this page without being logged in.
We identify the user through the "subscriptions_token" parameter and
show a list of the notifications that can be enable/disable.

We will return a 404 error in case someone accesses the page with a
non-existent token.

We also control the case that some anonymous user tries to access the
page without any token, by returning the CanCan::AccessDenied exception.
2022-01-21 18:58:38 +01:00
Javi Martín
c5103d3025 Fix generating dashboard poster on production
In commit 905ac48bb we mentioned:

> Since we don't use `asset_path` to reference assets in the public
> folder, we can safely disable the `unknown_asset_fallback` option.

However, `asset_path` is used by the wicked_pdf gem when calling the
`wicked_pdf_stylesheet_link_tag` method. This method also checks the CSS
files, searching for `url()` calls and converting any relative URLs
referenced there to absolute URLs.

However, when compiling assets on production, our `application.css` file
contains the following line imported from Leaflet which says:

```
behavior: url(#default#VML);
```

When passing this URL to `asset_path` (which is something the wicked_pdf
gem does automatically), it doesn't find the URL, and so this call
crashes unless we enable then `unknown_asset_fallback` option.

Since the dashboard poster is a feature we might remove in the future,
we're avoiding changing a Rails global configuration just for this
feature. So, instead of enabling the `unknown_asset_fallback` option,
we're changing the `poster.pdf` view so it doesn't load all the CSS of
the application but only the CSS it needs.

Note we aren't adding a test case because this bug is only present on
production environments when assets have been precompiled.
2022-01-12 13:45:59 +01:00