Commit Graph

19 Commits

Author SHA1 Message Date
Javi Martín
e75211125a Remove duplicate i18n text to remove marker
We had two different keys with the same text and were passing it as a
parameter. Since the text is the same in any case, we don't need a
parameter for it.

Note we are using the `proposals` i18n key instead of creating a new one
in a `shared` namespace one because creating a new key would mean that
we'd lose the already existing translations in Crowdin.
2023-05-04 15:27:15 +02:00
Javi Martín
c667582c98 Remove redundant value assignments in map fields
Rails forms automatically take the value from the object related to the
form.
2023-05-04 15:27:15 +02:00
Javi Martín
b9518d64e1 Use Rails methods to get map location input IDs
We were manually generating the IDs in order to pass them as data
attributes in the HTML in a component where we don't have access to the
form which has the inputs.

However, these data attributes only make sense when there's a form
present, so we can pass the form as a parameter and use it to get the
IDs.

We can now define a map as editable when there's an associated form,
which makes sense IMHO.
2023-05-04 15:27:15 +02:00
Javi Martín
e00aa807b9 Make remove marker label parameter optional
We were passing `nil` in some calls, which was confusing.

Since now we've got two optional parameters, we're using named
parameters.
2023-05-04 15:27:15 +02:00
Javi Martín
deb965bcce Remove editable parameter in render_map
The calls to `render_map` are confusing since there are so many
parameters. We can assume that the map is editable if we pass the remove
marker label.
2023-05-04 15:27:15 +02:00
Javi Martín
65ed778226 Avoid removing other proposals map locations
It was possible to remove a map location from a different proposal (even
one created by a different author) by modifying the hidden `id`
parameter in the form.

So we're making sure the map location we destroy is the one associated
to the proposal we're updating.

Since we're now using the `@proposal` instance variable in the
`destroy_map_location_association` method, we're calling that method
after loading the resource with cancancan.
2023-04-28 17:11:59 +02:00
Melvin Lammerts
c34aa54122 Remove skip map checkbox 2021-06-03 11:13:52 +02:00
Javi Martín
8d9cb4d8e3 Simplify generating checkboxes in forms
Using the block syntax to generate the label with a <span> tag inside
isn't necessary after upgrading foundation_rails_helpers. Before the
upgrade, we couldn't do so because the <span> tag was escaped.
2019-10-06 19:32:04 +02:00
Javi Martín
71d9ddd849 Apply rule to end files with a newline character 2019-09-10 20:02:15 +02:00
Julian Herrero
f6489bc604 Use double quotes in app/views 2019-03-19 12:33:07 +01:00
decabeza
02cef6dec5 Fixes missing i18n 2018-04-27 18:24:53 +02:00
decabeza
32711e0341 Adds map skip checkbox i18n for budget investments 2018-04-27 18:24:17 +02:00
rgarcia
19a084c0c7 adds map validations 2017-12-19 20:32:55 +01:00
taitus
51c53b6f31 Add missing specs from Maps on New, Edit and Show. 2017-09-27 14:50:54 +02:00
Senén Rodero Rodríguez
053a87eb2c Refactor map locations helper 2017-09-27 14:49:08 +02:00
Senén Rodero Rodríguez
dd7afd3593 Add methods to map locations helper. 2017-09-27 14:48:12 +02:00
Senén Rodero Rodríguez
a14bb77f49 Fix map location form fields ids definition. 2017-09-27 14:48:12 +02:00
Senén Rodero Rodríguez
874a951dd2 Add map locations helper. Allow to configure map marker edition on map instantiation at views. 2017-09-27 14:48:12 +02:00
Senén Rodero Rodríguez
5956207a00 Add map locations. Each map location can belongs to proposal or budget investment. 2017-09-27 14:48:12 +02:00