parent
08b27f38a7
commit
f4595dfcd2
|
@ -128,7 +128,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
#Modified by nie
|
#Modified by nie
|
||||||
@project_type = params[:project_type]
|
@project_type = params[:project_type].to_i
|
||||||
per_page_option = 10
|
per_page_option = 10
|
||||||
|
|
||||||
@projects_all = Project.active.visible.
|
@projects_all = Project.active.visible.
|
||||||
|
|
|
@ -255,26 +255,17 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
classes = (ancestors.empty? ? 'root' : 'child')
|
classes = (ancestors.empty? ? 'root' : 'child')
|
||||||
s << "<li class='project-table'><div class='#{classes}'>"
|
s << "<li class='project-table'><div class='#{classes}'>"
|
||||||
if params[:project_type] == "0"
|
if project.try(:project_type) == Project::ProjectType_project
|
||||||
s << h(block_given? ? yield(project) : project.name)
|
s << h(block_given? ? yield(project) : project.name)
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
|
|
||||||
# if @project.project_type == 1
|
if project.try(:project_type) == Project::ProjectType_project
|
||||||
# unless Course.find_by_extra(@project.identifier).nil?
|
|
||||||
# unless Course.find_by_extra(@project.identifier).tea_id == User.current.id
|
|
||||||
# s << "<span style = 'float: right;'>"
|
|
||||||
# s << join_in_course(@project, User.current)#, ['whiteButton'])
|
|
||||||
# s << "</span>"
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
if params[:project_type] == "0"
|
|
||||||
unless User.current.member_of?(@project)
|
unless User.current.member_of?(@project)
|
||||||
s << "<span style = 'float: right;'>"
|
s << "<span style = 'float: right;'>"
|
||||||
s << watcher_link(@project, User.current)#, ['whiteButton'])
|
s << watcher_link(@project, User.current)#, ['whiteButton'])
|
||||||
s << "</span>"
|
s << "</span>"
|
||||||
end
|
end
|
||||||
s << (render :partial => 'projects/project', :locals => {:project => project}).to_s
|
s << (render :partial => 'projects/project', :locals => {:project => project}).to_s
|
||||||
else
|
else
|
||||||
s << (render :partial => 'projects/course', :locals => {:project => project}).to_s
|
s << (render :partial => 'projects/course', :locals => {:project => project}).to_s
|
||||||
|
|
|
@ -175,7 +175,7 @@ module ProjectsHelper
|
||||||
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
|
#Modified by young
|
||||||
if (project.project_type==1)
|
if (project.try(:project_type) == Project::ProjectType_course )
|
||||||
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
||||||
else
|
else
|
||||||
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
||||||
|
|
Loading…
Reference in New Issue