diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c58cd3f82..db77283cc 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -182,9 +182,11 @@ class AttachmentsController < ApplicationController respond_to do |format| # modify by nwb if !@attachment.container.nil? && - (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) ) + (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && @attachment.container.board.course ) ) if @attachment.container.is_a?(News) format.html { redirect_to_referer_or news_path(@attachment.container) } + elsif @attachment.container.is_a?(Message) + format.html { redirect_to_referer_or new_board_message_path(@attachment.container) } elsif @course.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } else diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 152b744c3..c0e3d56f2 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -175,9 +175,19 @@ module ProjectsHelper render_project_nested_lists(projects) do |project| #Modified by young 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 + unless project.is_public == 1 + s = "#{l(:lable_private)}".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 else - s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") + unless project.is_public + s = "#{l(:label_private)}".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? diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index ddf08c3fb..12eec558f 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -10,6 +10,9 @@
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%> + <% unless @course.is_public == 1 %> + <%= l(:lable_private) %> + <% end %> <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>
diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 8d31f7c4c..0dcf1085a 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -6,7 +6,10 @@