diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index ee1ca0230..3981c5b6b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -8,7 +8,7 @@ class CoursesController < ApplicationController menu_item :overview menu_item :feedback, :only => :feedback menu_item :homework, :only => :homework - menu_item :new_homework + menu_item :new_homework, :only => :new_homework menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_active), :only => :index diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 2cf2e7895..61760f462 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -106,7 +106,7 @@ class HomeworkAttachController < ApplicationController (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score FROM homework_attaches INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id - WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC") + WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC") @cur_page = params[:page] || 1 @cur_type = 4 @homework_list = paginateHelper all_homework_list,10 diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 55c5615fb..1462b4bb6 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -272,7 +272,7 @@ <%= link_to l(:label_course_overview), course_path(@course), :class => link_class(:overview) %>
  • - <%= link_to l(:label_homework), homework_course_path(@course), :class => link_class(:homework), :course_type => 1 %> + <%= link_to l(:label_homework), homework_course_path(@course), :class => link_class([:homework,:new_homework]), :course_type => 1 %>
  • <%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %> diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 0ea1ec79e..8286c1df0 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -54,7 +54,7 @@ module Redmine # Returns the menu item name according to the current action def current_menu_item @current_menu_item ||= menu_items[controller_name.to_sym][:actions][action_name.to_sym] || - menu_items[controller_name.to_sym][:default] + menu_items[controller_name.to_sym][:default] end # Redirects user to the menu item of the given project