Commit Graph

2216 Commits

Author SHA1 Message Date
Javi Martín
35e95121e2 Add variables to customize main layout colors
Until now, we didn't have specific variables for the headers and were
using the brand colors instead. Now we maintain the brand colors as
default values, but allow overwriting them.

For the navigation and footer, we didn't even have variables.
2022-11-20 00:29:12 +01:00
Javi Martín
277f8b1ddc Revert "Use the same color for solid and hollow buttons"
Back in commit 5dbd69486, I said:

> I'm choosing to use the same color for solid and hollow buttons
> because these elements are usually isolated and so from the UX
> perspective they are similar; links, on the other hand, are often in
> the middle of some text.

However, I made a mistake. The crucial factor is that solid buttons
might have a light background if we choose the brand color to be a light
one, and in this case they automatically get black text. However, hollow
buttons always have a light background and so we can't use a light color
for the text and border of these buttons.
2022-11-20 00:29:07 +01:00
Javi Martín
9ac8ddb6bf Unify dark and brand-secondary SCSS variables
We were using each one half the time, while they both had the same value
by default. It was impossible to know when me meant "use a dark color
here" or "use the secondary brand color" here.

So now we're only using one variable, so it's easy it'll be easy to add
CSS custom properties to overwrite this variable. We're choosing
`brand-secondary` because its name makes it less problematic to use a
light color.
2022-10-28 14:07:33 +02:00
Javi Martín
b96d745e0e Use $body-font-color instead of $text
This is consistent with the usage of `$body-background`. This way
Foundation elements using `$body-font-color`, like the `<body>` tag,
will be changed when changing this variable, which wouldn't happen when
using `$text`.
2022-10-28 14:07:33 +02:00
Javi Martín
ea3ae4d262 Use $anchor-color instead of $link
The variables `$anchor-color` and `$anchor-color-hover` are the ones
Foundation uses internally; by using them, we make sure every link will
use the colors we define.

Now we can simplify the default styles for the `<a>` tags, since by
default they already use these variables.
2022-10-28 14:07:33 +02:00
Javi Martín
6cb4f4acde Extract mixin to get a background with text contrast
This way we simplify the code a bit.

Note we're only using this function when variables for background colors
are already defined, since that means customizing the variable using the
background color will automatically change the color of the text.
Customization isn't easier when using raw colors.
2022-10-28 13:58:04 +02:00
Javi Martín
1b1b5b5755 Use color-pick-contrast to get text colors
We were defining (for instance) white text against the `$brand`
background. That meant that, if somebody customized the `$brand` color
so it used a light color, they had to customize the text color as well
in order to guarantee proper contrast between text and background
colors.

So we're using `color-pick-contrast` instead, which means we don't have
to manually calculate whether white or black will be the color which
makes the text more readable.
2022-10-28 13:58:04 +02:00
Javi Martín
025d7bf9f8 Remove duplication in sidebar color definition
We're going to change that code so it uses color-pick-contrast, so we're
refactoring it first.
2022-10-28 13:57:18 +02:00
Javi Martín
5845dd46d9 Extract variable for SDG text color
We were using `#fff` in some places and `$white` in others. We're
choosing `#fff` because it has a better contrast against the lighter SDG
colors and because it's the one officially used by the United Nations.
2022-10-27 15:35:27 +02:00
Javi Martín
3aa73110c5 Use foundation variables to set caption color
This way we can simplify the code a bit since Foundation automatically
chooses the text color of the caption so there's enough contrast with
the background color defined in `$orbit-caption-background`.
2022-10-27 15:35:27 +02:00
Javi Martín
0be0f459ab Extract mixin to use links with the text color 2022-10-27 15:14:48 +02:00
Javi Martín
33eea0b21a Extract mixin to use body background and text color
This way we reduce the usages of the `$body-background` and `$text`
variables, making it easier to replace them with CSS variables in the
future.
2022-10-27 15:14:48 +02:00
Javi Martín
3c8d97fc57 Simplify hover color in link to delete comments
Since we were using the default color, we can do so without overwriting
it twice.
2022-10-27 15:09:13 +02:00
Javi Martín
335f0d8bde Inherit text color instead of defining it again
This way it's easier to customize colors, particularly when links use
the same colors as the text surrounding them.

Note that the `markdown-editor-header` isn't displayed since commit
76b7f66fb, which was probably an unintended side-effect. So we're
modifying the colors here as well instead of removing the element; we
might display it again in the future.

Also note the change in `.supported` only affects the proposals section;
budget investments use a different color for the `.supported` sucess
message. Not sure whether this was originally intended or done by
accident.
2022-10-27 15:07:53 +02:00
Javi Martín
09471c1432 Remove redundant background definitions
These elements didn't need a background because their parent elements
already defined the same background.
2022-10-27 01:10:46 +02:00
Javi Martín
590f557aaa Remove redundant link colors definitions
These elements already used these colors because their parent elements
already used these colors for links.
2022-10-27 01:10:36 +02:00
Javi Martín
e050e5cc70 Remove redundant text color definitions
These elements were already using these colors because they inherited
them from their parent elements or Foundation already defined them.

