Skip to content

Commit 34dac51

Browse files
committed
A lot of style updates and a bit of functionality update. Cleared out foundation remnants to use bootstrap instead. Restyled event list, menu, mostly fixed front page. We can now save future dates. Brought back google maps autocomplete, with map on edit if there's already an address. Maps display on event pages, initially static map that gets replaced with a js map. edit form in progress. Parsing date input in progress. Styles from Daniella on event/show. More things.
A lot of style updates and a bit of functionality update. Cleared out foundation remnants to use bootstrap instead. Restyled event list, menu, mostly fixed front page. We can now save future dates. Brought back google maps location search. Probably want to include a live map on the form. Need to make sure we're saving lat/long. I probably did some more things, too. styles more styles! and restructuring files. probably needs more scoping so things only get iterpreted in the proper place some cleanup and defining field types as email and tel when editing email and telephone nunmbers more cleanup ignore date on time_select, parse date coming in from date_field so rails can combine it with time_select, fix floats fixed tests, scoped a js, made sure admin-created events parse dates, moving in the direction of better semantic markup for button actions without text actually get lat and lon from a google place search, and iterate through array to find and assign the city. we probably will want to do this for all the address_components created a global .red-banner style for everywhere we use the red banner merged in daniella's work on the event/show and some updates bring in daniella's work on event/show with a bit of updating bringing in some hidden address fields to update them by parsing the location result from google. allow some fields to be saved change in event/index markup to bring in red-banner styles on the edit form we'll show a map with the current location if there is one, or of madison in general if not, and update that map based on user input udpate flash markup to use boostrap defaults add read more link on lists remove binding not using default form on event edit page since we want to mirror the layout of the single event page is possible. this might be a bad idea. sort upcoming events ascending so that those about to happen are first update scoping so we don't overlap periods rearranged some content on the event view, but more significantly brought in a map showing actual location. First we load in a static map tile from google, based on event lat lng, but then we enhance it with a js interactable map. we should probably have the static map link somewhere, like that spot on google maps. styles include event actions on event updated a test check for current user before checking for methods on the current user. also rearranged text and icons on event actions buttons changed zoom level on map, for consistency styles trying to handle date parsing when date is incomplete. still problematic add link around static map, check for org before printing org info, proper event reference on attendance link add object-fit declaration on inline styles so static map isn't squished
1 parent 1898571 commit 34dac51

36 files changed

+974
-4084
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ gem 'jquery-ui-rails'
1111
gem 'turbolinks'
1212
gem 'pry-rails'
1313
gem 'haml-rails'
14-
gem 'foundation-rails'
1514
gem 'omniauth'
1615
gem 'omniauth-facebook'
1716
gem 'omniauth-twitter'
@@ -36,6 +35,7 @@ gem 'sidekiq'
3635
gem 'sidekiq-failures'
3736
gem 'coveralls', require: false
3837
gem 'bootstrap-sass'
38+
gem 'rails_autolink'
3939

4040

4141
# Don't require so Object does not get all Sintra DSL methods

Gemfile.lock

+3-4
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ GEM
102102
figaro (0.7.0)
103103
bundler (~> 1.0)
104104
rails (>= 3, < 5)
105-
foundation-rails (5.2.0.0)
106-
railties (>= 3.1.0)
107-
sass (>= 3.2.0)
108105
google-api-client (0.7.1)
109106
addressable (>= 2.3.2)
110107
autoparse (>= 0.3.3)
@@ -233,6 +230,8 @@ GEM
233230
rails_12factor (0.0.2)
234231
rails_serve_static_assets
235232
rails_stdout_logging
233+
rails_autolink (1.1.5)
234+
rails (> 3.1)
236235
rails_serve_static_assets (0.0.2)
237236
rails_stdout_logging (0.0.3)
238237
railties (4.0.3)
@@ -352,7 +351,6 @@ DEPENDENCIES
352351
email_spec
353352
factory_girl_rails
354353
figaro
355-
foundation-rails
356354
google-api-client
357355
haml-rails
358356
httparty
@@ -376,6 +374,7 @@ DEPENDENCIES
376374
rails (= 4.0.3)
377375
rails3-jquery-autocomplete
378376
rails_12factor
377+
rails_autolink
379378
rspec-rails
380379
sass-rails
381380
sentry-raven

app/assets/images/add.png

226 Bytes
Loading

app/assets/images/amp.png

384 Bytes
Loading

app/assets/images/check.png

348 Bytes
Loading

