Commit Graph

2027 Commits

Author SHA1 Message Date
Alberto
2f8505332e Merge pull request #3574 from consul/remove-dashboard-polls
Allow users to delete dashboard polls
2019-06-01 11:06:34 +02:00
Alberto
8ee396f311 Merge pull request #3573 from consul/improve-ux
Add help texs, links and new message section to improve UX
2019-06-01 10:38:52 +02:00
Alberto
51e27fb6ed Merge pull request #3572 from consul/user-polls
Hide polls created by users from proposals dashboard on admin poll index
2019-06-01 10:38:07 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
voodoorai2000
24dde9c35e Delete valuation 2019-05-31 15:43:06 +02:00
Julian Nicolas Herrero
3ba7bd1cab Merge pull request #3567 from consul/select_proposals_by_admins
Make proposals to be selected by administrators
2019-05-31 15:30:39 +02:00
Javier Martín
888c161944 Merge pull request #2616 from consul/show_votes_associated_to_signatures
Show count of votes associated to verified signatures
2019-05-31 15:30:04 +02:00
decabeza
3855bf26ad Allow users to delete dashboard polls 2019-05-31 11:55:23 +02:00
decabeza
6b7c6a2f1f Refactor dashboard polls controller 2019-05-31 11:55:20 +02:00
decabeza
4c5b2723f4 Create new messages section for proposal's dashboard 2019-05-31 11:42:15 +02:00
decabeza
cec1d5e5f0 Hide polls created by users from proposals dashboard on admin poll index 2019-05-31 11:34:55 +02:00
Bertocq
d9fdc2e0f2 Show votes associated to verified signatures 2019-05-30 18:38:46 +02:00
Javier Martín
087a21b4ca Merge pull request #3565 from consul/fix_annotation_comments_order
Fix order in annotation comments with same score
2019-05-30 18:25:04 +02:00
Javi Martín
123196e4ed Display the same results for stats and recounts
In the recounts we were incorrectly assuming the total amount included
the blank and invalid ballots.
2019-05-30 17:22:39 +02:00
Julian Herrero
d4ec750428 Show archived proposals in selected proposals list 2019-05-30 11:19:38 +02:00
Julian Herrero
a852696eeb Remove not selected proposals from other lists 2019-05-30 11:19:38 +02:00
Julian Herrero
b68a872298 Change links for proposals lists
Changed applied:

- Remove Archived proposals from tab and add a link under Proposals
  lists
- Remove Popular proposals link from custom section and add it to the
  Proposals lists
- Remove Retired proposals link from custom section and add it to the
  Proposals lists
- Remove Selected proposals link from custom section and add it to the
  Proposals lists
2019-05-30 11:19:38 +02:00
Julian Herrero
ad5f7a06e1 Allow admins to select proposals and users to list them 2019-05-30 11:19:33 +02:00
Javi Martín
dbcc5fb724 Use AR relations when merging comments
Using arrays made it difficult to order by more than one field (like the
`most_voted` scope does), and so we were ordering by `confidence_score`
and ignoring the `created_at` column.

Using an AR relation makes it easy to reuse the existing `most_voted`
scope.

This change has one side effect: now comments with equal votes are
ordered in descending order instead of having no specific order. That
means flaky specs which failed sometimes because they assumed comments
were ordered by date are now always green.

I've also re-added the `oldest` scope removed in 792b15b thinking it was
removed because using it with arrays was too hard.
2019-05-29 20:50:53 +02:00
Javier Martín
14a5ea87a1 Merge pull request #3562 from consul/prepare_for_rails_5.1
Add Rails 5.1 compatibility
2019-05-29 19:11:19 +02:00
Javi Martín
e445e14d65 Use ActiveSupport::HashWithIndifferentAccess
Using `HashWithIndifferentAccess` directly will be deprecated in Rails
5.1.
2019-05-28 14:23:54 +02:00
voodoorai2000
29f5268e42 Display polls for current booth
Polls that were not votable by a user were not being displayed in the officing interface. Creating a confusing situation for officers.

