Javi Martín
7ce57f649f
Use a <meter> tag to display age percentages
2019-05-21 13:50:16 +02:00
Javi Martín
0037ce5546
Reorder poll stats method names
...
So related methods are on the same line.
2019-05-21 13:50:16 +02:00
Javi Martín
57a2945590
Use let for stats in budget stats spec
...
The rest of the `before` block still uses instance variables, but at
least the rest of the file doesn't use instance variables anymore.
2019-05-21 13:50:15 +02:00
Javi Martín
1a1ca13525
Add age stats to polls
2019-05-21 13:50:15 +02:00
Javi Martín
9a01ff5323
Refactor age groups method
...
We try to make the method return data which is easier to handle in the
view.
2019-05-21 13:50:15 +02:00
Javi Martín
be68c8cdbf
Add gender stats to polls
2019-05-21 13:50:15 +02:00
Javi Martín
c0044f4e56
Extract method to show stats percentage
2019-05-21 13:50:15 +02:00
Javi Martín
80486b8193
Use section tags in stats
...
This way we can easily see the h3 tag's parent is the h2 tag.
2019-05-21 13:50:15 +02:00
Javi Martín
5a3eb70a46
Use same translations for poll and budget stats
2019-05-21 13:50:15 +02:00
Javi Martín
afa8bf8dba
Add basic headings and navigaton styles for stats
2019-05-21 13:50:15 +02:00
Javi Martín
c1b76a7ebf
Simplify age groups method
2019-05-21 13:50:15 +02:00
Javi Martín
c2489e3209
Increase number of age groups
...
We would now like to differenciate between 70-year-old people and
90-year-old people.
2019-05-21 13:50:15 +02:00
Javi Martín
e4a032ee68
Split common and specific stats methods
2019-05-21 13:49:42 +02:00
Javi Martín
1a86f7dbe8
Simplify total participants view logic
2019-05-21 13:49:42 +02:00
Javi Martín
5d2f5d1d81
Move gender and age methods to a common concern
...
These are generic methods which only depend on the participants.
2019-05-21 13:49:42 +02:00
Javi Martín
04c920c27d
Simplify calculate percentage method
2019-05-21 13:49:42 +02:00
Javi Martín
ccaa2e1a77
Remove duplication to calculate percentage
2019-05-21 13:49:42 +02:00
Javi Martín
188278296c
Simplify the way we cache stats
2019-05-21 13:48:54 +02:00
Javi Martín
d627215af4
Use symbols for method names
2019-05-21 13:27:03 +02:00
Javi Martín
313ffb589b
Share method to generate stats
2019-05-21 13:27:03 +02:00
Javi Martín
62a97f9003
Add a common concern for budget and poll stats
2019-05-21 13:27:03 +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
84eac6ff68
Correct booth valid and total participants calculations
2019-05-21 13:26:44 +02:00
Bertocq
b2b5ab1d48
Calculate white votes percentage of the total
2019-05-21 13:26:44 +02:00
Bertocq
4be44835a8
Add calculate_percentaje helper function to stats helper
2019-05-21 13:26:44 +02:00
Bertocq
f4260788eb
Add Partial Results counts to question answers
2019-05-21 13:26:44 +02:00
Bertocq
ba9346162c
Improve officing result specs
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
decabeza
607b2362a3
adds missing id
2019-05-21 13:26:44 +02:00
Bertocq
118cce2f8f
Add letter origin back to poll voters
2019-05-21 13:26:44 +02:00
Javi Martín
e461c8d0ac
Generate navigation links for polls without a slug
2019-05-21 13:04:26 +02:00
Javi Martín
3d84920c47
Add task to generate poll slugs
2019-05-17 08:15:41 +02:00
María Checa
0c6e7e7580
Adds Sluggable concern to Poll model
2019-05-17 05:41:09 +02:00
Bertocq
65fd88ef32
Use poll slug on stats and results paths
2019-05-17 05:41:09 +02:00
rgarcia
1af472b795
hotfix for polls without slugs
2019-05-16 23:40:50 +02:00
Bertocq
291ae7b734
Add slug to Polls on dev seed rake
2019-05-16 23:40:50 +02:00
Bertocq
501fe9b682
Fix poll_path links to adding id param
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
Javier Martín
525eb9034c
Merge pull request #3438 from consul/backport-stats
...
Add budget stats
2019-05-16 22:46:38 +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
decabeza
7b2495845d
Moves social tags outside cache on budget stats
2019-05-16 22:01:42 +02:00
Angel Perez
a889f62f68
Remove unused budget I18n keys
2019-05-16 22:01:42 +02:00
Angel Perez
3bbdffceaf
Remove conditional to render tabs on budgets/stats#show
...
'Results' and 'Execution' tabs are now shown to the user regardless
of the budget's current status
2019-05-16 22:01:42 +02:00
Angel Perez
c2b9042ad7
Add 'Execution' tab to a finished Budget stats
...
This tab will show all winner investments projects with milestones
2019-05-16 22:01:42 +02:00
María Checa
fac99cfb10
Add web and booth participants in budget stats
2019-05-16 22:01:42 +02:00
María Checa
c2457e36a5
Add budget stats permissions for normal users and admins
2019-05-16 22:01:42 +02:00
Marko Lovic
70e108d593
Simplify spec
2019-05-16 22:01:42 +02:00
Marko Lovic
0c5f801c19
Keep DB clean after running budget stats spec
...
This spec was leaving the DB "dirty" because it was creating
records in a before(:all) hook. These records are not cleaned up
automatically when using the :transaction strategy for DatabaseCleaner.
Using before(:each), however, causes another problem. Some of the code
depends on the heading id being 1 (see app/models/budget/ballot/line.rb#L48).
Because of SQL auto-increment, this is only the case the first time the hook
is run, as different id's are assigned on subsequent runs. This is fixed
by forcing the id to always be 1.
2019-05-16 22:01:42 +02:00
María Checa
3291b3274a
Added physical votes to stats
2019-05-16 22:01:42 +02:00
decabeza
99d0ac52c0
Fixes budgets stats ui for all phases
2019-05-16 22:01:42 +02:00