From e0cdcc02118c2a7e25bc8a51c1ec45e90a8ee712 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 1 Sep 2014 14:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E5=8F=91=E5=B8=96=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8Cadmin=E5=B8=90=E6=88=B7=E5=88=A0=E9=99=A4=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=8A=A5=E9=94=99=EF=BC=8C=E5=8E=9F=E5=9B=A0=EF=BC=9A?= =?UTF-8?q?=E5=88=A4=E6=96=ADattachment=E7=9A=84containers=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=B8=BA=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=B0=91=E5=88=A4=E6=96=AD=E4=BA=86=E8=AF=BE=E7=A8=8B=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E7=9A=84=E9=99=84=E4=BB=B6=E8=BF=99=E7=A7=8D?= =?UTF-8?q?=E6=83=85=E5=86=B5=EF=BC=8C=E8=A7=A3=E5=86=B3=EF=BC=9A=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E8=AF=A5=E5=88=A4=E6=96=AD=E3=80=82=E9=97=AE=E9=A2=98?= =?UTF-8?q?2=20=20#1002=20forge=E7=BD=91=E7=AB=99=E7=9A=84=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=89=8D=E5=92=8C=E7=99=BB=E9=99=86=E5=90=8E=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E4=B8=8D=E4=B8=80=E6=A0=B7=E3=80=82=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=B3=95=EF=BC=9A=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E3=80=81?= =?UTF-8?q?=E7=A7=81=E6=9C=89=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E6=A0=87=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 +++- app/helpers/projects_helper.rb | 14 ++++++++++++-- app/views/courses/_course.html.erb | 3 +++ app/views/welcome/_course_list.html.erb | 5 ++++- app/views/welcome/index.html.erb | 3 +++ config/locales/en.yml | 3 ++- config/locales/zh.yml | 2 +- public/stylesheets/application.css | 2 ++ 8 files changed, 30 insertions(+), 6 deletions(-) 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;}