|
|
|
@ -44,7 +44,7 @@ module ProjectsHelper
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
@ -70,19 +70,19 @@ module ProjectsHelper
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
when 1
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id), :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)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
when 2
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
# 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")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#gcm
|
|
|
|
|
when 3
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
|
|
|
@ -101,7 +101,7 @@ module ProjectsHelper
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
|
|
|
|
|
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
|
|
|
@ -142,7 +142,7 @@ module ProjectsHelper
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Added by young
|
|
|
|
|
# Added by young
|
|
|
|
|
def course_settings_tabs
|
|
|
|
|
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
|
|
|
|
#{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural, :project_type => 1},
|
|
|
|
@ -151,7 +151,7 @@ module ProjectsHelper
|
|
|
|
|
]
|
|
|
|
|
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
|
|
|
|
|
end
|
|
|
|
|
#Ended by young
|
|
|
|
|
# Ended by young
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -174,20 +174,37 @@ module ProjectsHelper
|
|
|
|
|
def render_project_hierarchy(projects)
|
|
|
|
|
render_project_nested_lists(projects) do |project|
|
|
|
|
|
#Modified by young
|
|
|
|
|
if (project.try(:project_type) == Project::ProjectType_course )
|
|
|
|
|
unless project.is_public == 1
|
|
|
|
|
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
|
|
|
|
if project.try(:project_type) == Project::ProjectType_course
|
|
|
|
|
|
|
|
|
|
# modified by longjun
|
|
|
|
|
# never use unless and else
|
|
|
|
|
# unless project.is_public == 1
|
|
|
|
|
|
|
|
|
|
if project.is_public != 1
|
|
|
|
|
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
|
|
|
|
else
|
|
|
|
|
s = "".html_safe
|
|
|
|
|
end
|
|
|
|
|
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
|
|
|
|
# end longjun
|
|
|
|
|
|
|
|
|
|
# modified by Longjun
|
|
|
|
|
s += link_to_project(project, {},
|
|
|
|
|
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
|
|
|
|
# end longjun
|
|
|
|
|
else
|
|
|
|
|
unless project.is_public
|
|
|
|
|
# modified by longjun
|
|
|
|
|
# unless project.is_public
|
|
|
|
|
|
|
|
|
|
if !project.is_public
|
|
|
|
|
# end longjun
|
|
|
|
|
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
|
|
|
|
else
|
|
|
|
|
s = "".html_safe
|
|
|
|
|
end
|
|
|
|
|
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
|
|
|
|
# modified by longjun
|
|
|
|
|
s += link_to_project(project, {},
|
|
|
|
|
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
|
|
|
|
# end longjun
|
|
|
|
|
end
|
|
|
|
|
#Ended by young
|
|
|
|
|
if project.description.present?
|
|
|
|
@ -254,9 +271,14 @@ module ProjectsHelper
|
|
|
|
|
def is_manager?(user_id,project_id)
|
|
|
|
|
@result = false
|
|
|
|
|
@user_id = ProjectInfo.find_by_project_id(project_id)
|
|
|
|
|
if @user_id == user.id
|
|
|
|
|
@result = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# modified by longjun
|
|
|
|
|
# if @user_id == user.id
|
|
|
|
|
# @result = true
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
@result = true if @user_id = user.id
|
|
|
|
|
# end longjun
|
|
|
|
|
return @result
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -341,9 +363,9 @@ module ProjectsHelper
|
|
|
|
|
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)
|
|
|
|
|
if courses_year >= current_year
|
|
|
|
|
return false
|
|
|
|
|
elsif( (courses_year < current_year) && (Time.now.month < 3) )
|
|
|
|
|
elsif (courses_year < current_year) && (Time.now.month < 3)
|
|
|
|
|
return false
|
|
|
|
|
else
|
|
|
|
|
return true
|
|
|
|
|