Commit 7920593a87622c9957ce50a7febd2e6737ecc01f

Authored by Caio SBA
Committed by Antonio Terceiro
1 parent 3848a512

Allow themes to override default map icons

app/helpers/application_helper.rb
... ... @@ -434,13 +434,16 @@ module ApplicationHelper
434 434 else
435 435 '/images/icons-app/person-'+ size.to_s() +'.png'
436 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 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 447 end
445 448  
446 449 def profile_sex_icon( profile )
... ...
app/views/search/_google_maps.rhtml
... ... @@ -48,7 +48,11 @@ if (GBrowserIsCompatible()) {
48 48 baseIcon.shadowSize=new GSize(36,32);
49 49 baseIcon.iconAnchor=new GPoint(16,32);
50 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 58 missed = false
... ...