fix show maps in profiles/show

This commit is contained in:
szpyxlwoni
2012-12-07 12:18:46 +08:00
parent 120abe5666
commit 324bb3a186
6 changed files with 21 additions and 8 deletions
+18
View File
@@ -0,0 +1,18 @@
$ ->
$('#view_map').each ->
lat = $(this).data('lat')
lng = $(this).data('lng')
map_options = {
center: new google.maps.LatLng(lat, lng),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(this, map_options)
marker_options = {
position: new google.maps.LatLng(lat, lng),
map: map
}
marker = new google.maps.Marker(marker_options)
+1
View File
@@ -1,5 +1,6 @@
- content_for :javascript_includes do
= javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{ENV['GOOGLE_API']}&sensor=false"
= javascript_include_tag "profiles"
div.hero-unit.sexy-bg
div.row.person
div.span4
-3
View File
@@ -37,9 +37,6 @@ Ocelots::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
#config.threadsafe! enables allow_concurrency, cache_classes, dependency_loading and preload_frameworks to make the application threadsafe.
config.threadsafe!
# paperclip will save to public/system/[object] when running local
if(ENV['S3_BUCKET'].nil?)
config.paperclip_storage_options = {}
-3
View File
@@ -62,9 +62,6 @@ Ocelots::Application.configure do
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
#config.threadsafe! enables allow_concurrency, cache_classes, dependency_loading and preload_frameworks to make the application threadsafe.
config.threadsafe!
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
+1 -1
View File
@@ -1,6 +1,6 @@
module TeamFilter
def with_team
@team = Team.find_by_slug params[:slug]
@team = Team.find_by_slug params[:slug]
unless current_person.allowed_to_view_team?(@team)
@team = nil
end
+1 -1
View File
@@ -72,7 +72,7 @@ describe TeamsController do
assigns(:memberships).should_not be_nil
end
it 'not create team with null name' do
it 'not create team with null slug' do
lambda do
post :create, team: {name: 'CDI', slug: nil}, org_ids: [@organisation.id.to_s]
end.should_not change(Team, :count)