Commit Graph

952 Commits

Author SHA1 Message Date
Javi Martín
a21240b230 Use Date.current and Time.current
Using Date.today and Time.now might lead to inconsistencies if the time
zone the application uses is not the same as the system time zone.
2019-08-28 20:32:40 +02:00
Javi Martín
e64289c5f9 Fix double quotes inside double quotes
The interpolation was being evaluated as a comment.
2019-08-27 17:22:22 +02:00
Javi Martín
0b55097820 Remove system count from old booth assigments
This number was not the important one; the important one is the one
given by the recounts.

Note we're also removing the votes by date, since they're also system
votes.
2019-08-07 20:31:45 +02:00
Javi Martín
bddfee2b86 Remove system count column for old polls
System count isn't a relevant number because the important one is the
number of votes counted by poll officers. We're still maintaining it for
a month in case poll officers would like to review the results.
2019-08-07 20:31:45 +02:00
Javi Martín
bd85aede99 Use describe on new feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.

We're also adding a rubocop rule so we dont' accidentally add these
keywords again.
2019-08-07 13:53:27 +02:00
taitus
1788df3cf7 Add new translations
- Add new translations on SignatureSheet show page.
  Changes:
   -> "document number" to "sigantures"
   -> "documents" to "users"

- Remove unused translations from the others yml
2019-07-29 13:10:09 +02:00
taitus
626d2b3c2b Allow to Signature works with CustomCensusAPI
- Send new fields to CensusCaller call method to
  allow use on CustomCensusAPI
2019-07-29 13:10:09 +02:00
taitus
0bf88abcf1 Allow to SignatureSheet parse new fields
- In the previous version, each signature was equivalent to a document
  and we separated them by commas.
  Now each signature may also need the fields birth date and postal code.
  So we separated each signature with a semicolon and separated each of
  its fields by commas.
  Example old version: "12345678X, 87654321Y"
  Example new version:
  "12345678X, 31/12/1980, 28001; 87654321Y, 31/12/1981, 28002"

- Update translations:
 "Write the numbers separated by commas (,)" to
 "Write the numbers separated by semicolons (;)"
2019-07-29 13:10:09 +02:00
taitus
837c45599d Rename SignatureSheet column
This new functionality will allow to retrieve in the signature sheet
the document number, the date of birth and the postal code.

So we renamed :document_numbers to :required_fields_to_veriry to
clarify and adjust the name to its use.
2019-07-29 13:10:09 +02:00
taitus
9e94cf060e Refactor specs 2019-07-29 13:10:09 +02:00
taitus
71af3e8789 Add :tab param to others calls to _setting_table partial
Allow redirect to their tab after update a Setting
2019-07-29 13:10:09 +02:00
taitus
ca0979bd45 Allow redirect to remote census configuration tab
Currently after each update of any Settings is redirected to the first
tab by default.
As this new tab remote_census_configuation has a lot of fields to fill
in it is a bit uncomfortable to have to go back to the tab after each
update.

- Add hidden field :tag to set current tag value
- After update add tag value to request.referer
- To avoid errors when partial call has not param :tag, add the "define?"
  method on hidden_field value.
2019-07-29 13:10:09 +02:00
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
Senén Rodero Rodríguez
b4d13816fa Add feature specs 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
12d20b481d Fix error during rebase 2019-07-01 16:40:24 +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
Senén Rodero Rodríguez
f7417d6479 Adapt specs to new translations interface markup 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
3176be43d9 Rename "translatable" shared example to "edit_translatable"
Also rename all specs calls
2019-06-27 09:20:25 +02:00
Senén Rodero Rodríguez
661ca5a568 Add budget investments translation interface
* Adapt translatable spec helper method to work with budget investments
* Remove old attributes from strong parameters
* Add missing locales to admin.yml and budgets.yml
* Change SpendingProposal.title_max_length and
  SpendingProposal.description_max_lenght to Budget::Investment methods
