From:
Date: Mon, 16 Oct 2006 18:47:17 +0000 (-0400)
Subject: Added a list of recent votes to the homepage.
X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/1f51239a3f2c15fd1cf88f0ecf96d8be01e25685?ds=sidebyside
Added a list of recent votes to the homepage.
---
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index 47ae2cb..d5eab86 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.rb
@@ -3,6 +3,7 @@ class SiteController < ApplicationController
model :user, :election
def index
+ @quickvotes = QuickVote.find_all(["quickvote = 1"]).sort {|a,b| b.enddate <=> a.enddate}[0..1]
# if the person claims they are logged in
if session[:user]
diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml
index 9fd332b..e89063d 100644
--- a/app/views/site/index.rhtml
+++ b/app/views/site/index.rhtml
@@ -13,6 +13,14 @@ methods.
<%= link_to "Create a QuickVote", :controller => 'quickvote', :action => 'create' %>
+Recent QuickVotes include:
+
+
+<% for quickvote in @quickvotes %>
+- <%= link_to (quickvote.shortdesc || "Unnamed"), quickvote_url(:votename => quickvote.name) %>
+<% end %>
+
+
Voters
If you have received an email with a token inviting you to vote in an