Embeddable elctions now scale based on how many candidates in the election there...
author<jlsharps@mit.edu> <>
Mon, 12 May 2008 23:44:22 +0000 (19:44 -0400)
committer<jlsharps@mit.edu> <>
Mon, 12 May 2008 23:44:22 +0000 (19:44 -0400)
app/views/embed/full_vote.rhtml
public/images/bottom_dark.png [new file with mode: 0644]
public/images/bottom_light.png [new file with mode: 0644]
public/stylesheets/embed.css

index 170b1f55c42ebbda23f70981002b21468e9906ac..69eed9cc4bb4780d7b043a3c00689225b4a206a9 100644 (file)
@@ -2,9 +2,22 @@
 <%= link_to '<img id="header_icon" src="/images/embed_header_icon.png" />',
             {:controller => 'front'}, {:target => "_parent"} %><h2>Vote Now</h2>
 </div>
-<div id="voting-box">
+
+<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 %>
+       <%end%>
        
        <ul id="rankings-list">
+               
+               
+               
       <% @voter.vote.rankings.each do |ranking| %>
                <li class="ranking" id="ranking_<%= ranking.candidate.id %>">
                        <img alt="<%= white_list ranking.candidate.name %>"
        
        <div style="clear:both;"></div>
        
-       <div id="voting-bottom">
+       <div id="voting-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="<%= url_for :action => :confirm, :id => @password, :embed => 'true' %>"><h2 id="submit_vote_button">Submit Vote</h2></a>
                        <p><b>Drag and drop</b> to rank the choices.</p>
diff --git a/public/images/bottom_dark.png b/public/images/bottom_dark.png
new file mode 100644 (file)
index 0000000..94dd72f
Binary files /dev/null and b/public/images/bottom_dark.png differ
diff --git a/public/images/bottom_light.png b/public/images/bottom_light.png
new file mode 100644 (file)
index 0000000..4c50e4b
Binary files /dev/null and b/public/images/bottom_light.png differ
index fe0b7f283f4e7548d9e0446080a662d29ac7d13d..90e1a216ae935dee9fe1032a5d3f1a65691dfcbb 100644 (file)
@@ -104,8 +104,6 @@ a {
 \r
 #voting-box {\r
        width: 330px;\r
-       height: 317px;\r
-       background: transparent url(/images/embed_voting_bg.png) top left no-repeat;\r
        margin: 0px;\r
        padding: 0px;\r
        overflow: hidden;\r
@@ -113,7 +111,7 @@ a {
 \r
 ul {\r
        margin: 0 0 0 40px;\r
-       padding: 0 0 0 0;\r
+       padding: 0 0 0 0px;\r
        list-style: none;\r
 }\r
 \r
@@ -148,8 +146,8 @@ ul {
 #voting-bottom {\r
        color: #464646;\r
     position: absolute;\r
-    top: 318px;\r
     width: 330px;\r
+       height:53px;\r
 }\r
 \r
 #container {\r

Benjamin Mako Hill || Want to submit a patch?