Commit Graph

15065 Commits

Author SHA1 Message Date
taitus
12b6b1df05 Add new param to partial '_setting_table'
When we reuse the partial '_setting_table' to render the 3 types
of remote census settings, we need customize setting_name key by
default to clarify the information to render.

- Add new param 'setting_name' to partial '_setting_table'
- Create new setting helper method to use new setting_name param
  to display a more clarify setting name on table.
2019-07-29 13:10:09 +02:00
taitus
0a901cb82f Enable remote census configuration when remote census is active
According to the feature setting["remote_census"]:
  - Display info to enable tab when remote_census feature is disabled.
  - Display all related setting to remote_census when feature is enabled
2019-07-29 13:10:09 +02:00
taitus
637675a1f5 Add content to the Remote Census Configuration tab
- Render remote census configuration content on settings index.
 - Update type method from Setting
   On Admin::SettingsController#index we are using 'all_settings' to
   group all settings by 'type' method.
   'type' method return the first part of key when split by '.'
   To allow use by example: all_settings["remote_census.general"]
   and recover only settings related with this key we have added new
   'elsif' on 'type' method.
2019-07-29 13:10:09 +02:00
taitus
3df856ff7e Add new Settings related to the remote census
These Settings will store all the values needed to
connect to the remote census.
2019-07-29 13:10:09 +02:00
taitus
db7ca9b4f4 Add new settings tab 'Remote Census Configuration'
This tab shows all settings related to the connection
configuration to the remote census.
2019-07-29 13:10:09 +02:00
taitus
f6beff91be Add new feature setting 'remote_census'
It will allow to enable remote census configuration.
2019-07-29 13:10:09 +02:00
Senén Rodero Rodríguez
b4d13816fa Add feature specs 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
76e474db67 Specify load_and_authorize class to cancancan to avoid class loading errors
After adding new namespace `admin/local_census_records` cancancan
`load_and_authorize` method started to crash because it was getting
confused when loading and authorizing controller resources. Specifying
class to load and authorize solves this situation.
2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
afd3644ace Activate menu entry when administrator is at importation pages 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
1c6775ecc4 Add link to new importation to local census records index page 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
9b5f5e653a Add local census importations controller 2019-07-29 13:07:24 +02:00
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