]> projects.mako.cc - selectricity-live/commitdiff
The results page should now work for scaling embeddableelections as well.
author<jlsharps@mit.edu> <>
Thu, 22 May 2008 18:29:58 +0000 (14:29 -0400)
committer<jlsharps@mit.edu> <>
Thu, 22 May 2008 18:29:58 +0000 (14:29 -0400)
app/views/embed/_backdrop.rhtml [new file with mode: 0644]
app/views/embed/full_vote.rhtml
app/views/embed/results.rhtml
public/stylesheets/embed.css

diff --git a/app/views/embed/_backdrop.rhtml b/app/views/embed/_backdrop.rhtml
new file mode 100644 (file)
index 0000000..847f9a3
--- /dev/null
@@ -0,0 +1,13 @@
+<%@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">
+       <% end -%>
+       <p class="position" style="top:<%=(10+(count+1)*53)%>px;left:10px">
+       <%=count+1 -%>
+       </p>
+       
+<%end%>
\ No newline at end of file
index 89e384ca9d5c1885b6dd8ee2dff5bb56ae81c7fa..56715eb064203e78f174e8627b9521e0b3f77f2e 100644 (file)
@@ -4,19 +4,8 @@
 </div>
 
 <div id="voting-box" height="<%=(@election.candidates.length + 2)*53 %>px">
 </div>
 
 <div id="voting-box" height="<%=(@election.candidates.length + 2)*53 %>px">
-       <%@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">
-               <% end %>
-               <p class="position"
-               style="position:absolute;top:<%=(10+(count+1)*53)%>px;left:10px">
-                       <%=count+1%>
-               </p>
-       <%end%>
+       
+       <%= render :partial => '/embed/backdrop' %>
        
        <ul id="rankings-list">
       <% @voter.vote.rankings.each do |ranking| %>
        
        <ul id="rankings-list">
       <% @voter.vote.rankings.each do |ranking| %>
index dea9b61a18ff5b2f0a249bd2a7c15e2dc10b2072..a4ea4c1d210f4b42441465220b57f5d2f18ae0e1 100644 (file)
@@ -3,7 +3,9 @@
             {:controller => 'front'}, {:target => "_parent"} %>
 <h2>Current Standings</h2>
 </div>
             {:controller => 'front'}, {:target => "_parent"} %>
 <h2>Current Standings</h2>
 </div>
-<div id="voting-box">
+<div id="voting-box" height="<%=(@election.candidates.length + 2)*53 %>px">
+       
+       <%= render :partial => '/embed/backdrop' %>
        
        <ul id="rankings-list">
       <% @election.ssd_result.ranked_candidates.flatten.each do |ranking_id| %>
        
        <ul id="rankings-list">
       <% @election.ssd_result.ranked_candidates.flatten.each do |ranking_id| %>
        
        <div style="clear:both;"></div>
        
        
        <div style="clear:both;"></div>
        
-       <div id="results-bottom">
+       <div id="results-bottom" style="
+       <% if @election.candidates.length%2 == 0 %>
+       background-image:url(/images/bottom_dark.png)
+       <%else%>
+       background-image:url(/images/bottom_light.png)
+       <%end%>">
                <div id="container">
                 <a href="<%= votepassword_url :urlpassword => "open." + @voter.election.id.to_s, 'embed' => 'true' %>"><h2>Results</h2></a>
                        
                <div id="container">
                 <a href="<%= votepassword_url :urlpassword => "open." + @voter.election.id.to_s, 'embed' => 'true' %>"><h2>Results</h2></a>
                        
index 86248c1bbae10dbe757b28b84a36a8398ebcbbcb..164381fca409c31cd128fb57d7fe4287f1287b83 100644 (file)
@@ -113,6 +113,7 @@ p.position {
        color: #000000;\r
        font-size:32px;\r
        font-family:'arial';\r
        color: #000000;\r
        font-size:32px;\r
        font-family:'arial';\r
+       position:absolute;\r
 }\r
 \r
 ul {\r
 }\r
 \r
 ul {\r
@@ -124,6 +125,7 @@ ul {
 .ranking {\r
        margin: 0px;\r
        height: 53px;\r
 .ranking {\r
        margin: 0px;\r
        height: 53px;\r
+       position:relative;\r
     overflow: hidden !important;\r
 }\r
 \r
     overflow: hidden !important;\r
 }\r
 \r
@@ -156,6 +158,12 @@ ul {
        height:53px;\r
 }\r
 \r
        height:53px;\r
 }\r
 \r
+#results-bottom {\r
+       position: absolute;\r
+       width: 330px;\r
+       height:53px;\r
+}\r
+\r
 #container {\r
        margin: 0 auto 0 auto;\r
        width: 90%;\r
 #container {\r
        margin: 0 auto 0 auto;\r
        width: 90%;\r

Benjamin Mako Hill || Want to submit a patch?