From fdc554930ae758e5a1ffaefe25fa2663fcdf8ac1 Mon Sep 17 00:00:00 2001 From: Date: Fri, 22 Aug 2008 18:48:50 -0400 Subject: [PATCH] Conditional that redircts to user profile page if too many elections in control panel. Coincentally, the user profile needs some work. Removed scroll bar feature from control panel. --- app/controllers/account_controller.rb | 2 +- app/views/front/_user_summary.rhtml | 3 +++ public/stylesheets/front.css | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 57cf343..2bda7ea 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -69,7 +69,7 @@ class AccountController < ApplicationController end #====================================================================== - #The following methods are for slectricity specific uses + #The following methods are for selectricity specific uses def summary @user = User.find(params[:id]) end diff --git a/app/views/front/_user_summary.rhtml b/app/views/front/_user_summary.rhtml index 30b3799..fd4ee6f 100644 --- a/app/views/front/_user_summary.rhtml +++ b/app/views/front/_user_summary.rhtml @@ -1,5 +1,8 @@ <% if @current_elections.length < 1 %>

You have not created any elections.

+<% elsif @current_elections.length > 6 %> +

You have more than six elections which may not fit on the control panel. Clcik on the following link to go to your user profile, which lists all your elections. +<%= link_to "Summary", :controller => "account", :action => "summary", :id => session[:user].id %>

<% else %>