From: Date: Tue, 19 Feb 2008 14:24:06 +0000 (-0500) Subject: added first full working version of embeddable elections X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/adfcf4dd7d989d0560e2a8f6a590dd10c5a49a08 added first full working version of embeddable elections - added several new fields to the database to support unauthenticated, embeddable, and early result visible full elections - modified full election create to allow for proper options and to display the full election code - added new layouts, views, css, and images for embeddable elections - modified full elections to work with the new form of images in the last commit - fixed several bugs related to vote recording and timestamp,s --- diff --git a/.bzrignore b/.bzrignore index 57a67d2..5304d54 100644 --- a/.bzrignore +++ b/.bzrignore @@ -7,3 +7,4 @@ tmp public/engine_files .DS_Store vendor/plugins/sitealizer/lib/last_update +public/pictures diff --git a/app/controllers/election_controller.rb b/app/controllers/election_controller.rb index 5949f56..94c203d 100644 --- a/app/controllers/election_controller.rb +++ b/app/controllers/election_controller.rb @@ -54,20 +54,13 @@ class ElectionController < ApplicationController end end - # add filter to verify that the person working on or looking at + # TODO add filter to verify that the person working on or looking at # something is the owner - def edit + def edit_general_information @election = Election.find(params[:id]) end - - def show - @sidebar_content = render_to_string :partial => 'progress', - :locals => { :page => 'review' } - - @election = Election.find(params[:id]) - end - - def update + + def update_general_information @election = Election.find(params[:id]) if @election.update_attributes(params[:election]) flash[:notice] = 'Election was successfully updated.' @@ -77,6 +70,14 @@ class ElectionController < ApplicationController end end + + def show + @sidebar_content = render_to_string :partial => 'progress', + :locals => { :page => 'review' } + + @election = Election.find(params[:id]) + end + def start_election @election = Election.find(params[:id]) @election.voters.each do |voter| @@ -103,6 +104,12 @@ class ElectionController < ApplicationController @election.candidates << @candidate if @candidate.save + # check to see if they've uploaded a picture + if params[:picture][:uploaded_data] + picture = Picture.new(params[:picture]) + @candidate.picture = picture if picture.save + end + @candidate = Candidate.new redirect_to :action => 'edit_candidates', :id => @election.id else @@ -145,6 +152,16 @@ class ElectionController < ApplicationController voter = Voter.find( params[:id] ) voter.destroy end + + def toggle_authenticated + @election = Election.find(params[:id]) + if params[:authenticated] == "1" + @election.authenticated = true + else + @election.authenticated = false + end + @election.save + end ## methods for computing and printing results #################################################################### diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index 868bc4c..cdc045d 100644 --- a/app/controllers/voter_controller.rb +++ b/app/controllers/voter_controller.rb @@ -23,34 +23,48 @@ class VoterController < ApplicationController require_dependency "election" def index - if params[:urlpassword] + if params[:election_id] + @election = Election.find(params[:election_id]) + unless @election.authenticated? + @voter = Voter.find(:all, + :conditions => ["session_id = ? and election_id = ?", + session.session_id, @election.id])[0] + + @voter = Voter.new unless @voter + + @voter.election = @election + @voter.session_id = session.session_id + @password = "open." + @election.id.to_s + end + elsif params[:urlpassword] password = params[:urlpassword] if @voter = FullVoter.find(:all, :conditions => [ "password = ?", password ] )[0] + @election = @voter.election + @password = @voter.password + end + end - @voter.vote = Vote.new if @voter.vote.nil? - @voter.vote.set_defaults! if @voter.vote.rankings.empty? + if @voter and @election + # initialize things if the vote is blank + if @voter.vote.nil? + @voter.vote = Vote.new + @voter.save + end + + @voter.vote.set_defaults! if @voter.vote.rankings.empty? - @election = @voter.election - - # if the election is now finished - if @election.enddate < Time.now - # compute and display results - - @results = @election.results - @candidates = {} - @election.candidates.each {|c| @candidates[c.id] = c} - @names = @election.names_by_id - - @sidebar_content = render_to_string(:partial => 'results_sidebar') - render :action => 'results' + # if the election is now finished + if @election.enddate < Time.now + redirect_to :action => :results, :id => @password + else + @sidebar_content = render_to_string(:partial => 'vote_sidebar') + if @election.embeddable? and params[:embed] == "true" + render :template => 'embed/full_vote', :layout => 'embed' else - @sidebar_content = render_to_string(:partial => 'vote_sidebar') render :action => 'full_vote' end - elsif params[:urlpassword] - redirect_to :action => 'index' end end end @@ -100,7 +114,13 @@ class VoterController < ApplicationController def confirm if authenticate @voter.vote.confirm! - render :action => 'thanks' + + if @voter.election.embeddable? and params[:embed] == "true" \ + and @voter.election.early_results? + redirect_to :action => :results, :id => @password, :embed => 'true' + else + render :action => 'thanks' + end else redirect_to :action => 'index' end @@ -117,11 +137,47 @@ class VoterController < ApplicationController end end + def results + if authenticate and + (@voter.election.early_results? \ + or @voter.election.enddate < Time.now) + + @election = @voter.election + # compute and display results + + @results = @election.results + @candidates = {} + @election.candidates.each {|c| @candidates[c.id] = c} + @names = @election.names_by_id + + @sidebar_content = render_to_string(:partial => 'results_sidebar') + if @election.embeddable? and params[:embed] == "true" + render :template => 'embed/results', :layout => 'embed' + else + render :action => 'results' + end + else + redirect_to :action => 'index' + end + end private def authenticate password = params[:id] - @voter = FullVoter.find(:all, :conditions => [ "password = ?", password ] )[0] + if password == "open" + election = Election.find(params[:format]) + unless election.authenticated? + @voter = Voter.find(:all, + :conditions => ["session_id = ? and election_id = ?", + session.session_id, election.id])[0] + @password = "open." + election.id.to_s + end + else + @voter = FullVoter.find(:all, + :conditions => [ "password = ?", password ] )[0] + @password = @voter.password + end + @voter end end diff --git a/app/models/election.rb b/app/models/election.rb index 7d8ad80..08ef1a5 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -73,7 +73,7 @@ class Election < ActiveRecord::Base reasons << "You must have at least two candidates." end - if self.voters.length <= 1 + if self.voters.length <= 1 and self.authenticated? reasons << "You must have at least two voters." end @@ -97,6 +97,10 @@ class Election < ActiveRecord::Base active == 2 end + def authenticated? + authenticated + end + def shortdesc shortdesc = description.split(/\n/)[0] end diff --git a/app/models/picture.rb b/app/models/picture.rb index 04b368e..9f17ec4 100644 --- a/app/models/picture.rb +++ b/app/models/picture.rb @@ -21,7 +21,7 @@ class Picture < ActiveRecord::Base has_attachment :storage => :file_system, :max_size => 1.megabytes, - :thumbnails => { :thumb => '70x53>' }, + :thumbnails => { :thumb => '70x53' }, :processor => :Rmagick validates_as_attachment diff --git a/app/models/token.rb b/app/models/token.rb index aa432d6..c2d3667 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -23,7 +23,7 @@ class Token < ActiveRecord::Base super token_generator = UniqueTokenGenerator.new( 16 ) - until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty? + until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty? and token[0..3] != "open" self.token = token_generator.token end diff --git a/app/models/vote.rb b/app/models/vote.rb index bb91a6b..bef3502 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -69,13 +69,9 @@ class Vote < ActiveRecord::Base rankings.each { |ranking| ranking.destroy } end - def settime - self.time = Time.now - self.save - end - def confirm! self.confirmed = 1 + self.time = Time.now self.save unless self.voter.election.quickvote? @@ -105,7 +101,7 @@ class Vote < ActiveRecord::Base # too. It creates a vote with the candidates listed in order of preference # based on alphabetical order. Meant to be manipulated and then confirmed def set_defaults! - self.votes = voter.election.candidates.sort.collect {|c| c.id } + self.votes = self.voter.election.candidates.sort_by { rand }.collect {|c| c.id } self.save end diff --git a/app/views/election/_candidate_box_info.rhtml b/app/views/election/_candidate_box_info.rhtml new file mode 100644 index 0000000..76d56c0 --- /dev/null +++ b/app/views/election/_candidate_box_info.rhtml @@ -0,0 +1,15 @@ +
+ <% if @current_candidate.picture %> +
+ +
+ <% end %> +
+ <% if @current_candidate.description.length > 0 %> + <%= h(@current_candidate.description) %> + <% else %> + + <% end %> +
+
+
diff --git a/app/views/election/_candidate_form.rhtml b/app/views/election/_candidate_form.rhtml index fcbf072..75e5c3e 100644 --- a/app/views/election/_candidate_form.rhtml +++ b/app/views/election/_candidate_form.rhtml @@ -6,6 +6,6 @@

