Skip to content

Commit 96dcebd

Browse files
committed
feat: the map is working with the leaflet-rails gem
I have also added two attributes (latitude and longitude) for the organisation and therefore changed forms for active-admin and update. I have also created a personalised marker. Issue #636.
1 parent 337f79a commit 96dcebd

File tree

14 files changed

+712
-4
lines changed

14 files changed

+712
-4
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ gem 'pg_search', '~> 2.3.5'
2424
gem 'skylight', '~> 4.3.2'
2525
gem 'sidekiq', '~> 6.1.2'
2626
gem 'sidekiq-cron', '~> 1.2.0'
27+
gem 'leaflet-rails', '~> 1.7.0'
2728

2829
# Assets
2930
gem 'jquery-rails', '~> 4.3.5'

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ GEM
181181
kgio (2.11.3)
182182
launchy (2.5.0)
183183
addressable (~> 2.7)
184+
leaflet-rails (1.7.0)
185+
rails (>= 4.2.0)
184186
letter_opener (1.7.0)
185187
launchy (~> 2.2)
186188
listen (3.2.1)
@@ -428,6 +430,7 @@ DEPENDENCIES
428430
jquery-rails (~> 4.3.5)
429431
json_translate (~> 4.0.0)
430432
kaminari (~> 1.2.1)
433+
leaflet-rails (~> 1.7.0)
431434
letter_opener (~> 1.7.0)
432435
listen (~> 3.2.0)
433436
localeapp (~> 3.1)

app/admin/organization.rb

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
f.input :address
2424
f.input :description
2525
f.input :public_opening_times
26+
f.input :latitude
27+
f.input :longitude
2628
end
2729
f.actions
2830
end

app/assets/images/marker-icon.png

1.9 KB
Loading

app/assets/javascripts/application.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//= require_tree ./application
2+
//= require leaflet
23

34
$(document).on('click', 'a[data-popup]', function(event) {
45
event.preventDefault();

app/assets/stylesheets/application.scss

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@import "application/bootstrap-custom";
55
@import "application/member-card";
66
@import "application/footer";
7+
@import "application/leaflet";
78

89
html {
910
font-size: 62.5%;
@@ -668,3 +669,13 @@ label[required]::after{
668669
display: inline;
669670
margin: 0 !important;
670671
}
672+
673+
#map {
674+
height: 650px;
675+
}
676+
677+
.last_line {
678+
@media(max-width: $screen-sm-min) {
679+
margin-bottom: 50px;
680+
}
681+
}

0 commit comments

Comments
 (0)