缩进问题,三目运算符代替条件判断
This commit is contained in:
parent
05083fa679
commit
c92a750ec8
|
@ -173,25 +173,14 @@ module ProjectsHelper
|
||||||
# Renders the projects index
|
# Renders the projects index
|
||||||
def render_project_hierarchy(projects)
|
def render_project_hierarchy(projects)
|
||||||
render_project_nested_lists(projects) do |project|
|
render_project_nested_lists(projects) do |project|
|
||||||
#Modified by young
|
if (project.try(:project_type) == Project::ProjectType_course )
|
||||||
if (project.try(:project_type) == Project::ProjectType_course )
|
s = project.is_public == 1 ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
|
||||||
unless project.is_public == 1
|
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
||||||
s = "<span class='private_project'>#{l(:label_private)}</span>".html_safe
|
else
|
||||||
else
|
s = project.is_public ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
|
||||||
s = "".html_safe
|
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
||||||
end
|
end
|
||||||
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
|
||||||
else
|
|
||||||
unless project.is_public
|
|
||||||
s = "<span class='private_project'>#{l(:label_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}")
|
|
||||||
end
|
|
||||||
#Ended by young
|
|
||||||
if project.description.present?
|
if project.description.present?
|
||||||
#Delete by nie.
|
|
||||||
# s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description')
|
# s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description')
|
||||||
end
|
end
|
||||||
s
|
s
|
||||||
|
|
Loading…
Reference in New Issue