Commit Graph

15 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
3fa3c90db6 Fix map markers navigation for keyboard users
By using the bindPopup function instead of the click event
popups work when using the keyboard.

Note that now we are loading all the map markers in the first
request in a single query to the database (needed when there
is a lot or markers to show). Because of that we removed the
AJAX endpoint.
2023-06-26 20:33:35 +02:00
decabeza
4a9aae9806 Add groups index page
When render the investment list component with the link "see all
investments", now we redirect to groups index page when a budget has
multiple headings.
2021-08-09 21:45:29 +02:00
decabeza
a851048d56 Allow users to remove their support on investments
Note we don't cast negative votes when users remove their support. That
way we provide compatibility for institutions who have implemented real
negative votes (in case there are / will be any), and we also keep the
database meaningful: it's not that users downvoted something; they
simply removed their upvote.

Co-Authored-By: Javi Martín <javim@elretirao.net>
Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
2021-06-14 14:46:54 +02:00
Javi Martín
758cdaf8d7 Extract controllers to support investments
Since we're going to add an action to remove supports, having a separate
controller makes things easier.

Note there was a strange piece of code which assumed users were not
verified if they couldn't vote investments. Now the code is also
strange, since it assumes users are not verified if they can't create
votes. We might need to revisit these conditions if our logic changes in
the future.
2021-06-14 14:42:03 +02:00
Javi Martín
ff93f5a591 Use "resolve" for polymorphic hierarchy paths
In the past, we couldn't use `polymorphic_path` in many places. For
instance, `polymorphic_path(budget, investment)` would return
`budget_budget_investment_path`, while in our routes we had defined
`budget_investment_path`.

With the `resolve` method, introduced in Rails 5.1, we can use symbols
to define we want it to use `investment` instead of `budget_investment`.
It also works with nested resources, so now we can write
`polymorphic_path(investment)`.

This makes the code for `resource_hierarchy_for` almost impossible to
understand. I reached this result after having a look at the internals
of the `resolve` method in order to get its results and then remove the
symbols we include.

Note using this method will not make admin routes compatible with
`polymorphic_path`. Quoting from the Rails documentation:

> This custom behavior only applies to simple polymorphic URLs where a
> single model instance is passed and not more complicated forms, e.g:
> [example showing admin routes won't work]

Also note that now the `admin_polymorphic_path` method will not work for
every model due to inconsistencies in our admin routes. For instance, we
define `groups` and `budget_investments`; we should either use the
`budget_` prefix in all places or remove it everywhere. Right now the
code only works for items with the prefix; it isn't a big deal because
we never call it with an item without the prefix.

Finally, for unknown reasons some routing tests fail if we use
`polymorphic_path`, so we need to redefine that method in those tests
and force the `only_path: true` option.
2020-06-15 11:54:05 +02:00
denialtorres
bb627a7117 Edit Budget Investment only in accepting phase (#3716)
This way users who made a typo can fix it before the investment is reviewed.
2019-10-18 13:59:14 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +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
Julian Herrero
8510624692 Use double quotes in config/routes 2019-03-15 10:29:07 +01:00
Matheus Miranda
06f07b1139 Add map to sidebar on Heading's page
Signed-off-by: Matheus Miranda <matheusmirandalacerda@gmail.com>
2018-11-16 09:05:23 +01:00
Angel Perez
3e6cbc9505 Add basic frontend for budget executions list 2018-11-05 18:04:38 +01:00
Angel Perez
4737664f6e Include routes for investments moderation 2018-07-20 18:03:02 -04:00
Bertocq
471fe52ecc Replace deprecated to: for action: at routes
Running test suite the following appears: DEPRECATION WARNING: Defining
a route where `to` is a symbol is deprecated. Please change
`to: :json_data` to `action: :json_data`.
2018-03-28 09:21:00 +02:00
María Checa
535a96603a Add budget/investments#json_data method 2018-03-27 15:25:55 +02:00
Angel Perez
1cd47da9d4 Split routes into small files for easier customization (#1852) 2018-01-09 15:49:01 -04:00