- <%= link_to image_tag(url_to_avatar(@activity.author), :width => "90", :height => "90"), user_path(@activity.author_id), :alt => "用户头像" %>
+ <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
- <% if @activity.try(:author).try(:realname) == ' ' %>
- <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %>
+ <% if @ctivity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
- <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
-
<%= @activity.course.name %>(课程名称)
+
<%= activity.course.name %>(课程名称)
+
<%= activity.title %>(通知标题)
-
发布时间:<%= format_date(@activity.created_on) %>
+
发布时间:<%= format_date(activity.created_on) %>
-
(通知描述)<%= @activity.description.html_safe %>
+
(通知描述)<%= activity.description.html_safe %>
-
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
new file mode 100644
index 000000000..a998cfc24
--- /dev/null
+++ b/app/views/users/_project_issue.html.erb
@@ -0,0 +1,87 @@
+
+
+
+ <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+
+
+ <% if activity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% end %> TO
+
<%=activity.project.name %>(项目名称)
+
+
<%=activity.subject %>(缺陷标题)<%=activity.status.name %>
+
+
+
+
时间:<%=format_date(activity.created_on) %>
+
+
(缺陷描述)<%=activity.description.html_safe %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
Tang 学生
+ 2015-08-01
删除
+
+
软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
new file mode 100644
index 000000000..dff8d85b7
--- /dev/null
+++ b/app/views/users/_project_message.html.erb
@@ -0,0 +1,82 @@
+<% if activity.parent_id.nil? %>
+
+
+
+

+
+
+
+ <% if activity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
+ <% end %>
+ TO
+
<%= activity.project.name %>(项目讨论区)
+
+
+
+
时间:<%= format_date(activity.created_on) %>
+
+
+
+
+
+
+
+
回复(<%=activity.replies_count %>)
+
2015-07-31
+
+
+
+
+
+
+
+
+

+
+
+
+
黄井泉 学生
+ 2015-08-01
删除
+
+
很开心!
+
+
+
+
+
+

+
+
+
+
陈正东 学生
+ 2015-08-02
删除
+
+
假期好热,没出去。
+
+
+
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 416c5485c..0991f06e0 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -33,226 +33,23 @@
<% case @course_act.course_act_type.to_s %>
<% when 'HomeworkCommon' %>
<% @activity=HomeworkCommon.where("id=#{@course_act.course_act_id}").first %>
-
-
-
- <%= link_to image_tag(url_to_avatar(@activity.user), :width => "90", :height => "90"), user_path(@activity.user_id), :alt => "用户头像" %>
-
-
-
-
- <% if @activity.try(:user).try(:realname) == ' ' %>
- <%= link_to @activity.try(:user), user_path(@activity.user_id), :class => "newsBlue mr15" %>
- <% else %>
- <%= link_to @activity.try(:user).try(:realname), user_path(@activity.user_id), :class => "newsBlue mr15" %>
- <% end %> TO
-
<%= @activity.course.name %>(课程名称)
-
-
-
-
-
截止时间:<%= format_date(@activity.end_time) %>
-
-
(作业描述)<%= @activity.description.html_safe %>
-
-
-
-
-
+ <%= render :partial => 'course_homework', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'News' %>
<% @activity=News.where("id=#{@course_act.course_act_id}").first %>
-
+ <%= render :partial => 'course_news', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'Message'%>
<% @activity=Message.where("id=#{@course_act.course_act_id}").first %>
- <% if @activity.parent_id.nil? %>
-
-
-
-

-
-
-
- <% if @activity.try(:author).try(:realname) == ' ' %>
- <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %>
- <% else %>
- <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %>
- <% end %>
- TO
-
<%= @activity.course.name %>(课程讨论区)
-
-
-
-
时间:<%= format_date(@activity.created_on) %>
-
-
-
-
-
-
-
-
回复(<%=@activity.replies_count %>)
-
2015-07-31
-
-
-
-
-
-
-
-
-

-
-
-
-
黄井泉 学生
- 2015-08-01
删除
-
-
很开心!
-
-
-
-
-
-

-
-
-
-
陈正东 学生
- 2015-08-02
删除
-
-
假期好热,没出去。
-
-
-
-
-
- <% end %>
+ <%= render :partial => 'course_message', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% end %>
<% when 'ForgeActivity' %>
<% @project_act= ForgeActivity.where("id=#{user_activity.act_id}").first %>
<% case @project_act.forge_act_type.to_s %>
<% when 'Issue' %>
<% @activity=Issue.where("id=#{@project_act.forge_act_id}").first %>
-
-
-
- <%= link_to image_tag(url_to_avatar(@activity.author), :width => "90", :height => "90"), user_path(@activity.author_id), :alt => "用户头像" %>
-
-
-
-
- <% if @activity.try(:author).try(:realname) == ' ' %>
- <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %>
- <% else %>
- <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %>
- <% end %> TO
-
<%=@activity.project.name %>(项目名称)
-
-
<%=@activity.subject %>(缺陷标题)<%=@activity.status.name %>
-
-
-
-
时间:<%=format_date(@activity.created_on) %>
-
-
(缺陷描述)<%=@activity.description.html_safe %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
Tang 学生
- 2015-08-01
删除
-
-
软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
-
-
-
-
-
+ <%= render :partial => 'project_issue', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'Message' %>
+ <% @activity=Message.where("id=#{@project_act.forge_act_id}").first %>
+ <%= render :partial => 'project_message', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% end %>
<% end %>
<% end %>