Note that the only contents of `.comment-info` are: `.user-name` and
`.is-author`, `.is-association`, `.level-1`, ... and the link to the
comment. All of these elements were overwriting the `$text-medium`
color, so there's no need to set it. That means we can use the default
text color for `.user-name` without specifically setting it.
2022-10-27 01:10:31 +02:00
Javi Martín
6f75069cb3 Remove unused style for table header labels
This style was added in commit 92f4c26fa. However, we don't have any
labels inside <th> elements, so we don't need it.
2022-10-26 16:23:50 +02:00
Javi Martín
7ed0dbfd9a Use the same colors for admin top-links
Doing so will help to immediately identify which administration you're
managing when using multitenant applications.

We might revert this change if we detect it causes usability issues in
the admin section.
2022-10-25 21:23:52 +02:00
Javi Martín
5dbd694861 Use the same color for solid and hollow buttons
Should hollow buttons use the same color as links do or the same color
as solid buttons do? In the default scenario, it doesn't matter, since
links and solid buttons use the same color. However, it matters when
people customize the application so links and solid buttons don't use
the same color.

I'm choosing to use the same color for solid and hollow buttons because
these elements are usually isolated and so from the UX perspective they
are similar; links, on the other hand, are often in the middle of some
text.

Note we're talking about links and buttons while many of the "buttons"
we use in the application are actually links styled as buttons. Here,
"buttons" means "things that look like buttons".
2022-10-24 20:38:16 +02:00
Javi Martín
a16247b258 Respect hover color in leaflet and author links
We were overwriting the color of the links, but not the color of the
links on hover.

Note we're removing the `!important` rule from the author link; after
testing it, it looks like it wasn't necessary.
2022-10-24 20:38:16 +02:00
Javi Martín
21faad66c9 Fix color changing on hover on non-link notifications
IMHO it was really strange to change the color on hover when the element
isn't interactive.
2022-10-24 20:38:14 +02:00
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
0b8cd158a9 Merge pull request #5012 from consul/multiple_answers
Add poll questions that accept multiple answers per user
2022-10-18 13:25:02 +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
decabeza
815a526d78 Add VotationType fields to admin poll question form 2022-10-18 10:38:59 +02:00
decabeza
d2cc110678 Use this instead of the CSS selector .sortable
In this context, `this` already points to the element, so there is no
need to search it again.
2022-10-18 10:38:59 +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
Senén Rodero Rodríguez
64676be246 Remove token column from poll_voters table
As it is no longer used as originally pretended [1][2].

[1] Check consul/consul pull request 1994
[2] Check consul/consul pull request 3539
2022-09-22 10:34:07 +02:00
Javi Martín
5a0fde4048 Allow selecting the time when a poll starts/ends
We were already saving it as a time, but we didn't offer an interface to
select the time due to lack of decent browser support for this field
back when this feature was added.

However, nowadays all major browsers support this field type and, at the
time of writing, at least 86.5% of the browsers support it [1]. This
percentage could be much higher, since support in 11.25% of the browsers
is unknown.

Note we still need to support the case where this field isn't supported,
and so we offer a fallback and on the server side we don't assume we're
always getting a time. We're doing a strange hack so we set the field
type to text before changing its value; otherwise old Firefox browsers
crashed.

Also note that, until now, we were storing end dates in the database as
a date with 00:00 as its time, but we were considering the poll to be
open until 23:59 that day. So, in order to keep backwards compatibility,
we're adding a task to update the dates of existing polls so we get the
same behavior we had until now.

This also means budget polls are now created so they end at the
beginning of the day when the balloting phase ends. This is consistent
with the dates we display in the budget phases table.

Finally, there's one test where we're using `beginning_of_minute` when
creating a poll. That's because Chrome provides an interface to enter a
time in a `%H:%M` format when the "seconds" value of the provided time
is zero. However, when the "seconds" value isn't zero, Chrome provides
an interface to enter a time in a `%H:%M:%S` format. Since Capybara
doesn't enter the seconds when using `fill_in` with a time, the test
failed when Capybara tried to enter a time in the `%H:%M` format when
Chrome expected a time in the `%H:%M:%S` format.

To solve this last point, an alternative would be to manually provide
the format when using `fill_in` so it includes the seconds.

[1] https://caniuse.com/mdn-html_elements_input_type_datetime-local
2022-09-14 15:14:23 +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 &nbsp; after icon-comments
At some other time we will try to remove all the &nbsp;

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
Sebastia
77825ed13f Merge pull request #4818 from consul/emails_styles
System emails design
2022-06-03 08:40:54 +02:00