Commit Graph

15767 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
3240f211b5 Update translations from Crowdin
Add translations files for two new languages: Indonesian and
Tagalog.

Change Serbian (Cyrillic) folder from `sr-SP` to `sr`, this is a
preference of us so we can run i18n-tasks without having to
rename the folder first.
2020-09-23 17:22:46 +02:00
Javi Martín
e6b3031247 Merge pull request #4129 from consul/fix_airbrake
Fix Airbrake crash with no project key
2020-09-23 13:17:57 +02:00
Javi Martín
a1bb9bd5d6 Fix Airbrake crash with no project key
We were checking tho project_id but not the project_key. However, in our
example secrets file we actually include a project_id but not a
project_key, and so new CONSUL installations would crash in production
environments.

Although technically the application doesn't crash if no host is
defined, we're also ignoring the current environment if no host is
defined, since errbit/airbrake is unlikely to work in this scenario.
2020-09-23 13:00:25 +02:00
Javi Martín
0b464f7ac1 Merge pull request #4138 from consul/manage_successful_proposal
Fix crash in management with successful proposals
2020-09-23 11:24:09 +02:00
Javi Martín
3e2d7fd707 Fix crash in management with successful proposals
The page was crashing because it was looking for the `supports` partial
under `management/proposals`, when the right path was `proposals/`.
2020-09-22 21:19:35 +02:00
Javi Martín
6c0fc33842 Merge pull request #4127 from consul/puma_start_after_upgrading_ruby
Make sure Puma has restarted properly
2020-09-22 13:49:09 +02:00
Javi Martín
0e496f9045 Merge pull request #3956 from consul/admin-front
Fix minor design details in admin front
2020-09-22 11:19:23 +02:00
Javi Martín
b1e3c52de0 Merge pull request #4006 from consul/blank_space
Make the admin menu fill the screen vertically
2020-09-22 11:12:18 +02:00
decabeza
c159f9c3b9 Fix icon sortable styles 2020-09-21 16:04:57 +02:00
decabeza
1339885910 Remove admin header box shadow
It has been removed to maintain consistency with the front views.
2020-09-21 16:04:57 +02:00
decabeza
732ad7fd6b Improve styles for admin sidebar
Also add a little animation on arrow when menu opens
2020-09-21 16:04:56 +02:00
Javi Martín
93cf9e22c3 Merge pull request #4005 from consul/off_canvas
Simplify code related to the admin menu
2020-09-21 15:51:05 +02:00
Javi Martín
c362e1190f Simplify main admin header margin rules
Instead of having a header with a bottom margin followed by an element
with a negative margin, it makes more sense to have no margin on either
element.
2020-09-21 15:15:52 +02:00
Javi Martín
7880573635 Make the admin menu fill the screen vertically
On high-resolution screens where neither the menu nor the main content
were filling the screen, there was a blank space at the bottom which
looked weird.
2020-09-21 15:15:52 +02:00
Javi Martín
fc3a7618b1 Simplify method to render admin menu
The `side_menu` helper method isn't necessary since commit 13b3d9cebc.
2020-09-21 15:14:20 +02:00
Javi Martín
a293dc013d Make management layout similar to admin layout
The <main> tag was including the navigation, and now we use the same
flex layout, making it more accessible for mobile phone users.

I'm not sure the <main> tag should actually include the account info and
the flash message. I'm keeping it like this in order to keep the layout
the way it was.
2020-09-21 15:14:20 +02:00
Javi Martín
125106f9c0 Simplify code to have an off-canvas menu
While Foundations's off-canvas menu allows us to forget about writing
CSS, it also leads to complicated HTML.

Ideally Foundation would provide an easy way to simplify what we're
doing, but I haven't found anything in the documentation.

We could simplify the HTML a bit more if we used a CSS grid layout
instead of a flex one, but old browsers have better support for the
latter.

Note we're using `breakpoint(medium)` so we can group the CSS for small
screens and follow SCSS-Lint rules at the same time.

Also note behavior of the main area when the menu appears on small
screens is slightly different: it doesn't move the main content to the
right. I've done it this way so we don't have any overflow issues,
unlike the previous version.

There's a small issue using a label and a checkbox to enable/disable the
menu: sighted keyboard users with a small screen might not be able to
enable the menu. So we're adding the `:focus-within` pseudoclass so the
menu can be normally navigated using the keyboard. Even if old browsers
don't support this pseudoclass, we believe the probability of a sighted
user using a small screen, navigating with the keyboard and using an old
browser is really low, particularly in the admin area.

We're also adding the `aria-hidden` attribute on the label, since the
menu is never hidden for screen readers and so having a control to show
it could be confusing. Since the label is not focusable, we're complying
with the fourth ARIA rule:

