Commit Graph

1844 Commits

Author SHA1 Message Date
Julian Herrero
3ba961a2d7 Use double quotes in models 2019-03-14 17:25:43 +01:00
rgarcia
8125d470de Add methods to obtain polls votable by a user 2019-03-06 17:42:46 +01:00
Alberto
098f4b6c5f Merge pull request #3328 from consul/admin-settings
Improve Admin settings section
2019-02-27 10:49:54 +01:00
Javi Martín
c5c56ad969 Use a virtual attribute to get valuation tags
It was strange to set the valuation tags using `valuation_tag_list=` but
then accessing the valuation tags using `tag_list_on(:valuation)`.
2019-02-26 14:16:10 +01:00
Javi Martín
4980819528 Fix valuation tags being overwritten
When params[:budget_investment][:valuation_tag_list] was not present,
which is the case when updating an investment using the "mark as visible
to valuators" checkbox, we were removing all valuation tags.

Using a virtual attribute to assign the tags only if the parameter is
present simplifies the code in the controller and avoids the issue.
2019-02-26 14:16:10 +01:00
Javier Martín
9fd3c4fb1c Merge pull request #3321 from consul/backport-fix_random_order
Fix random proposals order in the same session
2019-02-26 14:09:24 +01:00
decabeza
8066b96fe3 Remove legacy banner images and banner styles settings 2019-02-25 14:59:38 +01:00
decabeza
0d834744fd Replace open to active filter on admin legislation processes index
Now active filter show open processes and the next ones, processes with a start date greather than current date.
2019-02-20 13:32:09 +01:00
Javi Martín
6682121069 Reuse code to set and order by a random seed 2019-02-20 12:10:12 +01:00
Javi Martín
e3ca700e17 Add concerns to set and order by a random seed 2019-02-20 11:51:32 +01:00
Javi Martín
660c59016b Fix random proposals order in the same session
Using `setseed` and ordering by `RAND()` doesn't always return the same
results because, although the generated random numbers will always be
the same, PostgreSQL doesn't guarantee the order of the rows it will
apply those random numbers to, similar to the way it doesn't guarantee
an order when the `ORDER BY` clause isn't specified.

Using something like `reorder("legislation_proposals.id % #{seed}")`,
like we do in budget investments, is certainly more elegant but it makes
the test checking two users get different results fail sometimes, so
that approach might need some adjustments in order to make the results
more random.
2019-02-20 11:51:32 +01:00
Javier Martín
7c61f621e2 Merge pull request #3314 from consul/backport-without_valuator
Consider having valuator group as having valuator
2019-02-19 18:59:15 +01:00
Javier Martín
44483c2c32 Merge pull request #3313 from consul/backport-fix_literal_as_condition
Fix literal as condition
2019-02-18 18:58:47 +01:00
Julian Herrero
884274c4ad Add a description for open polls 2019-02-18 13:34:07 +01:00
Javi Martín
bd67fcb9cf Consider having valuator group as having valuator
So under the tab "without valuator" we don't show investments assigned
to a valuator group, just as expected by administrators.

There was a conflict while applying this commit to the CONSUL repo. I've
decided to re-introduce the test which was deleted in commit dddf026a,
which hadn't been deleted in AyuntamientoMadrid@192f1182.
2019-02-15 21:11:24 +01:00
Javi Martín
250b19b0d3 Remove literal used in condition
The right syntax would have been:

`after_save :recalculate_heading_winners, if: :incompatible_changed?`