(optional and < 100x100 pixels)
-<%= file_field :candidate, :picture %>

+<%= file_field :picture, :uploaded_data%>

diff --git a/app/views/election/_candidate_line.rhtml b/app/views/election/_candidate_line.rhtml index 6b5b553..2fc9a63 100644 --- a/app/views/election/_candidate_line.rhtml +++ b/app/views/election/_candidate_line.rhtml @@ -10,7 +10,7 @@
+

>Anyone will be able to +vote in this election.

+ +
> <%= render :partial => 'voter_list' %> <% form_tag (:action => 'edit_voters', :id => @election.id) do %> <%= render :partial => 'voters_form' %> <% end %> +
+ +<%= check_box :election, :authenticated %> Only allow registered voters + +<%= observe_field "election_authenticated", + :url => { :action => 'toggle_authenticated', :id => @election.id }, + :complete => 'Element.toggle($("voter_info_box")); Element.toggle($("unauth_notice"));', + :with => 'authenticated' %> + +
Continue diff --git a/app/views/election/show.rhtml b/app/views/election/show.rhtml index 3e63628..87529d1 100644 --- a/app/views/election/show.rhtml +++ b/app/views/election/show.rhtml @@ -9,6 +9,11 @@ <% elsif @election.done? %>
Election is finished. <%= link_to "View results", :action => 'results', :id => @election.id %>.
+<% else %> +