> Do not use role="presentation" or aria-hidden="true" on a focusable
> element .
>
> Using either of these on a focusable element will result in some users
> focusing on 'nothing'.
2020-09-21 15:14:20 +02:00
decabeza
2363aa4c76 Avoid using a mixin for side menu and content styles 2020-09-21 15:14:20 +02:00
Javi Martín
4b93437351 Remove unused layout
It isn't used since commit e5f9cf67.
2020-09-18 12:54:02 +02:00
Javi Martín
20b814da7c Merge pull request #4130 from consul/language_mapping
Add Serbian (Cyrillic) new language mapping
2020-09-17 12:20:05 +02:00
Senén Rodero Rodríguez
af987a2a4d Add Serbian (Cyrillic) new language mapping
This language_mapping setting was requested by Crowdin support
team to make Crowdin understand that we want Serbian (Latin)
translations files locale code `sr-CS` and Serbian (Cyrillic) with
locale code `sr`, we were asked to add the same mappings to
Crowdin project settings at [1]

[1] `Project Settings -> General -> Export -> Language mappings`
2020-09-16 16:31:02 +02:00
Javi Martín
40b3c9f2ce Make sure Puma has restarted properly
We were getting an error when restarting Puma after upgrading Ruby. Even
if the restart command was sent successfully, Puma silently crashed and
the log had the following error:

/home/deploy/.rvm/rubies/ruby-2.4.9/lib/ruby/site_ruby/2.4.0/bundler/spec_set.rb:91:in
`block in materialize': Could not find rake-13.0.1 in any of the sources
(Bundler::GemNotFound)

So it looks like the crash happens because Puma was started when the
application used Ruby 2.4 and now when it's restarted it still tries to
use Ruby 2.4, even if the application now uses Ruby 2.5.

I haven't found a proper way to configure Puma so we can avoid this, so
as a workaround I've added the `puma:start` task after restarting Puma.
If Puma was successfully restarted, `puma:start` will do nothing; if
Puma crashed, `puma:start` will start it.

To guarantee the tasks will be executed in the proper order, the tasks
introduced by capistrano3-delayed_job and capistrano3-puma are cleared,
and then we configure the order so first we restart Puma, then restart
the Delayed Jobs processes (so there's enough time for Puma to crash if
Ruby was upgraded) and then start Puma.
2020-09-16 10:53:22 +02:00
Javi Martín
820c1f0d86 Merge pull request #4121 from consul/i18n_crowdin
Update translations from Crowdin
2020-09-15 18:11:49 +02:00
Senén Rodero Rodríguez
da5ecf091d Remove nn-NO locale translations
Crowdin is sending Norwegian (Norway) translations to
`config/locales/nn` folder using the `nn`locale code inside files
and we do not have any other Norwegian dialect active at Crowdin
application so those files seem to not to be needed.
2020-09-15 17:53:54 +02:00
Senén Rodero Rodríguez
761f5f3f93 Fix inconsistent interpolations 2020-09-15 17:53:54 +02:00
Senén Rodero Rodríguez
9694def11a Enable Serbian (Cyrillic)
Consul uses two variants of Serbian: Serbian (Cirylic), and
Serbian (Latin) so wee need to use different locale codes for each of
them to avoid collisions.

The folder names of both languages were correct but the locale code within
the files was the same for both languages "sr" so translations were mixed.

This commit changes the locale code within Serbian (Latin) translations
files to "sr-CS", also adds a new language mapping to the Crowdin config
file so next ConsulBot commits with Serbian (Latin) translations will be
done using the locale code defined at new language mapping.
2020-09-15 17:53:54 +02:00
Senén Rodero Rodríguez
0afc453be4 Fix pt-BR locale code inside files
I realized Crowdin suddenly started to change Portuguese-Brazilero locale
codes so i asked for Crowdin support and they fixed the problem by configuring
an internal post-processor for this project so the reason seems to be some
change on the Crowdin side. I tested it successfully by making a dummy update
on one translation to see if next commits for this language will come with the
right locale ... and it worked nice!
2020-09-15 17:53:54 +02:00
Senén Rodero Rodríguez
795290bf24 Enable languages with higher translation ratio
Following locales are now available by default:

* "bg" (Bulgarian):              98,5% translated
* "ca" (Catalan):               100  % translated
* "es-PE" (Spanish from Perú):   64,8% translated
* "eu" (Euskara):                67,8% translated
* "ka" (Georgian):               98,9% translated
* "oc" (Occitan):                98,9% translated
* "ro" (Romanian):               99,1% translated

Spanish and Euskara were enabled becuase both are near the 70% and its
fallback language (Spanish) is complete.

Add custom fallbacks:

* Catalan (ca)                 => Español (es).
* Español de Perú (es-PE)      => Español (es).
* Euskara (eu)                 => Español (es).
* Portuguese-Brazilero (pt-BR) => Español (es).
* Occitan (oc)                 => French (fr)
2020-09-15 17:53:54 +02:00
Senén Rodero Rodríguez
332a0a7c05 Update translations from Crowdin 2020-09-15 17:53:54 +02:00
Javi Martín
2d24347abe Merge pull request #4114 from rockandror/map_fix
Get map center longitude from correct place
2020-09-15 12:30:53 +02:00
Javi Martín
7a92c6a16f Merge pull request #4122 from consul/fix_translation
Fix dashboard poster intro text
2020-09-15 12:25:09 +02:00
Senén Rodero Rodríguez
6adb9deadc Fix translation 2020-09-14 14:56:21 +02:00
Senén Rodero Rodríguez
a986028794 Get map center longitude from correct place 2020-09-14 14:54:30 +02:00
Javi Martín
a398f4aa13 Merge pull request #4126 from consul/max_headings_text
Clarify the meaning of max "votable" headings
2020-09-09 18:57:39 +02:00
Javi Martín
e66a5f3d09 Merge pull request #4125 from consul/staff_select
Filter investments only by assigned staff
2020-09-09 18:56:10 +02:00
Javi Martín
602daced6b Clarify the meaning of max "votable" headings
The word "vote" is confusing because this option does not apply to the
voting phase, but to the selecting projects phase.
2020-09-09 17:01:13 +02:00
Javi Martín
cd418e45be Allow hints on select fields
Just like we allow them on input fields.
2020-09-09 12:20:46 +02:00
Javi Martín
5332ae609e Filter investments only by assigned staff
In commit 74083df1 we added the possibility to assign administrators and
valuators to budgets, so they would only manage the budgets they're
assigned to.

However, when filtering projects, we were still showing all
administrators and valuators as options to filter investments. It makes
more sense to only show the valuators and administrators assigned to the
current budget.

Note this change only affects the view, and so malicious users could
technically send any other administrator or valuator ID. In this case,
they would get empty results since those administrators/valuators
wouldn't have any investments assigned, so taking this case into account
is not necessary.
2020-09-08 19:11:38 +02:00
Javi Martín
4a5d4b3c0b Group investment search form methods together
We had helper methods all over the place which were only used in one
view. Since we're going to change some of them to use the budget as a
parameter, they don't belong in those helpers anymore.

Note the method `budget_heading_select_options` is used in more places,
so we're keeping it where it was.
2020-09-08 18:35:16 +02:00
Javi Martín
e4c1a8cf45 Merge pull request #4065 from consul/legislation_summary
Add collaborative legislation summary
2020-09-08 13:49:45 +02:00
Javi Martín
b2b64ca8a0 Add link to download summary in XLSX format again
It was removed in commit 128a8164 alongside everything related to the
legislation process summary.

Co-Authored-By: taitus <sebastia.roig@gmail.com>
2020-09-08 13:32:08 +02:00
Javi Martín
14df74fed7 Add collaborative legislation summary again
It was removed in commit 128a8164 because we hadn't reviewed it nor
tested it properly. We're now adding it again, fixing the issues we've
found while reviewing.
2020-09-08 13:32:08 +02:00
Javi Martín
a8a79fe97f Extract mixin to add font awesome icons
This way we can simplify the HTML and easily apply font awesome icons to
any element.

Note the mixin uses `extend`, which we generally try to avoid. It's OK
in this case, since `fa-` classes only have one rule, affecting the
content of its `::before` pseudo-element. Unfortunately we can't use
`include fa-content($fa-var-#{$icon})` because it's not valid SCSS. We
could make the mixin accept an icon instead of an icon name, and call it
using `has-fa-icon(r, $fa-var-plus-square)`. However, IMHO that would
make the code a bit more complex with no real benefit.
2020-09-08 13:32:08 +02:00
Javi Martín
18e99ac069 Merge pull request #4116 from consul/remove-deprecated-columns
Remove deprecated columns
2020-09-08 12:51:45 +02:00
taitus
f90c09bea7 Remove deprecated attributes from Proposals
Some fields from Proposals are deprecated and we no longer need them.
2020-09-08 12:13:21 +02:00
taitus
086b0366a2 Remove deprecated attributes from Debates
Some fields from Debates are deprecated and we no longer need them.
2020-09-08 12:13:13 +02:00
taitus
5eed36ca8e Remove deprecated attribute from Comments
A field from Comment is deprecated and we no longer need it.
2020-09-08 12:13:01 +02:00
taitus
e39b72d945 Remove deprecated attributes from Investments
Some fields from Investment are deprecated and we no longer need them.
2020-09-08 12:12:43 +02:00
Javi Martín
1c8b5a05b5 Merge pull request #4115 from consul/consistency-schema
Update columns type of attachment file
2020-09-08 11:51:32 +02:00
taitus
819e2c82ce Add migration to change columns type of attachments
As suggested in the paperclip update discussed in the previous commit,
we force the type of these fields to be bigint.
2020-09-08 11:02:13 +02:00