mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-02 11:00:16 +01:00
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:
parent
c407fc2463
commit
a65e66168c
22 changed files with 106 additions and 138 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue