From: Date: Fri, 22 Aug 2008 22:48:50 +0000 (-0400) Subject: Conditional that redircts to user profile page if too many elections in control panel... X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/fdc554930ae758e5a1ffaefe25fa2663fcdf8ac1?ds=sidebyside;hp=6b988cf46f0efdcad41e51c425e4ea2d462f5425 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. --- 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 %>