Custom embeddable code works for png's except for top_bar
[selectricity-live] / app / views / embed / _backdrop.rhtml
index 847f9a3e3ce5c2b6ee18440c2af474f407e991bf..bee6fdf5f074c16fed478f90ba519e4e4ee6001c 100644 (file)
@@ -1,10 +1,17 @@
 <%@election.candidates.length.times do |count|-%>
        <% if (count%2)==0-%>
-               <img src="/images/widget_dark.png" 
-               style="position:absolute;top:<%=(count+1)*53%>px;">
-               <% else -%>
-               <img src="/images/widget_light.png" 
-               style="position:absolute;top:<%=(count+1)*53%>px">
+               <img src=" <% if @bg1 -%>
+                       <%= url_for @bg1.public_filename %>
+               <% else %>
+                       /images/widget_dark.png 
+               <% end -%> " style="position:absolute;top:<%=(count+1)*53%>px"/> 
+       <% else -%>
+               <img src=" <% if @bg2 -%>
+                       <%=url_for @bg2.public_filename %>
+               <% else %>
+                       /images/widget_light.png
+               <% end -%>" 
+                       style="position:absolute;top:<%=(count+1)*53%>px">
        <% end -%>
        <p class="position" style="top:<%=(10+(count+1)*53)%>px;left:10px">
        <%=count+1 -%>

Benjamin Mako Hill || Want to submit a patch?