Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed list to index and update (hopefully) all references and use ... #1

Merged
merged 1 commit into from
Oct 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def denied(reason=nil)

private
def record_not_found
redirect_to :controller => :tree_display,:action => :list
redirect_to tree_display_index_path
end

end
10 changes: 5 additions & 5 deletions app/controllers/assignment_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def copy
redirect_to :action => 'edit', :id => @assignment.id
else
flash[:error] = 'The assignment was not able to be copied. Please check the original assignment for missing information.'
redirect_to :action => 'list', :controller => 'tree_display'
redirect_to tree_display_index_path
end
end

Expand Down Expand Up @@ -71,7 +71,7 @@ def toggle_access
assignment.private = !assignment.private
assignment.save

redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# This functions finds the epoch time in seconds of the due_at parameter and finds the difference of it
Expand Down Expand Up @@ -778,7 +778,7 @@ def delete
end
end
undo_link("Assignment: \"#{@assignment.name}\" has deleted successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

#--------------------------------------------------------------------------------------------------------------------
Expand All @@ -800,7 +800,7 @@ def toggle_access
@assignment.private = !@assignment.private
@assignment.save
undo_link("Assignment \"#{@assignment.name}\" has been made private successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

#--------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -843,7 +843,7 @@ def remove_assignment_from_course
newpath = assignment.get_path rescue nil
FileHelper.update_file_location(oldpath,newpath)
undo_link("Assignment \"#{@assignment.name}\" has been removed from course successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

:private
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def toggle_access
assignment = Assignment.find(params[:id])
assignment.private = !assignment.private
assignment.save
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def new
Expand Down Expand Up @@ -45,7 +45,7 @@ def create
# flash[:success] = 'Assignment was successfully created.'
# redirect_to controller: :assignments, action: :edit, id: @assignment.id
#AAD#
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
undo_link("Assignment \"#{@assignment.name}\" has been created successfully. ")
#AAD#
else
Expand Down Expand Up @@ -339,7 +339,7 @@ def copy
redirect_to :action => 'edit', :id => new_assign.id
else
flash[:error] = 'The assignment was not able to be copied. Please check the original assignment for missing information.'
redirect_to :action => 'list', :controller => 'tree_display'
redirect_to tree_display_index_path
end
end

Expand Down Expand Up @@ -378,7 +378,7 @@ def delete
end
end

redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def list
Expand Down Expand Up @@ -421,7 +421,7 @@ def remove_assignment_from_course
assignment.save
newpath = assignment.get_path rescue nil
FileHelper.update_file_location(oldpath, newpath)
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def copy_assignment_questionnaire (old_assign, new_assign)
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/course_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def update
end
@course.update_attributes(params[:course])
undo_link("Course \"#{@course.name}\" has been updated successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def copy
Expand All @@ -69,7 +69,7 @@ def copy

rescue
flash[:error] = 'The course was not able to be copied: '+$!
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end
end

Expand All @@ -88,7 +88,7 @@ def create
end
FileHelper.create_directory(@course)
undo_link("Course \"#{@course.name}\" has been created successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
rescue
flash[:error] = $! #"The following error occurred while saving the course: #"+
redirect_to :action => 'new'
Expand All @@ -111,7 +111,7 @@ def delete
#}
@course.destroy
undo_link("Course \"#{@course.name}\" has been deleted successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def toggle_access
Expand All @@ -124,7 +124,7 @@ def toggle_access
end
@access = @course.private == true ? "private" : "public"
undo_link("Course \"#{@course.name}\" has been made #{@access} successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def view_teaching_assistants
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/lottery_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def run_intelligent_bid
end
flash[:notice] = "Please go to the topics section of edit assignment, to check if the assignments were done"
end
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

#delete all the waitlist entries for the user
Expand Down
14 changes: 7 additions & 7 deletions app/controllers/questionnaires_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def copy
redirect_to :back
rescue
flash[:error] = 'The questionnaire was not able to be copied. Please check the original course for missing information.'+$!
redirect_to :action => 'list', :controller => 'tree_display'
redirect_to tree_display_index_path
end
end

Expand Down Expand Up @@ -94,7 +94,7 @@ def delete
end
end

redirect_to :action => 'list', :controller => 'tree_display'
redirect_to tree_display_index_path
end

def view
Expand Down Expand Up @@ -254,7 +254,7 @@ def create_questionnaire
end
save

redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end
end

Expand Down Expand Up @@ -333,7 +333,7 @@ def create
@questionnaire.instructor_id = session[:user].id
end
save
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def update
Expand All @@ -345,7 +345,7 @@ def update
end

if @questionnaire.update_attributes(params[:questionnaire])
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
else
render 'edit'
end
Expand Down Expand Up @@ -373,7 +373,7 @@ def toggle_access
@questionnaire.save
@access = @questionnaire.private == true ? "private" : "public"
undo_link("Questionnaire \"#{@questionnaire.name}\" has been made #{@access} successfully. ")
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

private
Expand Down Expand Up @@ -651,7 +651,7 @@ def clone_questionnaire_details(questions)
rescue

flash[:error] = 'The questionnaire was not able to be copied. Please check the original course for missing information.'+$!
redirect_to :action => 'list', :controller => 'tree_display'
redirect_to tree_display_index_path
end
end
end
26 changes: 13 additions & 13 deletions app/controllers/tree_display_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,81 +9,81 @@ def action_allowed?
def goto_questionnaires
node_object = TreeFolder.find_by_name('Questionnaires')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to review rubrics
def goto_review_rubrics
node_object = TreeFolder.find_by_name('Review')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to metareview rubrics
def goto_metareview_rubrics
node_object = TreeFolder.find_by_name('Metareview')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to teammate review rubrics
def goto_teammatereview_rubrics
node_object = TreeFolder.find_by_name('Teammate Review')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to author feedbacks
def goto_author_feedbacks
node_object = TreeFolder.find_by_name('Author Feedback')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to global survey
def goto_global_survey
node_object = TreeFolder.find_by_name('Global Survey')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to surveys
def goto_surveys
node_object = TreeFolder.find_by_name('Survey')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to course evaluations
def goto_course_evaluations
node_object = TreeFolder.find_by_name('Course Evaluation')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to courses
def goto_courses
node_object = TreeFolder.find_by_name('Courses')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def goto_bookmarkrating_rubrics
node_object = TreeFolder.find_by_name('Bookmarkrating')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# direct access to assignments
def goto_assignments
node_object = TreeFolder.find_by_name('Assignments')
session[:root] = FolderNode.find_by_node_object_id(node_object.id).id
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

# called when the display is requested
# ajbudlon, July 3rd 2008
def list
def index
redirect_to controller: :student_task, action: :list if current_user.student?
if params[:commit] == 'Search'
search_node_root = {'Q' => 1, 'C' => 2, 'A' => 3}
Expand Down Expand Up @@ -123,7 +123,7 @@ def list

def drill
session[:root] = params[:root]
redirect_to :controller => 'tree_display', :action => 'list'
redirect_to tree_display_index_path
end

def filter
Expand Down
2 changes: 1 addition & 1 deletion app/views/questionnaires/view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@

<BR/>
<%= link_to 'Edit', :action => 'edit', :id => @questionnaire %> |
<%= link_to "Back", :controller => 'tree_display', :action => 'list' %>
<%= link_to "Back", tree_display_index_path %>
4 changes: 2 additions & 2 deletions app/views/review_mapping/_searchbox.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<p> <%= link_to_function("Search", "Element.show('searchform')") %>
| <%= link_to "Show all", :action => 'review_report', :id => @id %>
| <%= link_to "Distribution", :action => 'distribution', :id => @id%>
| <%= link_to 'Back', :controller=> 'tree_display', :action=>'list', :id => @userid%>
| <%= link_to 'Back', tree_display_index_path, :id => @userid%>

</p>
</p>
</div>


Expand Down
2 changes: 1 addition & 1 deletion app/views/review_mapping/list_mappings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

<%= render :partial => "list_review_mappings", :locals => { :assignment => @assignment, :items => @items } %>

<%= link_to 'Back', :controller => 'tree_display', :action => 'list' %>
<%= link_to 'Back', tree_display_index_path %>

2 changes: 1 addition & 1 deletion app/views/review_mapping/list_sortable.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
:title => 'Metareviewer Mappings',
:expected_fields => 'Contributor, Reviewer, Metareviewer1, Metareviewer2, ... MetareviewerN',
:id => @assignment.id %>
| <%= link_to 'Back', :controller => 'tree_display', :action => 'list' %>
| <%= link_to 'Back', tree_display_index_path %>
2 changes: 1 addition & 1 deletion app/views/shared_scripts/_back.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= link_to 'Back', :controller=> 'tree_display', :action=>'list'%>
<%= link_to 'Back', tree_display_index_path %>
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@
resources :tree_display do
collection do
get ':action'
post 'list'
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/functional/assignment_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def test_delete_assignment
number_of_duedate = DueDate.count
id = Assignment.first(:conditions => {:instructor_id => users(:instructor3).id}).id
post :delete, :id => id
assert_redirected_to :controller => 'tree_display', :action => 'list'
assert_redirected_to tree_display_index_path
assert_equal number_of_assignment-1, Assignment.count
assert_raise(ActiveRecord::RecordNotFound){ Assignment.find(id) }

Expand Down