Commit Graph

26 Commits

Author SHA1 Message Date
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
9cc3c553ff Extract component to render a map
This way it'll be easier to refactor it.
2023-05-04 15:27:15 +02:00
Javi Martín
c7de42ab96 Simplify map location coordinates helpers
We're calling this method after setting the map location with
`map_location = MapLocation.new if map_location.nil?`, so the condition
`map_location.present?` is always going to be true.
2023-05-04 15:27:15 +02:00
Javi Martín
08679bc9cc Use link_to instead of content_tag :a 2020-04-27 19:26:37 +02:00
Javi Martín
749428d93f Replace content_tag with new tag builder syntax
One of the main advantages of this syntax is we can now omit the content
parameter when it's empty.
2020-04-27 19:26:37 +02:00
Javi Martín
033f3c33e3 Add SpaceAroundEqualsInParameterDefault rule
We were using it in most places, but not everywhere.
2019-10-24 17:56:03 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
47b2c42a1d Apply IndentationConsistency rubocop rule 2019-09-10 20:02:15 +02:00
Javi Martín
f284d5c09e Remove record_tag_helper
It was only used in one place, and could easily be replaced.

Note we usually use HTML classes like `map-location` instead of
`map_location`, but I've kept the underscore for compatibility with the
previous version.
2019-04-29 12:36:09 -05:00
Javi Martín
4c35df4812 Use double quotes inside string interpolation 2019-03-25 14:58:54 +01:00
Julian Herrero
dbac4bc222 Change admin settings tab for maps
- Rename map settings keys
- Add fields for latitude, longitude and zoom
- Add a callout message on how to enable map feature
2019-03-19 18:14:57 +01:00
Vicente Mendoza
c673ca2319 fix tests 2018-01-17 18:36:45 +01:00
Vicente Mendoza
d0df965487 fix some issues about test and variables name 2018-01-17 17:10:19 +01:00
Vicente Mendoza
91e10e1897 new map on budget homepage 2018-01-17 13:15:35 +01:00
decabeza
97bf00817c fixes js class name 2018-01-15 21:21:44 +01:00
decabeza
39b55e11df changes text and makes bigger link to delete a marker on a map 2018-01-15 21:21:24 +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
c9963b1c4f Some alignment fixes 2017-09-27 14:50:03 +02:00
Senén Rodero Rodríguez
5a09b79da4 Move map tiles provider server and map tiles attribution to secrets. 2017-09-27 14:50:03 +02:00
Senén Rodero Rodríguez
5113fefef6 Change open street maps tile server url. 2017-09-27 14:50:03 +02:00
Senén Rodero Rodríguez
011ef41ae1 Add map location missing specs 2017-09-27 14:50:03 +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
5815389cb8 Rename map settings keys 2017-09-27 14:49:07 +02:00
Senén Rodero Rodríguez
130e4533ac Allow to render map without marker on new forms. 2017-09-27 14:48:12 +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
874a951dd2 Add map locations helper. Allow to configure map marker edition on map instantiation at views. 2017-09-27 14:48:12 +02:00