Commit Graph

9813 Commits

Author SHA1 Message Date
voodoorai2000
59b35156b1 Fix flaky spec
`I18n.available_locales=` does a little magic[1] and was causing some flakieness along the way, as the `:wl` locale persisted in future specs

Thanks for the heads up @javierm 👌

[1] https://www.rubydoc.info/github/svenfuchs/i18n/I18n%2FConfig:available_locales=
2018-10-09 22:15:05 +02:00
voodoorai2000
6f978b9f4e Fix portuguese specs 2018-10-09 18:32:59 +02:00
voodoorai2000
ad51109149 Remove duplicate language translation 2018-10-05 18:08:48 +02:00
voodoorai2000
168ebe3c8b Fix i18n task' specs
Add i18n.yml to i18n task's available translation files
2018-10-05 18:08:47 +02:00
voodoorai2000
9d7042c5ae Adds missing language name translations 2018-10-05 18:08:47 +02:00
voodoorai2000
66c9f6711b Removes obsolete locale keys for language names 2018-10-05 18:08:47 +02:00
voodoorai2000
0a0261900c Display language name or language key
There where two issues with the current implementation:

- There was a possible duplication between looking up the language name in key "locale" and in key "i18n.language.name"

- The "default" option was not being picked up, as the fallback always returned the default locale's translation, "English"

With this implementation there is only a single place to put the language name: i18n.language.name. I think this place is easier to find and understand for Crowdin translators than a "locale" key hidden in general.yml

If the translation is not found we display the language key, instead of English, which makes more sense to me too 😌

Solution based on recent comments[1] on a related I18n issue

[1] https://github.com/svenfuchs/i18n/issues/365#issuecomment-419263847
2018-10-05 18:08:41 +02:00
Javier Martín
c7a21e546d Merge pull request #2946 from consul/backport-customize_proposals_view
Simplify legislation proposals customization
2018-10-04 13:01:48 +02:00
Javi Martín
acbf20c938 Extract partial for proposals content 2018-10-03 22:07:55 +02:00
Javi Martín
f93281fd02 Extract link text to a helper
This way we can use the same code in custom views which won't use the
same text.
2018-10-03 22:06:20 +02:00
Javi Martín
ec18743251 Authorize resource after authenticating user
Just like it's done everywhere else in the application. Not doing so
means users who aren't logged in receive a "you aren't authorized"
message when they try to create a new legislation proposal instead of
being redirected to the login page.
2018-10-03 22:06:20 +02:00
Javi Martín
8064b53aad Add variety to legislation process dev seeds
This way different processes will be in different phases and it will be
easier to test the application locally.
2018-10-03 22:06:19 +02:00
Javi Martín
5ab8587ad2 Use absolute translation paths
Using `t(.empty_proposals)` IMHO is a bit dangerous because we'd need to
change the locale files if we move the code to a partial or rename the
file.
2018-10-03 22:05:33 +02:00
Javier Martín
5c1d1882ab Merge pull request #2945 from consul/backport-legislation_proposals
Add admin permissions in legislation proposals
2018-10-03 21:44:35 +02:00
María Checa
388c1a9bd9 Improved tests 2018-10-03 16:02:41 +02:00
María Checa
d73be15296 Added tests 2018-10-03 16:02:41 +02:00
María Checa
056086e81e Allow admins to see legislation debates and proposals index 2018-10-03 16:02:12 +02:00
María Checa
6d5e1a075e Allow admins to access Legislation::Proposal #show and Legislation::Process #proposals 2018-10-03 16:01:18 +02:00
Javier Martín
127eef3856 Merge pull request #2942 from consul/backport-feature/random_legislation_proposal
Random legislation proposal's order & pagination
2018-10-03 15:59:21 +02:00
Bertocq
df3df71a54 Force postgresql setseed value in correct range
This commit partially backports commit AyuntamientoMadrid@f038399 by
taking only the parts affecting code already in CONSUL's main
repository.
2018-10-03 13:46:32 +02:00
Bertocq
c04b0ceda4 Add pagination to legislation process proposals list 2018-10-03 13:46:32 +02:00
Bertocq
52df63c2aa Add legislation proposal feature scenario to check random order is consistent with pagination 2018-10-03 13:46:32 +02:00
Bertocq
89b8e51a93 Add helper function to get legislation proposals list order on feature spec 2018-10-03 13:46:32 +02:00
Bertocq
d36e47c740 Add legislation proposal spec, with random list order scenario 2018-10-03 13:46:00 +02:00
Bertocq
845f0094b5 Add proposal phase values to legislation process factory 2018-10-03 13:40:59 +02:00
Bertocq
349abffb20 Add random order based on seed to legislation process proposals list 2018-10-03 13:40:59 +02:00
Bertocq
599ddf8f41 Create @proposal variable con process controller for proposals list that use random seed 2018-10-03 13:40:59 +02:00
Bertocq
4ab9b8b767 Move onto proposals method the random seed call 2018-10-03 13:40:59 +02:00
Bertocq
0cabede68c Add random seed on Legislation Proposal controller for index 2018-10-03 13:40:59 +02:00
Javier Martín
132fea9c94 Merge pull request #2913 from papayalabs/2741-updates-translatable-custom-pages-reloaded
Updates translatable custom pages
2018-10-03 13:23:13 +02:00
Javier Martín
2775ae2b50 Merge pull request #2924 from consul/backport-1588-make-homepage-content-translatable
Make homepage content translatable
2018-10-03 13:20:49 +02:00
Alberto
857f747ab8 Merge pull request #2922 from consul/legislation-proposals-imageable
Legislation proposals imageable
2018-10-02 11:22:19 +02:00
decabeza
aa76251d1d Adds image to legislation proposals views 2018-10-01 16:49:22 +02:00
decabeza
7c194f6042 Adds imageable to legislation proposals 2018-10-01 16:48:46 +02:00
Javier Martín
ea429cb4ac Merge pull request #2925 from consul/backport-rubocop_whitespace
Update rubocop rules
2018-10-01 13:41:10 +02:00
Javier Martín
ad443fa03a Merge pull request #2933 from consul/help-feature
Feature help page
2018-10-01 13:38:38 +02:00
decabeza
dd11a040a6 Adds setting to enable or disable help page 2018-09-28 18:59:28 +02:00
Papaya Labs
3f9dea080b Check title and slug in spec 2018-09-28 09:43:00 +02:00
Papaya Labs
5a4b9b0810 Remove trailing whitespaces 2018-09-27 14:36:23 +02:00
Papaya Labs
914bfa645e Updates translatable custom pages 2018-09-27 13:46:17 +02:00
Javi Martín
f9bfa450d6 Add percent literal delimiters to rubocop rules
As developers agreed upon.
2018-09-26 17:11:59 +02:00
Javi Martín
ad1e044e0a Add trailing newline rule to rubocop
Just like we're suggesting when we do code reviews and like the rule
we've enabled in SCSS-Lint.
2018-09-26 17:11:59 +02:00
Javi Martín
2545d49aed Don't allow trailing whitespaces in rubocop
Luckily we don't have any trailing whitespaces around, but we might
accidentally introduce some.
2018-09-26 17:11:59 +02:00
Javi Martín
1ffaa680a3 Create correct translation when visiting root page
We set `I18n.locale = :en` before each test, and so creating a new card
will automatically create English translations.

