Consolidate list and index actions in project and context controllers.

Use simply_helpful methods to simplify DOM IDs.
Improve CSS rendering on IE7. (didn't get to test these changes on Safari!)
Make new contexts appear automatically when added with new action on home page.


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@384 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-12-30 08:51:49 +00:00
parent c407fc2463
commit a65e66168c
22 changed files with 106 additions and 138 deletions

View file

@ -6,14 +6,6 @@ class ContextController < ApplicationController
before_filter :init_todos, :only => :show
def index
list
render_action "list"
end
# Main method for listing contexts
# Set page title, and collect existing contexts in @contexts
#
def list
@page_title = "TRACKS::List Contexts"
respond_to do |wants|
wants.html
@ -91,7 +83,7 @@ class ContextController < ApplicationController
render_text ""
else
notify :warning, "Couldn't delete context \"#{@context.name}\""
redirect_to( :controller => "context", :action => "list" )
redirect_to :action => 'index'
end
end
@ -114,7 +106,7 @@ class ContextController < ApplicationController
elsif params['id']
@context = @user.contexts.find(params["id"])
else
redirect_to(:controller => "context", :action => "list" )
redirect_to :action => 'index'
end
if @user == @context.user
return @context