+
+ def create_theme_hash
+ target = Hash.new
+ params.each do |k,v|
+ target[k] = v if k=="top_bar" or k=="default_image" or k=="bg1" \
+ or k=="bg2" or k=="bottom_bar"
+ end
+ return target
+ end
+
+ # verify that the person trying to edit the election is the owner
+ def verify_owner
+ election = Election.find(params[:id])
+ unless election.user == session[:user]
+ redirect_to :controller => 'front', :action => 'index'
+ end
+ end
+
+ # verify that the election is not active
+ def verify_not_active
+ election = Election.find(params[:id])
+ unless election.active == 0
+ redirect_to :controller => 'front', :action => 'index'
+ end
+ end