Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
dbd5c49246
|
@ -5,6 +5,10 @@ class CoursesController < ApplicationController
|
||||||
helper :members
|
helper :members
|
||||||
helper :words
|
helper :words
|
||||||
|
|
||||||
|
menu_item :overview
|
||||||
|
menu_item :feedback, :only => :feedback
|
||||||
|
menu_item :homework, :only => :homework
|
||||||
|
|
||||||
menu_item l(:label_sort_by_time), :only => :index
|
menu_item l(:label_sort_by_time), :only => :index
|
||||||
menu_item l(:label_sort_by_active), :only => :index
|
menu_item l(:label_sort_by_active), :only => :index
|
||||||
menu_item l(:label_sort_by_influence), :only => :index
|
menu_item l(:label_sort_by_influence), :only => :index
|
||||||
|
|
|
@ -580,6 +580,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'homework', :action => 'homework', :as => 'homework'
|
get 'homework', :action => 'homework', :as => 'homework'
|
||||||
get 'new_homework', :action => 'new_homework', :as => 'new_homework'
|
get 'new_homework', :action => 'new_homework', :as => 'new_homework'
|
||||||
get 'file', :action => 'file', :as => 'file'
|
get 'file', :action => 'file', :as => 'file'
|
||||||
|
get 'feedback', :action => 'feedback', :as => 'course_feedback'
|
||||||
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
||||||
post 'finishcourse'
|
post 'finishcourse'
|
||||||
post 'restartcourse'
|
post 'restartcourse'
|
||||||
|
|
|
@ -67,6 +67,16 @@ module Redmine
|
||||||
end
|
end
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def redirect_to_course_menu_item(course, name)
|
||||||
|
item = Redmine::MenuManager.items(:course_menu).detect {|i| i.name.to_s == name.to_s}
|
||||||
|
if item && User.current.allowed_to?(item.url, course) && (item.condition.nil? || item.condition.call(course))
|
||||||
|
redirect_to({item.param => course}.merge(item.url))
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module MenuHelper
|
module MenuHelper
|
||||||
|
|
Loading…
Reference in New Issue