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 @@

- <%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> + <% unless course.is_public == 1 %> + <%= l(:lable_private) %> + <% end %> + <%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index d91019e53..fd4a1637e 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -72,6 +72,9 @@
+ <% unless project.is_public %> + <%= l(:lable_private) %> + <% end %> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
diff --git a/config/locales/en.yml b/config/locales/en.yml index 89898409e..ee7e76ed1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1809,4 +1809,5 @@ en: notice_account_invalid_creditentials_new: You have not to the mailbox activation lable_unknow_type: Unknow type lable_score_less_than_zero: Score less than 0, revised to 0 - review_assignments: review assignments \ No newline at end of file + review_assignments: review assignments + lable_private: private \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 54585e314..a3db5964b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2118,4 +2118,4 @@ zh: lable_unknow_type: 未知类型 lable_score_less_than_zero: 得分小于0,修正为0 review_assignments: 评审任务 - \ No newline at end of file + lable_private: 私有 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 5f4a3166e..1d785eb9d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1618,6 +1618,8 @@ div.issue .next-prev-links {color:#999;} div.issue table.attributes th {width:22%;} div.issue table.attributes td {width:28%;} +.private_project { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;} + #issue_tree table.issues, #relations table.issues { border: 0; } #issue_tree td.checkbox, #relations td.checkbox {display:none;} #relations td.buttons {padding:0;}