* Add budget investment translatable attribute translations
2019-06-27 09:20:24 +02:00
Senén Rodero Rodríguez
5eb5f02cbe Fix budget investment specs
After adding investment translatable fields to forms, they will be
generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:20:24 +02:00
Senén Rodero Rodríguez
bb2ee6dd3c Fix search_by_title_or_id method
Results were not including records without translations for current
locale (I18n.locale). Now we search for given title against all
translation fallbacks for current locale.
2019-06-27 09:20:24 +02:00
Senén Rodero Rodríguez
7c137faf53 Fix broken spec
Use existing I18n translations in broken spec.
2019-06-27 09:19:37 +02:00
lalo
23d36835d7 Add Admin changes to create Poll:Questions with votation type 2019-06-12 19:44:14 +02:00
German Galia
74083df10f Add historic fields to participatory budget 2019-06-12 18:03:53 +02:00
German Galia
9ce524e1f3 Create tracker rol 2019-06-12 16:23:40 +02:00
German Galia
16ffa2a259 Add change log in investment participatory budget 2019-06-12 13:06:20 +02:00
Raimond Garcia
259e05c3e0 Merge pull request #3410 from LextrendIT/report_generation
Report generation, download CSV
2019-06-12 11:45:59 +02:00
German Galia
9d1ca3bfd4 Report generation. Download csv 2019-06-12 10:17:31 +02:00
Raimond Garcia
22787151f5 Merge pull request #3439 from LextrendIT/feature/add_admin_investments_column_chooser
Add columns selector JS component and change Rails view to use it
2019-06-11 17:17:52 +02:00
lalo
c2860dda0e Add can_comment and can_edit_dossier abilities to valuators 2019-06-11 16:24:02 +02:00
Raimond Garcia
d266cb33ce Merge pull request #3427 from LextrendIT/feature/unify_valuator_and_admin_investment_pages
Display preview public page component on admin and valuators investment page
2019-06-11 14:44:45 +02:00
Julian Nicolas Herrero
c7ea0528e0 Merge pull request #3603 from consul/admin_stats_before_voting_phase
Avoid error when accessing final voting stats before the balloting phase
2019-06-11 14:34:42 +02:00
lalo
4740aeaddf Add columns selector JS component and change Rails view to use it 2019-06-11 14:33:40 +02:00
Julian Herrero
fd71ed825b Avoid error when accessing final votes stats before balloting phase
When accessing the URL `/admin/stats/budget_balloting?budget_id=X'
for a budget in a phase prior to the balloting phase, the following
error was raised due to the stats where not calculated yet.
Instead, we'll now show a flash message.

NoMethodError:
  undefined method `[]' for nil:NilClass
  ./app/controllers/admin/stats_controller.rb:82
2019-06-10 17:28:16 +02:00
lalo
be8a0dbe8a Add Milestone tag select filter on executions public page 2019-06-07 14:17:32 +02:00
lalo
63e0cd02d0 Display milestone_tags input for investments, display milestone_tags on admin and tests 2019-06-07 14:07:43 +02:00
Raimond Garcia
a874d25bfa Merge pull request #3413 from LextrendIT/feature/notify_evaluation_comments
notify by email new evaluation comments
2019-06-06 11:29:38 +02:00
Javier Martín
72c6b05c64 Merge pull request #3376 from LextrendIT/3350_rename_debates_comments_admin
Refactor admin/debates and admin/comments to hidden
2019-06-05 19:15:21 +02:00
Julian Nicolas Herrero
7802305b18 Merge pull request #3585 from consul/images_and_documents_settings
Images and documents settings
2019-06-05 19:11:22 +02:00
Javier Martín
81b67349f2 Merge pull request #3580 from consul/use_find_instead_of_find_by_id
Use find instead of find by
2019-06-05 19:04:47 +02:00
lalo
28815cb290 Create new email template for new evaluation comment created and add it to system_emails view 2019-06-05 16:22:12 +02:00
lalo
d0e1eff532 Add description field to administrator users like evaluators description 2019-06-05 16:18:12 +02:00
Julian Herrero
220bfb065a Add images and documents settings to admin panel 2019-06-04 11:47:22 +02:00
lalo
c538d08fee Display public investment view on admin and valuator pages as preview 2019-06-04 09:30:51 +02:00
Julian Herrero
b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +02:00