+ <%= link_to "Edit General Information", + :action => 'edit_general_information', :id => @election.id %> +

<% end %>

Summary

@@ -23,29 +28,39 @@ <%= h(@election.description) %> -

End Date

+

Additional Information

-
-<%= @election.enddate %> -
+ + +
Candidates
-<% unless @election.candidates.empty? %> - <%= render :partial => 'candidate_list' %> - <% unless @election.active %> -

<%= link_to "Add, remove, or edit candidates.", :action => 'edit_candidates', :id => @election.id %>

- <% end %> -<% else %> -

There are currently no candidates registered. <%= link_to "Add some!", :action => 'edit_candidates', :id => @election.id unless @election.active %>

+<% if not (@election.active? or @election.done?) %> +

+ <%= link_to "Edit Candidates", + :action => 'edit_candidates', :id => @election.id %>

+<% end %> + + +<% if @election.candidates.empty? %> +

There are currently no candidates registered. + <%= link_to "Add some!", :action => 'edit_candidates', :id => @election.id %> +

+<% else %> + <%= render :partial => 'candidate_list' %> <% end %>
@@ -53,14 +68,26 @@
-<% unless @election.voters.empty? %> - <%= render :partial => 'voter_list' %> - <%= link_to "Add or remove voters.", :action => 'edit_voters', :id => @election.id unless @election.active %>

+<% if not (@election.active? or @election.done?) %> +

+ <%= link_to "Change Voters/Options", + :action => 'edit_voters', :id => @election.id %>

+<% end %> + +<% if not @election.authenticated? %> +

This election is open the public.

+<% elsif @election.voters.empty? %> +

There are currently no voters registered. + <%= link_to "Add some!", :action => 'edit_voters', + :id => @election.id %>

<% else %> -

There are currently no voters registered. <%= link_to "Add some!", :action => 'edit_voters', :id => @election.id unless @election.active %>

+ <%= render :partial => 'voter_list' %> +

<%= link_to "Add or remove voters.", :action => 'edit_voters', + :id => @election.id unless @election.active? or @election.done? %> +

