Add files via upload

latitude and longitude entries have been removed and geocode is invoked for selction of venue location.
This commit is contained in:
Abhinand-p 2017-04-05 03:31:53 -07:00 committed by GitHub
parent 5ed2ebe910
commit 1470976e40
3 changed files with 37 additions and 1 deletions

View file

@ -15,7 +15,7 @@
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.inputs :name, :website = f.inputs :name, :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.inputs :street, :postalcode, :city, :country, :latitude, :longitude = f.inputs :street, :postalcode, :city, :country
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
#commercials-content.tab-pane #commercials-content.tab-pane

View file

@ -0,0 +1,34 @@
#map{style: "height: 500px;" }
- popup = "<h3>#{@conference.venue.name}</h3><br>#{@conference.venue.street}<br>#{@conference.venue.city}<br>#{@conference.venue.country_name}"
- content_for(:script_body) do
:javascript
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map', { scrollWheelZoom: false }).setView([#{@conference.venue.latitude}, #{@conference.venue.longitude}], 11);
// add an OpenStreetMap tile layer
L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18
}).addTo(map);
// add a marker in the given location, attach some popup content to it and open the popup
L.marker([#{@conference.venue.latitude}, #{@conference.venue.longitude}]).addTo(map)
.bindPopup("#{popup}")
.openPopup();
// Turn scrollwheel on when user clicks
map.on('focus', function(e) {
map.scrollWheelZoom.enable();
});
// Turn scrollwheel off once the map isn't in the viewport anymore
$('#map').waypoint({
handler: function(direction) {
map.scrollWheelZoom.disable();
//alert('map');
},
offset: '90%'
});
$('#map').waypoint({
handler: function(direction) {
map.scrollWheelZoom.disable();
//alert('map');
},
offset: '10%'
});

View file

@ -41,3 +41,5 @@
.col-md-12.text-right .col-md-12.text-right
= link_to(new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do = link_to(new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do
Create Venue Create Venue