From 1f51239a3f2c15fd1cf88f0ecf96d8be01e25685 Mon Sep 17 00:00:00 2001
From:
Date: Mon, 16 Oct 2006 14:47:17 -0400
Subject: [PATCH] Added a list of recent votes to the homepage.
---
app/controllers/site_controller.rb | 1 +
app/views/site/index.rhtml | 8 ++++++++
2 files changed, 9 insertions(+)
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
--
2.39.5