<% end %> -<% unless @election.active? %> +<% if not (@election.active? or @election.done?) %>
Start Election @@ -85,11 +112,28 @@
  • The vote will be "frozen" so that further edits to the candidate list and voting list cannot occur.
  • + <% if @election.authenticated? %>
  • All voters will be emailed notifying them that the vote has begun and of their unique login token.
  • + <% end %>
<%= button_to 'Start Election!', :action => 'start_election', :id => @election.id %> <% end %> +<% elsif @election.embeddable? %> + +
+ Embedding + +
+ + +

To embed your election, copy and paste the following code into your +homepage:

+ +
+
<%= h("") %>
+
+ <% end %> diff --git a/app/views/embed/full_vote.rhtml b/app/views/embed/full_vote.rhtml new file mode 100644 index 0000000..70a6825 --- /dev/null +++ b/app/views/embed/full_vote.rhtml @@ -0,0 +1,35 @@ + +
+ +
    + <% @voter.vote.rankings.each do |ranking| %> +
  • + <%= white_list ranking.candidate.name %> +

    + <%= white_list ranking.candidate.name %>
    + <%= white_list ranking.candidate.description %>

    +
  • + <% end %> +
+ +
+ +
+
+

Submit Vote

+

Drag and drop to rank your favorite videos

+
+
+
+ +<%= sortable_element 'rankings-list', + :url => { :action => "sort_candidates", :id => @voter.vote.id } %> + diff --git a/app/views/embed/results.rhtml b/app/views/embed/results.rhtml new file mode 100644 index 0000000..b9b1eb4 --- /dev/null +++ b/app/views/embed/results.rhtml @@ -0,0 +1,36 @@ + +
+ +
    + <% @election.ssd_result.ranked_candidates.flatten.each do |ranking_id| %> + <% ranking = @candidates[ranking_id] %> +
  • + <%= white_list ranking.name %> +

    + <%= white_list ranking.name %>
    + <%= white_list ranking.description %>

    +
  • + <% end %> +
+ +
+ +
+
+ 'true' %>">

Results

+ +

Your vote was recorded correctly.

+ +
+
+
+ + diff --git a/app/views/layouts/embed.rhtml b/app/views/layouts/embed.rhtml new file mode 100644 index 0000000..d8290fa --- /dev/null +++ b/app/views/layouts/embed.rhtml @@ -0,0 +1,19 @@ + + + + + Selectricity + <%= stylesheet_link_tag "embed", :media => "all" %> + <%begin%> + <%= stylesheet_link_tag "ie6hacks", :media => "all" if + request.user_agent =~ /msie\s(5\.[5-9]|[6]\.[0-9]*).*(win)/i %> + <%rescue NoMethodError%> + <%end%> + <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %> + + + + <%= @content_for_layout %> + + + diff --git a/app/views/voter/_results_sidebar.rhtml b/app/views/voter/_results_sidebar.rhtml index 9814aed..3a9ebb0 100644 --- a/app/views/voter/_results_sidebar.rhtml +++ b/app/views/voter/_results_sidebar.rhtml @@ -3,5 +3,5 @@

Details

-

<%= link_to "Auditing Information", { :action => 'details', :id => @voter.password }, :popup => [] %>

+

<%= link_to "Auditing Information", { :action => 'details', :id => @password }, :popup => [] %>

diff --git a/app/views/voter/_vote.rhtml b/app/views/voter/_vote.rhtml index 914077c..bd1040e 100644 --- a/app/views/voter/_vote.rhtml +++ b/app/views/voter/_vote.rhtml @@ -11,7 +11,7 @@ least preferred. Please list all choices in every vote. (For example, 123 or 321 or 213, etc.)

-<%= form_tag :action => 'review', :id => @voter.password %> +<%= form_tag :action => 'review', :id => @password %> <%= text_field :vote, :votestring -%> <%= submit_tag "Vote!" %> diff --git a/app/views/voter/_vote_sidebar.rhtml b/app/views/voter/_vote_sidebar.rhtml index 5b8d038..2f250e0 100644 --- a/app/views/voter/_vote_sidebar.rhtml +++ b/app/views/voter/_vote_sidebar.rhtml @@ -6,5 +6,5 @@ order.

