Commit Graph

381 Commits

Author SHA1 Message Date
Javi Martín
354b183e17 Create reports
This table will store which reports (stats, results, ...) will be shown
for a certain process (polls, budgets, ...).

Note Rails fails to save a poll and its report when both are new records
if we add a `validate :process, presence: true` rule. Since it caused a
lot of trouble when creating records for tests during factories rule
completely. Instead, I've created the `results_enabled=` and
`stats_enabled=` methods, so tests are easier to set up, while also
automatically creating a report if it doesn't already exist. This also
decouples form structure and database implemenation.

Originally I named this table `enabled_reports` and instead of having
`stats` and `results` columns, it had an `enabled` column and a `kind`
column, which would be set to "stats" or "results". However, although
that table would allow us to add arbitrary reports easily, I found the
way we had to handle the `has_many` relationship was a bit too complex.
2019-05-22 11:50:03 +02:00
decabeza
625c34bac2 Add officer email on admin poll shifts table 2019-05-17 17:41:42 +02:00
decabeza
33c06ea0d3 Add help text to admin poll officers search 2019-05-17 17:41:36 +02:00
Alberto
d845c6e973 Merge pull request #3476 from consul/delete-poll
Allow delete polls with associated questions and answers
2019-05-17 17:38:20 +02:00
decabeza
e026412389 Add button to delete a poll 2019-05-14 16:46:56 +02:00
Javi Martín
63fef66f41 Remove obsolete reference to proposal question 2019-05-09 12:58:14 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
decabeza
94b8caffca Merge branch 'master' into proposal-dashboard 2019-04-04 14:08:30 +02:00
decabeza
bee616c878 Fixes manage assignments button overlapping 2019-04-03 22:28:19 +02:00
decabeza
429edd0745 Hides total final and total recount cells on budget poll recounts 2019-04-03 22:28:17 +02:00
decabeza
fcbb11b26e Hides question menu on budget poll and changes redirect when create 2019-04-03 22:23:32 +02:00
Bertocq
9c7962c3a6 Check poll recount values for booth votes on admin panel 2019-03-28 15:49:17 +01:00
decabeza
2af154d539 Merge branch 'master' into proposal-dashboard 2019-03-28 01:26:04 +01:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Javi Martín
3e4e65ead7 Use double quotes inside ERB
We were using single quotes inside ERB code when that code was inside
HTML double quotes.
2019-03-25 14:58:54 +01:00
Senén Rodero Rodríguez
9d9ad5003b Add given_order to related poll question answers forms
Since given order is no longer being generated automatically we need
to add it to related forms and to strong parameters methods
2019-03-21 14:51:17 +01:00
Julian Herrero
e63a862882 Use double quotes in app/views/admin/poll 2019-03-19 12:16:50 +01:00
Julian Herrero
18bd2c7de8 Refactor (improve readability) 2019-03-15 09:55:12 +01:00
Alberto
3c313c9c52 Merge pull request #3334 from consul/admin-polish
Improve UX on admin section
2019-03-13 17:15:22 +01:00
decabeza
b31b65f246 Add link to proposal if question was created from a proposal 2019-03-13 15:35:31 +01:00
decabeza
000819e928 Move create question to admin poll questions
Also move question actions to admin polls questions
2019-03-13 15:33:14 +01:00
Juanjo Bazán
26d1024cfc Add cumulative totals to admin poll recounts list
This commit backports commit AyuntamientoMadrid@90638672 and the changes
that code has been through:

* AyuntamientoMadrid@03371a71 removed daily recounts in the controller
* AyuntamientoMadrid@fe3492a7 removed daily recounts in the view
* AyuntamientoMadrid@aa59d995 replaced FinalRecount with TotalResult
* AyuntamientoMadrid@c40e8d79 replaced TotalResult with Recount
2019-03-07 02:09:17 +01:00
Julian Nicolas Herrero
2f84d17cc9 Merge pull request #3155 from jaflutz/2824-options-display-results-polls
Enable options to show stats and results with any type of voter
2019-03-06 11:14:54 +01:00
decabeza
51d74ed7ab Replace poll name link in admin polls booth assignments 2019-02-25 14:10:25 +01:00
Julian Herrero
884274c4ad Add a description for open polls 2019-02-18 13:34:07 +01:00
decabeza
dfd4f60e15 Order admin poll list by starts_at date 2019-01-31 18:49:24 +01:00
Julian Herrero
8f112cf37e Allow admins delete poll answer documents 2019-01-24 19:19:04 +01:00
João Lutz
47a33ea86c Enable options to show stats and results with any type of voter 2019-01-05 14:08:47 -02:00
decabeza
9c827d6ce0 Adds poll name on admin poll questions index 2018-12-19 21:00:09 +01:00
decabeza
3670859fa3 Removes unused admin poll officers views, routes and controller 2018-11-22 11:40:11 +01:00
Javi Martín
e0b9c1bfdd Update poll question answers translatable fields
We needed to bring back support for CKEditor in our translatable form,
which we had temporarily remove.

And now we support CKEditor in our translatable specs, and so we can
remove the duplicated specs for poll question answers.
2018-10-22 16:13:48 +02:00
Javi Martín
d1249d0b4f Update poll questions translatable fields
We need to replace ".title=" by ".title_#{locale}=" in one place because
for some reason globalize builds a new translation record when using the
latter but it doesn't build one when using the former.
2018-10-22 16:13:30 +02:00
Javi Martín
759de935ee Update polls translatable fields
The `:name` attribute is still allowed in the controller because some
forks use it when creating a poll from a budget.
2018-10-22 15:52:58 +02:00
Julian Herrero
e6762d6bca handle non-underscored locale names for cktext_area 2018-09-21 20:50:23 +02:00
Julian Herrero
673ec075eb Make answers translatable 2018-09-20 17:13:40 +02:00
Julian Herrero
5e6248d2ac Make questions translatable 2018-09-20 17:11:53 +02:00
Julian Herrero
9495208518 Make polls translatable 2018-09-20 17:07:43 +02:00
decabeza
ee16900d1b Unifies styles and views for admin voting booths section 2018-07-31 12:54:12 +02:00
decabeza
6f324c6931 Unifies styles and views for admin polls 2018-07-31 12:48:01 +02:00
decabeza
abf0fe992e Removes tablist and tab roles 2018-07-04 17:14:24 +02:00
decabeza
28a7c03c21 Adds data-tabs on admin poll booth assignments show 2018-06-08 15:15:46 +02:00
Alberto
f9940980b0 Merge pull request #2645 from wairbut-m2c/admin-form-improvements-backport
Admin form improvements
2018-06-07 17:44:38 +02:00
decabeza
6a812659c3 Adds missing tablist and tab roles 2018-06-06 12:01:17 +02:00
decabeza
ee884ed998 Updates active to is-active class for menus 2018-06-06 12:01:16 +02:00
decabeza
608f1996ce Fixes admin layout 2018-05-23 08:08:54 -04:00
Angel Perez
2c37702298 Sort booths by name and enable pagination 2018-05-23 08:08:54 -04:00
Angel Perez
4c0deb0eca Remove video_url attr from Admin::Poll::Question form 2018-05-23 07:27:12 -04:00
Angel Perez
44b1eb929a Move 'Show stats and results' form to Admin::Poll#results tab 2018-05-23 07:27:12 -04:00
Angel Perez
10fac6d2d1 Admins can delete an answer's associated images (#1999) 2018-01-19 15:29:18 -04:00
decabeza
67df3947bf improves admin image partial 2017-12-15 18:48:24 +01:00