Commit Graph

1838 Commits

Author SHA1 Message Date
Julian Nicolas Herrero
af55366e57 Merge pull request #3360 from consul/double_quotes_for_controllers
Change single quotes to double quotes for controllers
2019-03-19 12:13:07 +01:00
Julian Herrero
87be6f302c Add default site customization pages
From now on these static pages:

`/privacy'
`/conditions'
`/accesibility'
`/help/faq'
`/welcome'

have been moved to the DB and can be modified easily by any
administrator in `/admin/site_customization/pages'
2019-03-14 18:35:51 +01:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +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 Herrero
3eac5d25ab Update changelog for release 0.19 2019-02-28 11:07:49 +01:00
Alberto
098f4b6c5f Merge pull request #3328 from consul/admin-settings
Improve Admin settings section
2019-02-27 10:49:54 +01:00
Javier Martín
86a1f5e0ce Merge pull request #3330 from consul/backport-fix_valuation_tags
Fix valuation tags being overwritten
2019-02-26 21:42:58 +01:00
Julian Nicolas Herrero
09d4c54c40 Merge pull request #3326 from consul/admin_system_emails
[Backport] Show all system emails in Admin section
2019-02-26 15:18:42 +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
Julian Herrero
00bd7008bb Show all system emails in Admin section 2019-02-22 16:13:49 +01:00
Julian Herrero
df08e42c3b Use preferred format for array of strings 2019-02-21 15:18:34 +01:00
Alberto
f9476eaa6a Merge pull request #3323 from consul/ui-fixes
[Backport] Fix UI details for a better UX and design
2019-02-20 14:37:46 +01:00
Javier Martín
ea0bec3574 Merge pull request #3319 from consul/backport-image_attributes
Reuse image attributes in legislation processes
2019-02-20 13:46:40 +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
70a1b7d1ff Merge pull request #3318 from consul/backport-refactor_investments_index
Show all investments in the map
2019-02-20 11:49:06 +01:00
Javi Martín
af9a2179eb Reuse image attributes in legislation processes
It wasn't originally added because at the time legislation processes
didn't have images.
2019-02-19 19:57:27 +01:00
Javi Martín
facfb807e1 Show all investments in the map
We were showing only the ones being shown in the current page because
we were modifying `@investments` using a method which used
`@investments`, and we were calling that method twice.

There are many possible solutions: using a local variable to store the
result of the `investments` method, modifying `@investments` after
modifying `@investments_map_coordinates`, ... I've used the one which in
my humble opinion is a bit less fragile: not using `@investments` inside
the `investments` method. That way, the `investments` method will always
return the same result.

Note `stub_const("Budgets::InvestmentsController::PER_PAGE", 2)`
wouldn't work because `Budgets::InvestmentsController` isn't loaded when
that line is executed. So we need to load it. Instead of requiring the
file, using `#{Budgets::InvestmentsController}` seems to be an easier
solution.
2019-02-19 13:22:49 +01:00
Javi Martín
8ecf7f4505 Extract constant to define investments per page
That way it's easier to stub in tests. It makes it easier to customize
CONSUL to show a different number of investments per page as well.
2019-02-19 13:21:37 +01:00
decabeza
25c8212e80 Remove proposal improvement path setting 2019-02-19 11:07:58 +01:00
Julian Herrero
884274c4ad Add a description for open polls 2019-02-18 13:34:07 +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
Javier Martín
a0fb19f0b4 Merge branch 'master' into feature/3153 2019-02-15 16:25:50 +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 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
Alberto
f9b18667e6 Merge pull request #3280 from consul/next-filters
[Backport] Removes next/incoming filters
2019-02-11 20:43:09 +01:00
Julian Nicolas Herrero
5a50992773 Merge pull request #3275 from consul/legacy_legislation_cleanup
LegacyLegislation migration cleanup
2019-02-08 20:04:19 +01:00
decabeza
33fabe18b8 Remove admin legislation processes past filter 2019-02-08 14:30:08 +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
Julian Herrero
c9522b424b Show unfeasible and unselected investments for finished budgets
We were filtering by winners investments for finished budget without
having in consideration other filters.
We want the default filter to be `winners` for finished budgets.
2019-02-06 13:50:50 +01:00
Alberto
282ae61139 Merge pull request #3252 from consul/custom-pages-cards
Allow select column width for widget cards
2019-02-05 17:37:46 +01:00
decabeza
dfd4f60e15 Order admin poll list by starts_at date 2019-01-31 18:49:24 +01:00
decabeza
64cbed838a Fix hound warnings 2019-01-31 17:23:45 +01:00
decabeza
e7fcf2ce35 Add select on cards form to select the number of columns 2019-01-31 17:06:01 +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
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
bd4826b25e Merge branch 'master' into add_cards_to_custom_pages 2019-01-28 14:49:39 +01:00
Alberto
c297595e49 Merge branch 'master' into add_image_to_legislation_processes 2019-01-28 14:49:19 +01:00
Julian Herrero
3bf2fa1b17 Add method find_by_slug_or_id to Sluggable module
Make it easier to find by slug or id for sluggable models. Will return
nil if resource is not found.
2019-01-25 09:08:28 +01:00