Commit Graph

13901 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
615bfadca8 Add local_census_records importation model
This model without database allow us to validate incoming file extension and
headers and also does the following during importation process:

* Ignore empty rows
* Classifiy rows in two groups: created_records, invalid_records
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
0239efef9d Allow administrators to run local census records importation
Allow only administrator users to run local census records importation
process
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
d221198106 Use sequence for local_census_record factory
After adding uniqueness validation we need this to be able to create many local_census_records
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
3c39dccad4 Add uniqueness validation to document_number and document_type pair 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
d1587ecc62 Add sanitization to clear trailing whitespaces 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
c4ef33e6f8 Add index to local census records document_number
This will speed up searching by document_number
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
c72f4bfabf Add the ability to destroy a local census record 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
a8a3f334ce Add edit and update actions 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
fd7cc624db Add new and create actions 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
f071ca6cb5 Create LocalCensusRecords index page
* Create admin controller and routes
* Add pagination
* Add search by document_number
* Add EN and ES translations
* Add index specs
* Add missing model specs
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
76400a8c23 Add LocalCensusRecords link to admin menu
* Add to menu as a Settings sub-options
* Add translations for EN and ES locales
* Activate menu sub-option when user is at any LocalCensusRecords page
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
5fa1bd8a6f Allow administrator users the ability to manage all LocalCensusRecords
Also check that other kind of users are not able to manage
LocalCensusRecords.
2019-07-29 13:07:24 +02:00
Raimond Garcia
b9574b3179 Merge pull request #3359 from consul/translations
Translate user generated content
2019-07-23 14:53:48 +02:00
Raimond Garcia
7a00590fd0 Merge pull request #3599 from rockandror/block-updates-without-translations
Block translatable resource updates with no translations
2019-07-05 21:28:06 +02:00
Raimond Garcia
14c1bbb812 Merge pull request #3579 from rockandror/translations-new-interface
Responsive translation interface
2019-07-05 21:26:19 +02:00
Senén Rodero Rodríguez
907fc18ff7 Override translations _destroy value depending of our translations managment logic
During any translatable resource edit, if you remove all translations
you will be redirected to same form with errors showing you one of
persisted but marked to destroy translations, without this patch
_destroy field value wil be true and you will no able to persist without
re-addding the same language through translation interface.
2019-07-02 17:15:39 +02:00
Senén Rodero Rodríguez
966b5b19ba Mark all translations that do not exist for destruction
When a translation not exists yet we can mark them all for destruction
by default. They already should be initialized correctly from database
or via nested attributes.
2019-07-02 17:15:34 +02:00
Senén Rodero Rodríguez
58164ee2ec Show validation error at translation interface
Only when present
2019-07-02 17:15:27 +02:00
Senén Rodero Rodríguez
041abe9044 Add persisted but marked for destruction translations to logic
Now we take into consideration locales persisted but marked for
destruction to complete some logic and to be able to show best
translations on different situations.
2019-07-02 17:15:22 +02:00
Senén Rodero Rodríguez
d3422acbb7 Add validation to check translations amount on updates
In order to not allow users to remove all persited
translations from any resource. A few exceptions were
added:

* Does not apply to globalizable models without
   translatable attributes required
* Make a copy of main model error on current translations to be more realistic
2019-07-02 17:15:16 +02:00
Senén Rodero Rodríguez
12d20b481d Fix error during rebase 2019-07-01 16:40:24 +02:00
taitus
58962186cd Add tracking as backend path 2019-07-01 15:03:48 +02:00
taitus
a5a62b7471 Add Tracking to backend_translations_enabled? 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
b86c0d3c30 Delete unused file
This file was used at previous version of translation
interface.
2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
97eab7445d Move translations from admin.yml to general.yml
After extract translation interface partials from admin
folder translations should be placed in general.yml file
inside shared context.
2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
7f754e5c8f Add row wrapper to form 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
10939fddb1 Add missing translation and fix indentation 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
b2d8851bcc Add the option to disable languages managment to cover special cases
We understand languages management as the ability to add new languages
or remove existing ones. When no option is passed it will allow language
manipulation by default.

There are 3 special places where we want block languages management:
- admin legislation processes homepage
- admin legislation processes milestones summary
- proposals retired form

Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
2019-07-01 15:03:48 +02:00
taitus
0602a38742 Fix Style: Display Titles without highlight 2019-07-01 15:03:48 +02:00
taitus
f3022b2cec Align admin widget cards form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
220a5fc684 Align admin site customization pages form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
12089282c8 Align admin progress bars form fields with new translations interface
Add new js method to recover selected language to disable correctly default language fields.
2019-07-01 15:03:48 +02:00
taitus
c1a72e7169 Align admin polls questions answers form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
9f98435789 Align admin polls questions form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
bca9364c64 Align admin polls form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
000c6c5911 Align admin active polls form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
a700ea2fce Align admin milestones form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
c9eaeffaf2 Align admin legislation questions form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
27a3ff28d3 Align admin legislation processes form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
1d4bde46d6 Align admin legislation milestones summary form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
9695b0c720 Align admin legislation homepages form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
a7dcc61ab4 Align admin legislation draft version form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
944e502605 Align admin budget form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
44ee8aa0c0 Align admin budget_headings form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
fb39e6c09e Align admin budget_groups form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
6c0f9165c7 Align admin budget_phases form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
cd5095cf68 Align admin_notifications form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
07577a050c Cover special translation interface behavior at admin information texts
When not yet exists I18nContentTranslation languages,
SiteCustomization::InformationText section render I18n.locale by
default. This was causing that `languages in use` description and
default selected language were incorrectly initialized.
2019-07-01 14:49:44 +02:00
Senén Rodero Rodríguez
0bbc6be141 Add specs to check how visibility of translations interface behaves
Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
2019-07-01 14:49:44 +02:00
Senén Rodero Rodríguez
c0b4bb67eb Adapt shared specs to new translations interface 2019-07-01 14:49:44 +02:00