So visiting the Spanish page won't show the card, since no Spanish
translation exists for it. If we visit the klingon page after doing so,
the last used locale (Spanish) will still be used, and so the test will
fail.

Specifically creating Spanish translations instead of the English ones
makes the translations visible when visiting the Spanish homepage.
2018-09-26 16:09:09 +02:00
Marko Lovic
832e6178d7 Add Spanish translation to Card seed data
Instead of using I18n for the field texts and forcing the
locale (e.g. `I18n.t('seeds...', locale: :es)`), I'm moving
content out of `config/locales/` and into the seed file.

This is because this content is less about reacting to different
locales (the locale would always be forced so we don't actually
use the main i18n functionality), and more about demonstrating
the "translatable fields" feature.
2018-09-26 16:09:09 +02:00
Marko Lovic
86dbe799ba Remove extra tag element from cards form 2018-09-26 16:09:09 +02:00
Javi Martín
5bb5cfa7fb Make Widget::Card translatable 2018-09-26 16:09:09 +02:00
Raimond Garcia
2c22ab347d Merge pull request #2891 from consul/dependabot/bundler/savon-2.12.0
Bump savon from 2.11.2 to 2.12.0
2018-09-26 15:48:57 +02:00
Raimond Garcia
03e454585a Merge pull request #2905 from consul/dependabot/bundler/coveralls-0.8.22
Bump coveralls from 0.8.21 to 0.8.22
2018-09-26 15:47:22 +02:00
Raimond Garcia
1e23548e39 Merge pull request #2908 from consul/dependabot/bundler/ancestry-3.0.2
Bump ancestry from 3.0.1 to 3.0.2
2018-09-26 15:45:55 +02:00