From bdd1980876e9d672ab37677d305d0307ca08f964 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 10 Mar 2015 11:39:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e6171bf81..d770a4633 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -446,12 +446,13 @@ class UsersController < ApplicationController activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc') end activity = activity.reject { |e| - !User.current.admin? && + e.act.nil? || + (!User.current.admin? && !e.act.nil? (((e.act_type == "Issue") && !e.act.project.visible?(User.current)) || (e.act_type == "Bid" && !e.act.courses.first.nil? && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || (e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) || (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) || - (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))) + (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course)))))) } @activity_count = activity.count @activity_pages = Paginator.new @activity_count, pre_count, params['page'] From 8a7fc85e8b69c7ec5838175c86abb6a6eedb569f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 10 Mar 2015 14:25:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=9B=9E=E5=A4=8D=E7=9A=84=E6=9C=AC=E5=9C=B0=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_jour.html.erb | 2 +- app/views/homework_attach/_journal_reply_items.html.erb | 2 +- app/views/homework_attach/_showjour.html.erb | 2 +- app/views/words/_feedback.html.erb | 2 +- app/views/words/_journal_reply_items.html.erb | 2 +- app/views/words/_message.html.erb | 2 +- config/locales/zh.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb index cae04b0c0..0544baea3 100644 --- a/app/views/homework_attach/_jour.html.erb +++ b/app/views/homework_attach/_jour.html.erb @@ -25,7 +25,7 @@ :homework_id =>homework.id }, :remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> <% end %> - <%= link_to l(:label_newfeedback_respone),'', + <%= link_to l(:button_reply),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"} %> diff --git a/app/views/homework_attach/_journal_reply_items.html.erb b/app/views/homework_attach/_journal_reply_items.html.erb index 2c7ac886c..fc48c31cf 100644 --- a/app/views/homework_attach/_journal_reply_items.html.erb +++ b/app/views/homework_attach/_journal_reply_items.html.erb @@ -34,7 +34,7 @@ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> <% end %> <% if reply_allow %> - <%= link_to l(:label_newfeedback_respone),'', + <%= link_to l(:button_reply),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> <% end %> diff --git a/app/views/homework_attach/_showjour.html.erb b/app/views/homework_attach/_showjour.html.erb index 018d16141..90f18311e 100644 --- a/app/views/homework_attach/_showjour.html.erb +++ b/app/views/homework_attach/_showjour.html.erb @@ -65,7 +65,7 @@ <% ids = 'project_respond_form_'+ journal.id.to_s%> - <%= link_to l(:label_newfeedback_respone),'', + <%= link_to l(:button_reply),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> <% if journal.user==User.current|| User.current.admin? %> diff --git a/app/views/words/_feedback.html.erb b/app/views/words/_feedback.html.erb index 493378279..a64159a88 100644 --- a/app/views/words/_feedback.html.erb +++ b/app/views/words/_feedback.html.erb @@ -11,7 +11,7 @@ <% id = 'project_respond_form_'+journal.id.to_s%> <% if reply_allow %> - <%= link_to l(:label_newfeedback_respone),'#', + <%= link_to l(:button_reply),'#', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 9076006cc..bd76bc52d 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -36,7 +36,7 @@ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> <% end %> <% if reply_allow %> - <%= link_to l(:label_newfeedback_respone),'', + <%= link_to l(:button_reply),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> <% end %> diff --git a/app/views/words/_message.html.erb b/app/views/words/_message.html.erb index 163f13523..cbdb9f6f6 100644 --- a/app/views/words/_message.html.erb +++ b/app/views/words/_message.html.erb @@ -51,7 +51,7 @@ function checkMaxLength() { <% ids = 'project_respond_form_'+ journal.id.to_s%> <% if reply_allow %> - <%= link_to l(:label_newfeedback_respone),'', + <%= link_to l(:button_reply),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> <% end %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac975f67f..934401706 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2380,4 +2380,4 @@ zh: label_recently_updated_homework: 最近更新了作业 label_recently_updated_message: 最近更新了留言 label_recently_updated_courseware: 最近更新了课件 - label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧! + label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧! \ No newline at end of file From 4034e3565ae049fdca0d1214cc62eeaad93c2d3c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 10 Mar 2015 14:36:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=A1=B9=E7=9B=AEhtml=E4=BB=A3=E7=A0=81=E4=B8=8D=E4=BA=89?= =?UTF-8?q?=E5=8F=96=20=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E6=9C=89=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/new.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 455f4ad1b..98612b733 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -2,18 +2,22 @@ @nav_dispaly_forum_label = 1 %> <%= labelled_form_for @project do |f| %> -
<%=l(:label_project_new)%> <%=raw l(:label_project_new_description)%> +
+ <%=l(:label_project_new)%> + +

<%=raw l(:label_project_new_description)%>

<%= render :partial => 'form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "enterprise"%> + <%= submit_tag l(:button_create), :class => "enterprise"%>
<%#= submit_tag l(:button_create_and_continue), :name => 'continue' %> <%= javascript_tag "$('#project_name').focus();" %> +
<% end %> <% html_title(l(:label_project_new)) -%> \ No newline at end of file From 383d90bb12f566855535dd82a4827f529f8e8515 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Mar 2015 16:26:22 +0800 Subject: [PATCH 4/5] =?UTF-8?q?issue2626=EF=BC=8C=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E4=BB=80=E4=B9=88=E6=97=B6=E5=80=99=E5=88=9B=E5=BB=BA=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E4=BF=A1=E6=81=AF=E4=B9=9F=E8=A6=81=E5=8A=A0?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/show.html.erb | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index fc64d3af8..0081fde84 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -21,7 +21,37 @@
<% unless @events_pages.empty? %> <% @events_pages.each do |e| -%> - <% act = e.forge_act; + <% if e.forge_act_type == "ProjectCreateInfo"%> +
+ + + + + +
+ <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> + + + + + + +
+ + <%= link_to_user(e.user)%> + + <%= l(:label_project_new) %> + <%= link_to e.project.name %> + ! +
+ <%= l :label_create_time %>: + <%= format_time(e.created_at) %> +
+
+
+ <% end %> + <% next if e.forge_act_type.safe_constantize.nil? + act = e.forge_act; next if act.nil? %> <% if e.forge_act_type == "Issue" %>
From 87394fe4cefd42efa08e7264ba714b7df60954a2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Mar 2015 16:27:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?issue2626=EF=BC=8C=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E4=BB=80=E4=B9=88=E6=97=B6=E5=80=99=E5=88=9B=E5=BB=BA=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E4=BF=A1=E6=81=AF=E4=B9=9F=E8=A6=81=E5=8A=A0?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 099870bc7..313652bf4 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -131,7 +131,7 @@ class Project < ActiveRecord::Base #ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用 after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} # 创建project之后默认创建一个board,之后的board去掉了board的概念 - after_create :create_board_sync + after_create :create_board_sync,:acts_as_forge_activities before_destroy :delete_all_members def remove_references_before_destroy return if self.id.nil? @@ -1154,6 +1154,13 @@ class Project < ActiveRecord::Base end end - + # Time 2015-03-10 15:33:16 + # Author lizanle + # Description 新建项目要在ForgeActivities中加一条数据。 + def acts_as_forge_activities + fa = ForgeActivity.new(:user_id => User.current.id,:project_id => self.id, + :forge_act_id => self.id,:forge_act_type => "ProjectCreateInfo") + fa.save! + end end