|
|
|
@ -66,18 +66,18 @@ module ProjectsHelper
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
|
|
|
|
|
|
|
|
|
|
when 1
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
|
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
|
|
|
|
|
|
|
|
|
|
when 2
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
@ -243,7 +243,7 @@ module ProjectsHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def eventToLanguageCourse event_type, project
|
|
|
|
|
def eventToLanguageCourse event_type, project
|
|
|
|
|
case event_type
|
|
|
|
|
when "issue-note"
|
|
|
|
|
l :label_issue
|
|
|
|
@ -286,7 +286,17 @@ module ProjectsHelper
|
|
|
|
|
WHERE project_type = 0 ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def method_name
|
|
|
|
|
|
|
|
|
|
# 判断课程是否结束
|
|
|
|
|
def course_timeout? project
|
|
|
|
|
return true if (project.nil? && project.course_extra.nil?)
|
|
|
|
|
courses_year = project.course_extra.time
|
|
|
|
|
current_year = Time.now.year
|
|
|
|
|
if(courses_year >= current_year)
|
|
|
|
|
return false
|
|
|
|
|
elsif( (courses_year < current_year) && (Time.now.month < 3) )
|
|
|
|
|
return false
|
|
|
|
|
else
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|