Commit 7920593a87622c9957ce50a7febd2e6737ecc01f
Committed by
Antonio Terceiro
1 parent
3848a512
Exists in
staging
and in
26 other branches
Allow themes to override default map icons
Showing
2 changed files
with
13 additions
and
6 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -434,13 +434,16 @@ module ApplicationHelper | @@ -434,13 +434,16 @@ module ApplicationHelper | ||
434 | else | 434 | else |
435 | '/images/icons-app/person-'+ size.to_s() +'.png' | 435 | '/images/icons-app/person-'+ size.to_s() +'.png' |
436 | end | 436 | end |
437 | - if File.exists?(File.join(Rails.root, 'public', theme_path, icon)) | ||
438 | - theme_path + icon | ||
439 | - else | ||
440 | - icon | ||
441 | - end | 437 | + default_or_themed_icon(icon) |
442 | end | 438 | end |
439 | + end | ||
443 | 440 | ||
441 | + def default_or_themed_icon(icon) | ||
442 | + if File.exists?(File.join(Rails.root, 'public', theme_path, icon)) | ||
443 | + theme_path + icon | ||
444 | + else | ||
445 | + icon | ||
446 | + end | ||
444 | end | 447 | end |
445 | 448 | ||
446 | def profile_sex_icon( profile ) | 449 | def profile_sex_icon( profile ) |
app/views/search/_google_maps.rhtml
@@ -48,7 +48,11 @@ if (GBrowserIsCompatible()) { | @@ -48,7 +48,11 @@ if (GBrowserIsCompatible()) { | ||
48 | baseIcon.shadowSize=new GSize(36,32); | 48 | baseIcon.shadowSize=new GSize(36,32); |
49 | baseIcon.iconAnchor=new GPoint(16,32); | 49 | baseIcon.iconAnchor=new GPoint(16,32); |
50 | baseIcon.infoWindowAnchor=new GPoint(16,0); | 50 | baseIcon.infoWindowAnchor=new GPoint(16,0); |
51 | - var icon = new GIcon(baseIcon, "/images/icons-map/enterprise.png", null, "/images/icons-map/enterprise_shadow.png"); | 51 | + <% |
52 | + icon = default_or_themed_icon("/images/icons-map/enterprise.png") | ||
53 | + icon_shadow = default_or_themed_icon("/images/icons-map/enterprise_shadow.png") | ||
54 | + %> | ||
55 | + var icon = new GIcon(baseIcon, "<%= icon %>", null, "<%= icon_shadow %>"); | ||
52 | 56 | ||
53 | <% | 57 | <% |
54 | missed = false | 58 | missed = false |