With this commit polls that are not votable by a user will be displayed, with the corresponding message explaining that that poll can only be voted by residents of a certain geozone.
2019-05-24 15:20:54 +02:00
Javier Martín
387488aa68 Merge pull request #3520 from consul/backport-refactor_stats_enabled
Add options to show advanced stats
2019-05-23 13:07:19 +02:00
Javi Martín
4f4dc2c2af Add show results and stats form to budgets 2019-05-22 11:50:03 +02:00
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
Alberto
ac1d8195f2 Merge pull request #3488 from consul/basic-yml
Admin basic customization texts
2019-05-21 21:43:07 +02:00
Javier Martín
82e3c41aa9 Merge pull request #3512 from consul/backport-stats
Change stats layout
2019-05-21 17:18:47 +02:00
Javier Martín
d57025696f Merge pull request #3503 from consul/backport-blank_votes
Improve poll stats
2019-05-21 14:23:13 +02:00
decabeza
a2cb7501f7 Create new basic tab for admin information texts 2019-05-21 14:06:58 +02:00
Javi Martín
1135441cbd Simplify getting I18nContent translations
This code might be slightly slower because it performs one query per
field in the form, but I didn't notice any differences on my development
machine, and the code is now much easier to understand.
2019-05-21 13:53:39 +02:00
Javi Martín
76c7827cf4 Use stats objects instead of hashes
It will make it far easier to call other methods on the stats object,
and we're already caching the methods.

We had to remove the view fragment caching because the stats object
isn't as easy to cache. The good thing about it is the view will
automatically be updated when we change logic regarding which stats to
show, and the methods taking long to execute are cached in the model.
2019-05-21 13:50:18 +02:00
Javier Martín
cbfa2c1df8 Merge pull request #3504 from consul/backport-poll_slugs
Add slug to polls
2019-05-21 13:42:47 +02:00
Bertocq
b8dbdaf9a7 Move question most voted answer from boolean to a enumerable max by total_votes 2019-05-21 13:26:44 +02:00
Bertocq
dbe404d9ad Fix Officer final recount access without voting shift 2019-05-21 13:26:44 +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
Alberto
b3ec2b42d1 Merge pull request #3506 from consul/officers-redirect
Remove redirect for poll officers
2019-05-17 17:27:01 +02:00
Alberto
7c79965547 Merge pull request #3397 from consul/proposals-form
Remove question and external_url fields from proposals and legislation proposals
2019-05-17 17:08:56 +02:00
decabeza
4f1e70ea95 Remove redirect to poll officers 2019-05-17 16:30:33 +02:00
rgarcia
1af472b795 hotfix for polls without slugs 2019-05-16 23:40:50 +02:00
María Checa
e3b16230e6 Added slug to polls for named urls 2019-05-16 23:40:50 +02:00
voodoorai2000
abb6eb18b0 Order headings by name and group
Note that we are relying on the existing `sort_by_name`[1] method in the `Budget::Heading` class.

This method sorts by DESC group name first and then ASC heading name.

[1] https://github.com/AyuntamientoMadrid/consul/pull/1875
2019-05-16 22:01:42 +02:00
rgarcia
51ab4a430e Load budget in stats controller 2019-05-16 22:01:42 +02:00
Bertocq
e0e02b47c0 Add Budgets Stats Controller, route and ability on reviewing ballots and finished budget 2019-05-16 22:01:42 +02:00
Javier Martín
668b6cfd73 Merge pull request #3499 from consul/backport-admin_stats
Add admin budget stats
2019-05-16 20:41:39 +02:00
Juanjo Bazán
110ee961e3 adds budget stats for final voting to admin stats 2019-05-16 14:45:46 +02:00
Juanjo Bazán
5be54b57da reduces current admin budget stats as supporting phase 2019-05-16 14:45:45 +02:00
rgarcia
11437a1d40 add budget investment stats 2019-05-16 13:41:49 +02:00
rgarcia
a31b62526b removes unused multiple lines per graph 2019-05-16 13:37:47 +02:00
rgarcia
cfe3f95f5c moves graphs to individual views 2019-05-16 13:37:47 +02:00
Javier Martín
c39a3d7525 Merge pull request #3492 from consul/backport-fix_delete_budget_with_polls
Don't destroy budgets with an associated poll
2019-05-16 13:07:18 +02:00