<%= render :partial => 'common/sortable_vote' %>
-<%= button_to "Submit Vote", :action => 'review', :id => @voter.password %> +<%= button_to "Submit Vote", :action => 'review', :id => @password %>
diff --git a/app/views/voter/full_vote.rhtml b/app/views/voter/full_vote.rhtml index 9d4f1d0..5e8a8d1 100644 --- a/app/views/voter/full_vote.rhtml +++ b/app/views/voter/full_vote.rhtml @@ -30,12 +30,10 @@ vote.

<% @voter.election.candidates.each do |candidate| %> <% @current_candidate = candidate %> -
-

<%=h @current_candidate.name -%>

-
- <%=h (@current_candidate.description) %> -
+

<%= h @current_candidate.name %>

+ <%= render :partial => 'election/candidate_box_info' %>
<% end %> + diff --git a/app/views/voter/review.rhtml b/app/views/voter/review.rhtml index d9ecf19..657c075 100644 --- a/app/views/voter/review.rhtml +++ b/app/views/voter/review.rhtml @@ -24,13 +24,12 @@ preferred to least preferred:

Please select from one of the following pages.

-

<%= button_to 'Confirm This Vote', :action => 'confirm', :id => @voter.password %>

+

<%= button_to 'Confirm This Vote', :action => 'confirm', :id => @password %>

If you choose, you will be able to go back
and change it up until the end of hte voting period.

-

<%= button_to 'Discard This Vote', votepassword_url( - :action => 'index', :urlpassword => @voter.password) %>

+ :action => 'index', :urlpassword => @password) %>

You will be returned to the voting page to vote
again, if you choose.

