缩进问题,三目运算符代替条件判断

This commit is contained in:
z9hang 2014-09-04 10:12:31 +08:00
parent 05083fa679
commit c92a750ec8
1 changed files with 7 additions and 18 deletions

View File

@ -173,25 +173,14 @@ module ProjectsHelper
# Renders the projects index
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(:label_private)}</span>".html_safe
else
s = "".html_safe
end
s = project.is_public == 1 ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
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 = project.is_public ? "".html_safe : "<span class='private_project'>#{l(:label_private)}</span>".html_safe
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?
#Delete by nie.
# s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description')
end
s