diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 84bf9fb2b9..64f6684d0d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -30,6 +30,9 @@ def index @courses = @courses.where(featured: true) elsif params[:copy_courses] @courses = @courses.reorder(featured: :desc, year: :desc, name: :asc) + @own_courses = @courses.select { |course| current_user.course_admin?(course) } + @other_courses = @courses.reject { |course| current_user.course_admin?(course) } + @courses = @own_courses.concat(@other_courses) end @courses = apply_scopes(@courses) diff --git a/app/views/courses/_copy_courses_table.html.erb b/app/views/courses/_copy_courses_table.html.erb index 65ef482fc7..cb9c821583 100644 --- a/app/views/courses/_copy_courses_table.html.erb +++ b/app/views/courses/_copy_courses_table.html.erb @@ -16,6 +16,9 @@