app/assets/javascripts/application.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//= require jquery
1414
//= require jquery_ujs
15-
//= require jquery_ui
15+
//= require jquery.ui.autocomplete
1616
//= require autocomplete-rails
1717
//= require bootstrap
18-
//= require jquery-timepicker-addon
1918
//= require users
19+
//= require events
+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
if $('body').hasClass('events')
2+
if $('body').hasClass('new')
3+
seachOptions =
4+
center: new google.maps.LatLng(43.0667, -89.4000)
5+
radius: 50000
6+
autocomplete = new google.maps.places.Autocomplete(document.getElementById('places-autocomplete'), seachOptions)
7+
google.maps.event.addListener autocomplete, 'place_changed', ()->
8+
place = autocomplete.getPlace()
9+
addressArray = place.address_components
10+
i = 0
11+
12+
$('#event_lat').val(place.geometry.location.A)
13+
$('#event_lon').val(place.geometry.location.k)
14+
while i < addressArray.length
15+
if addressArray[i].types[0] is "locality"
16+
$("#event_city").val place.address_components[i].long_name
17+
break
18+
i++
19+
20+
if $('body').hasClass('edit')
21+
22+
lat = document.getElementById('event_lat').value
23+
lon = document.getElementById('event_lon').value
24+
25+
initialize = ->
26+
if lat? and lon?
27+
initialLatLng = new google.maps.LatLng(lon, lat)
28+
else
29+
initialLatLng = new google.maps.LatLng(43.0667, -89.4000)
30+
mapOptions =
31+
center: initialLatLng
32+
radius: 50000
33+
zoom: 14
34+
mapTypeId: google.maps.MapTypeId.ROADMAP
35+
searchOptions =
36+
center: new google.maps.LatLng(43.0667, -89.4000)
37+
radius: 50000
38+
map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions)
39+
# infowindow = new google.maps.InfoWindow()
40+
marker = new google.maps.Marker(
41+
position: initialLatLng
42+
map: map
43+
autocomplete = new google.maps.places.Autocomplete(document.getElementById('places-autocomplete'), searchOptions)
44+
autocomplete.bindTo "bounds", map
45+
)
46+
google.maps.event.addListener autocomplete, 'place_changed', ->
47+
# infowindow.close()
48+
marker.setVisible false
49+
place = autocomplete.getPlace()
50+
addressArray = place.address_components
51+
i = 0
52+
53+
$('#event_lat').val(place.geometry.location.A)
54+
$('#event_lon').val(place.geometry.location.k)
55+
while i < addressArray.length
56+
if addressArray[i].types[0] is "locality"
57+
$("#event_city").val place.address_components[i].long_name
58+
break
59+
i++
60+
61+
if place.geometry.viewport
62+
map.fitBounds place.geometry.viewport
63+
else
64+
map.setCenter place.geometry.location
65+
map.setZoom 14 # Why 17? Because it looks good.
66+
marker.setIcon (
67+
url: place.icon
68+
size: new google.maps.Size(71, 71)
69+
origin: new google.maps.Point(0, 0)
70+
anchor: new google.maps.Point(17, 34)
71+
scaledSize: new google.maps.Size(35, 35)
72+
)
73+
marker.setPosition place.geometry.location
74+
marker.setVisible true
75+
76+
# address = ""
77+
# if place.address_components
78+
# address = [
79+
# place.address_components[0] and place.address_components[0].short_name or ""
80+
# place.address_components[1] and place.address_components[1].short_name or ""
81+
# place.address_components[2] and place.address_components[2].short_name or ""
82+
# ].join(" ")
83+
# infowindow.setContent "<div><strong>" + place.name + "</strong><br>" + address
84+
# infowindow.open map, marker
85+
return
86+
87+
return
88+
google.maps.event.addDomListener window, "load", initialize

app/assets/javascripts/places.js

-63
This file was deleted.

app/assets/javascripts/users.js.coffee

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ $(document).ready ->
22
$("form.edit_user input[type=radio]").click ->
33
$(this).closest('form').submit()
44

5-
$('.edit-default-email').click (event) ->
5+
$('.edit-defaults').click (event) ->
66
event.preventDefault()
77
$('.default-identity .names').hide()
8-
$('.email').show()
9-
$('.save').show()
10-
11-
$('.edit-default-mobile').click (event) ->
12-
event.preventDefault()
13-
$('.default-identity .names').hide()
14-
$('.mobile_num').show()
15-
$('.save').show()
8+
$('.edit-defaults').hide()
9+
$('.email').removeClass('hidden')
10+
$('.mobile_num').removeClass('hidden')
11+
$('.save').removeClass('hidden')

app/assets/stylesheets/application.scss

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
*
1111
*= require_self
1212
*= require corgi
13-
*= require jquery-timepicker-addon
1413
*/
15-
16-
@import 'bootstrap';

0 commit comments

Comments
 (0)