Commit Graph

11379 Commits

Author SHA1 Message Date
decabeza
689b25c977 Adds tab-milestones anchor to link and milestone image 2018-11-06 13:02:34 +01:00
decabeza
a03c13aa22 Updates executions texts 2018-11-06 13:02:34 +01:00
decabeza
eb76f644b7 Adds link to heading name on sidebar 2018-11-06 13:02:34 +01:00
decabeza
c7936bacae Adds styles to budgets execution 2018-11-06 13:02:34 +01:00
Angel Perez
2a3ce0b182 Render winner investments under 'Executions' tab 2018-11-06 13:02:34 +01:00
Angel Perez
5de74ea6f1 Load budget headings on budgets/executions#show action 2018-11-06 13:02:34 +01:00
Angel Perez
0a95abc30d Replace budget execution heading route with anchor link 2018-11-06 13:02:34 +01:00
Angel Perez
6559c7212b Add prompt & label for milestones filters under budgets/executions#show 2018-11-06 13:02:34 +01:00
Javi Martín
4f878180e5 Move creation of milestone statuses seeds
So it's in the same lines as in Madrid's repository.
2018-11-06 13:02:30 +01:00
Raimond Garcia
e6f8814c28 Merge pull request #2998 from consul/i18n-uptade-crowdin
Update i18n from Crowdin
2018-11-06 12:54:46 +01:00
voodoorai2000
f79f219f2c Fix date translations 2018-11-06 11:42:51 +01:00
dependabot[bot]
6a30c01c1d Bump rspec-rails from 3.7.2 to 3.8.1
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 3.7.2 to 3.8.1.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/master/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v3.7.2...v3.8.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-06 06:27:46 +00:00
dependabot[bot]
75a7ab6a85 Bump uglifier from 4.1.3 to 4.1.19
Bumps [uglifier](https://github.com/lautis/uglifier) from 4.1.3 to 4.1.19.
- [Release notes](https://github.com/lautis/uglifier/releases)
- [Changelog](https://github.com/lautis/uglifier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lautis/uglifier/compare/v4.1.3...v4.1.19)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-06 06:27:21 +00:00
dependabot[bot]
b6f7cd7193 [Security] Bump rack from 1.6.10 to 1.6.11
Bumps [rack](https://github.com/rack/rack) from 1.6.10 to 1.6.11. **This update includes security fixes.**
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/1.6.10...1.6.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-06 06:26:22 +00:00
decabeza
cb2b2ac965 Merge branch 'master' into i18n-uptade-crowdin 2018-11-05 19:07:37 +01:00
voodoorai2000
f4c35eb948 Add one more PR to Changelog 2018-11-05 18:20:51 +01:00
voodoorai2000
160ca317c5 Update version number for consul.json 2018-11-05 18:20:51 +01:00
decabeza
79e1ec444c Fixes houndci-bot warnings 2018-11-05 18:20:51 +01:00
decabeza
a218f8cced Improves some code format details 2018-11-05 18:20:51 +01:00
voodoorai2000
54950d14c9 Add Changelog for release 0.17 2018-11-05 18:20:51 +01:00
Javi Martín
745c9cd72b Don't check already present page content
The content 'An example legislation process' is already present before
we click the "All" link.

Not checking the page content properly sometimes resulted in the second
click being executed before the first request had been completed, making
the spec fail.

By checking the "All" link isn't present anymore, we guarantee the
request has been completed before trying to click the 'An example
legislation process' link.
2018-11-05 18:20:51 +01:00
decabeza
1a15cb6a42 Refactors social meta tags spec 2018-11-05 18:20:51 +01:00
decabeza
816f0c55c0 Adds new social share partial for proposals 2018-11-05 18:20:51 +01:00
voodoorai2000
ac7d1ebf27 Increase delayed jobs max run time 2018-11-05 18:20:50 +01:00
voodoorai2000
bfe9ae6ab0 Add counter of emails sent to newsletter preview 2018-11-05 18:20:50 +01:00
Javi Martín
a8d2fbab57 Remove described class cop
We've agreed `User.new` is easier to read than `described_class.new` and
since we are ignoring Hound's comments regarding this topic, we might as
well remove it.
2018-11-05 18:20:50 +01:00
Javi Martín
dc13533371 Make Capybara check the page between comment votes
As pointed out in PR consul#2734:

"After clicking the first link, there's an AJAX request which replaces
the existing `.in-favor a` and `.against a` links with new elements. So
if Capybara tries to click the existing `.against a` link at the same
moment it's being replaced, clicking the link won't generate a new
request".

Making Capybara check the page for new content before clicking the
second link solves the problem.

This commit solves issues afecting both Madrid's fork and the original
CONSUL repo.
2018-11-05 18:20:50 +01:00
Javi Martín
a7a9355a58 Enable SCSS rules in Hound 2018-11-05 18:20:50 +01:00
Javi Martín
6a42f6fee2 Add basic rubocop configuraton for Hound
This way we can ask contributors to follow some basic guidelines like
removing trailing whitespaces while not overwhelming them with all our
rules.
2018-11-05 18:20:50 +01:00
Javi Martín
bf79ddb858 Remove rubocop_todo file
No developers are maintaining it anymore.
2018-11-05 18:20:50 +01:00
Javi Martín
70195a1c91 Fix bug with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`record.title_pt-BR` would raise an exception.

Using globalize's `localized_attr_name_for` method fixes the bug.

Thanks Marko for the tip.
2018-11-05 18:20:50 +01:00
Javi Martín
adf03b9e1b Don't abort the migration if the simulation fails
We think aborting the migration will generate more headaches to system
administrators, who will have to manually check and fix every invalid
record before anything can be migrated.
2018-11-05 18:20:50 +01:00
Javi Martín
10b0d8232d Add task to simulate data migration
This way we can check everything is OK before actually migrating the
data to the translations tables.
2018-11-05 18:20:50 +01:00
Javi Martín
9b671a8132 Log failed data migrations
In theory, it should never happen, but that's why exceptions exist.
2018-11-05 18:20:50 +01:00
Javi Martín
b9906209ea Use migrate_data option for globalize
This way the task to migrate the data doesn't have to be run manually if
these migrations weren't already executed.
2018-11-05 18:20:50 +01:00
Javi Martín
232d5b0edd Migrate custom pages data to their locale 2018-11-05 18:20:50 +01:00
Javi Martín
c774ae67a0 Add task to migrate data to translation tables
We forgot to do it when we created the translation tables, and so now we
need to make sure we don't overwrite existing translations.
2018-11-05 18:20:50 +01:00
Javi Martín
c9fadc7c3d Fix poll question with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`title_pt-BR=` would raise an exception.
2018-11-05 18:20:50 +01:00
Javi Martín
8f4d600b47 Fix spec assuming German isn't available
Since we've recently added German to the available languages, and we
might support every language in the future, we're using the fictional
world language to check a locale which isn't available.

Another option could be to set the available locales in the test
environment (or the rspec helper), but then we'd have to make sure it's
executed before the call to `globalize_accessors` in the model, and it
might be confusing for developers.
2018-11-05 18:20:50 +01:00
Javi Martín
0f759f1e16 Extract method to render form fields for a locale 2018-11-05 18:20:50 +01:00
Javi Martín
c8d3c8fc1b Use detect instead of select.first 2018-11-05 18:20:50 +01:00
Javi Martín
b745ddc9dd Simplify code checking whether to enable a locale 2018-11-05 18:20:50 +01:00
Javi Martín
7f5f144837 Don't run specs if there are custom fallbacks
This spec depends on French falling back to Spanish and was failing on
forks using a different fallback.
2018-11-05 18:20:50 +01:00
Javi Martín
0c1228a7ce Fix crash with no translation for default locale
When we were visiting a page showing the content of a record which uses
globalize and our locale was the default one and there was no
translation for the default locale, the application was crashing in some
places because there are no fallbacks for the default locale.

For example, when visiting a legislation process, the line with
`CGI.escape(title)` was crashing because `title` was `nil` for the
default locale.

We've decided to solve this issue by using any available translations as
globalize fallbacks instead of showing a 404 error or a translation
missing error because these solutions would (we thinkg) either require
modifying many places in the application or making the translatable
logic even more complex.

Initially we tried to add this solution to an initializer, but it must
be called after initializing the application so I18n.fallbacks[locale]
gets the value defined in config.i18n.fallbacks.

Also note the line:

fallbacks[locale] = I18n.fallbacks[locale] + I18n.available_locales

Doesn't mention `I18n.default_locale` because the method
`I18n.fallbacks[locale]` automatically adds the default locale.
2018-11-05 18:20:50 +01:00
Javi Martín
98cfe8c503 Remove question option uniqueness validation
Having translations makes this validation too complex and not worth the
effort, since now we can't just scope in a single column but we need to
scope in the translations locale and the question ID.
2018-11-05 18:20:50 +01:00
Javi Martín
cf4c30b143 Prefix classes used in JavaScript with "js-"
The same way it's done in the rest of the application.
2018-11-05 18:20:50 +01:00
Javi Martín
d10f07b0b4 Make it easier to know destroy_field is an input
By using the input and finding it by its name, it's easier to see the
difference between this input and the delete-language link.
2018-11-05 18:20:50 +01:00
Javi Martín
9aa07e3b74 Follow naming conventions for HTML classes and IDs
We use underscores for IDs and hyphens for classes.
2018-11-05 18:20:50 +01:00
Javi Martín
f475f4ff3f Remove reference to site customization page locale
We don't use that attribute since we added translations for this model.
2018-11-05 18:20:50 +01:00
Javi Martín
ed990c24d0 Fix "Add option" link position
The new options were being added inside the `.column` div, when they
needed to be added before it.
2018-11-05 18:20:50 +01:00