However, since the method `recalculate_heading_winners` already executes
the `if incompatible_changed?` condition, removing it keeps the intended
behaviour.
2019-02-15 20:21:35 +01:00
Javier Martín
b330de01f6 Merge pull request #3148 from matisnape/budget_investments_sorting_columns
Add sort links to admin tables
2019-02-15 19:19:11 +01:00
Julian Nicolas Herrero
4a12425987 Merge pull request #3296 from consul/make_budgets_translatable
[Backport] Make budgets translatable
2019-02-13 19:01:13 +01:00
Julian Nicolas Herrero
e8c77f58a6 Merge pull request #3292 from consul/backport_delete_officer_assignment_with_associated_data
[Backport] Delete Booth Shifts with associated data
2019-02-13 18:56:43 +01:00
Alberto
fad65b621a Merge pull request #3291 from consul/total-votes
[Backport] Use votes score instead of total votes on debates and legislation proposals
2019-02-13 17:15:39 +01:00
Julian Herrero
a963a99c55 Use correct scope to sort headings by name 2019-02-13 13:35:09 +01:00
Julian Herrero
29a704bd60 Show headings in budgets landing page when translations are missing 2019-02-13 13:35:09 +01:00
Julian Herrero
1ba50c76c4 Use method from Globalizable module
Since we have a method defined inside the Globalizable
module we don't need to create the same method in every model
2019-02-13 13:35:09 +01:00
Julian Herrero
922600252c Make budget headings translatable 2019-02-13 13:35:07 +01:00
Julian Herrero
1c35ec99c1 Make budget groups translatable 2019-02-13 12:30:37 +01:00
Julian Herrero
90d0a6e416 Make budget phases translatable 2019-02-13 11:44:56 +01:00
Julian Herrero
d76782f150 Make budgets translatable 2019-02-13 11:41:58 +01:00
Julian Herrero
5f4a369606 Deleting a booth shift with recounts or partial results.
Show a flash message that it's not possible to delete booth shifts
when they have associated recounts or partial results. Before an
execption was raised.
2019-02-12 18:59:51 +01:00
decabeza
6b62ba0e91 Show cached_votes_score on admin legislation proposals 2019-02-12 18:42:44 +01:00
decabeza
0ae1cdfc8c Replace total votes to cached_votes_score on legislation proposals
This show votes_score as result of votes_up minus votes_down
2019-02-12 18:42:41 +01:00
decabeza
4e4804e180 Replace total votes to cached_votes_score on debates
This show votes_score as result of votes_up minus votes_down
2019-02-12 18:42:35 +01:00
decabeza
73a0f999ad Add order to voted headings names 2019-02-12 17:19:36 +01:00
voodoorai2000
f4b8099703 Simplify sql query 2019-02-12 17:18:38 +01:00
Marko Lovic
264c4e747b Improve User#headings_supported_within_group performance
Performs a single DB call instead of 3
2019-02-12 17:16:49 +01:00
Marko Lovic
e47cbe2a10 Extract "supported headings" logic to User method
In preparation to use this method from views where
it doesn't make sense for it to be associated with
a specific investment.
2019-02-12 17:16:29 +01:00
Alberto
f9b18667e6 Merge pull request #3280 from consul/next-filters
[Backport] Removes next/incoming filters
2019-02-11 20:43:09 +01:00
decabeza
060a4c684f Remove legislation processes next filter 2019-02-08 14:29:43 +01:00
decabeza
bc1679550b Remove incoming polls filter 2019-02-08 14:28:19 +01:00
Julian Herrero
54e59a8a58 LegacyLegislation migration cleanup
These legacy models are not used anymore.
2019-02-06 17:07:38 +01:00
decabeza
eb169ca435 Add models tag spec with 160 chars 2019-02-05 17:41:00 +01:00
decabeza
5409db6c55 Show only selected investments on map from publishing prices phase
If there are no selected investements show all investments on map.
2019-02-05 14:01:27 +01:00
Alberto
9475a0c6ee Merge pull request #3249 from consul/custom-pages
Refactor processes header colors and custom pages
2019-01-30 20:05:20 +01:00
Julian Nicolas Herrero
0e9fd645e8 Merge pull request #3234 from consul/use_find_instead_of_find_by_id
[Backport] Use find instead of find_by_id
2019-01-30 19:46:22 +01:00
decabeza
483182ceed Refactor scopes on site customization page model 2019-01-30 18:03:58 +01:00
decabeza
41f9ef167d Refactor hexadecimal color validation 2019-01-30 13:17:04 +01:00
decabeza
2695e19e2f Fix hound warnings 2019-01-29 17:54:02 +01:00
Julian Nicolas Herrero
81b65ec821 Merge pull request #3202 from consul/sort_legislation_processes_by_start_date
Sort Legislation Processes by descending start date
2019-01-29 17:30:02 +01:00
Alberto
41fe1e3922 Merge pull request #3152 from NahiaSolutions/add_image_to_legislation_processes
Add image to legislation processes and banner colors
2019-01-29 16:06:54 +01:00
Alberto
ebe5bf13e7 Merge pull request #3149 from NahiaSolutions/add_cards_to_custom_pages
Add cards to custom pages
2019-01-29 16:05:47 +01:00
Alberto
78479ff0e7 Merge pull request #3228 from consul/milestones_public_progress_bar
[Backport] Add progress bars to milestones public view
2019-01-29 14:12:08 +01:00