diff --git a/config/routes.rb b/config/routes.rb index e2f458d..8c52ca0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,13 +17,17 @@ ActionController::Routing::Routes.draw do |map| map.connect 'voter/:action', :controller => 'voter', - :requirements => { :action => /(review|confirm|authenticate|index|login|reminder)/ } + :requirements => { :action => /(review|confirm|authenticate|index|login|reminder|results)/ } + + map.voteopen 'voter/open.:election_id', + :controller => 'voter', + :action => 'index' map.votepassword 'voter/:urlpassword', :controller => 'voter', :action => 'index' - map.connect 'quickvote/:action/:id', + map.connect 'quickvote/:action/(open.)?:id', :controller => 'quickvote', :requirements => { :action => /(create|add_candidate|sort_candidates|my_quickvotes)/ } diff --git a/db/migrate/002_add_embeddable_support.rb b/db/migrate/002_add_embeddable_support.rb new file mode 100644 index 0000000..48fa00d --- /dev/null +++ b/db/migrate/002_add_embeddable_support.rb @@ -0,0 +1,16 @@ +class AddEmbeddableSupport < ActiveRecord::Migration + def self.up + add_column :elections, :embeddable, :boolean, + :null => false, :default => false + add_column :elections, :authenticated, :boolean, + :null => false, :default => true + add_column :elections, :early_results, :boolean, + :null => false, :default => false + end + + def self.down + remove_column :elections, :embeddable + remove_column :elections, :authenticated + remove_column :elections, :early_results + end +end diff --git a/db/schema.rb b/db/schema.rb index 1195e09..aa46f6f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,7 +2,7 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 1) do +ActiveRecord::Schema.define(:version => 2) do create_table "candidates", :force => true do |t| t.column "election_id", :integer, :null => false @@ -23,6 +23,9 @@ ActiveRecord::Schema.define(:version => 1) do t.column "quickuser", :string t.column "election_method", :string, :limit => 100, :default => "ssd" t.column "type", :string, :limit => 100, :default => "", :null => false + t.column "embeddable", :boolean, :default => false, :null => false + t.column "authenticated", :boolean, :default => true, :null => false + t.column "early_results", :boolean, :default => false, :null => false end add_index "elections", ["user_id"], :name => "fk_user_election" diff --git a/public/images/default_icon.png b/public/images/default_icon.png new file mode 100644 index 0000000..57c9731 Binary files /dev/null and b/public/images/default_icon.png differ diff --git a/public/images/embed_basic_bg.png b/public/images/embed_basic_bg.png new file mode 100644 index 0000000..a014a01 Binary files /dev/null and b/public/images/embed_basic_bg.png differ diff --git a/public/images/embed_header_icon.png b/public/images/embed_header_icon.png new file mode 100644 index 0000000..5c65105 Binary files /dev/null and b/public/images/embed_header_icon.png differ diff --git a/public/images/embed_results_changevote.png b/public/images/embed_results_changevote.png new file mode 100644 index 0000000..534533b Binary files /dev/null and b/public/images/embed_results_changevote.png differ diff --git a/public/images/embed_voting_bg.png b/public/images/embed_voting_bg.png new file mode 100644 index 0000000..bbf30b9 Binary files /dev/null and b/public/images/embed_voting_bg.png differ diff --git a/public/images/embed_voting_submitvote.png b/public/images/embed_voting_submitvote.png new file mode 100644 index 0000000..a435188 Binary files /dev/null and b/public/images/embed_voting_submitvote.png differ diff --git a/public/stylesheets/embed.css b/public/stylesheets/embed.css new file mode 100644 index 0000000..fe0b7f2 --- /dev/null +++ b/public/stylesheets/embed.css @@ -0,0 +1,202 @@ +@charset "utf-8"; +/* CSS Document */ + +/***************************************************************************************** + * + * "Reset Reloaded" + * Thanks to Eric Meyer + * http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ + * + */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +strong, h2, h3 { + font-weight: bold; +} + +body { + line-height: 1; + color: black; + background: white; +} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: separate; + border-spacing: 0; +} + +caption, th, td { + text-align: left; + font-weight: normal; +} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} + +blockquote, q { + quotes: "" ""; +} + + + + + +/* GENERIC *****************************************************************************/ + +body { + font-family: helvetica,verdana; + font-size: 11px; + color: white; +} + +a { + color: inherit; + text-decoration: none; +} + +.submit_vote_button { + cursor: pointer; +} + + +#header { + width: 330px; + height: 53px; + background: transparent url(/images/embed_basic_bg.png) top left no-repeat; + margin: 0px; + padding: 0px; + overflow: hidden; +} + +#header h2 { + font-size: 25px; + margin: 12px 0px 12px 7px; + color: #FFF; + font-weight: normal; +} +#header_icon { + display: float; + float: right; +} + + +/* VOTING ******************************************************************************/ + +#voting-box { + width: 330px; + height: 317px; + background: transparent url(/images/embed_voting_bg.png) top left no-repeat; + margin: 0px; + padding: 0px; + overflow: hidden; +} + +ul { + margin: 0 0 0 40px; + padding: 0 0 0 0; + list-style: none; +} + +.ranking { + margin: 0px; + height: 53px; + overflow: hidden !important; +} + +.ranking img { + margin: 0 0 0 0; + padding: 0 0 0 0; + float: left; + clear: left; +} + +.ranking-info { + margin-left: 70px; + width: 202px; + height: 23px; + padding: 11px 6px 13px 6px; + color: #666666; + line-height: 1.2em; + border: 3px solid transparent; +} + +.ranking-info a { + font-weight: bold; + color: #666666; +} + +#voting-bottom { + color: #464646; + position: absolute; + top: 318px; + width: 330px; +} + +#container { + margin: 0 auto 0 auto; + width: 90%; +} + +#voting-bottom h2, #results-bottom h2 { + padding-top: 20px; + height: 0px; + width: 119px; + overflow: hidden; + float: left; + margin-top: 16px; +} + +#voting-bottom p, #results-bottom p { + float: left; + width: 160px; + margin-top: 12px; + margin-left: 10px; + line-height: 1.3em; +} + + +#voting-bottom h2 { + background: transparent url(/images/embed_voting_submitvote.png); +} + +#results-bottom h2 { + background: transparent url(/images/embed_results_changevote.png); +} + + + + + + + + + + + + + + + + + + diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index e7ff4a6..1ac598a 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -439,14 +439,9 @@ div.photo img { .candidate_box_info { margin: 0.5em 0 0.5em 3em; } -/*.candidate_box_picture { - width: 100px; +.candidate_box_picture { float: left; - margin: 0 0.8em 0.5em 0; -}*/ -.candidate_box_picture img { - width: 100px; - border: 1px solid black; + margin: 0 0.8em 0.4em 0; } .candidate_box_description { display: inline;