diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ca897fc3d..5ba0b6e4a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -75,6 +75,7 @@ class UsersController < ApplicationController include GitlabHelper include UserScoreHelper helper :user_score + helper :journals # added by liuping 关注 diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 3b0087bb4..925625c28 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,48 +1,53 @@ +<% reply_links = authorize_for('issues', 'edit') -%>
<%= 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 %>(项目名称)
+ <%= link_to activity.project.name.to_s+"(项目名称)", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %> +
- <%=activity.subject %>(缺陷标题)<%=activity.status.name %> + <%= link_to activity.subject.to_s+"(缺陷标题)", issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %> + <%=activity.status.name %>
-
指派给  <% if activity.try(:assigned_to).try(:realname) == ' '%><%= activity.try(:assigned_to)%><% else %><%=activity.try(:assigned_to).try(:realname) %><% end %> +
指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %>
时间:<%=format_date(activity.created_on) %>
(缺陷描述)<%=activity.description.html_safe %>
-
+
<% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %> -
-

-

- - <%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%> - -
- <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :filename => attachment.filename %> - <% end %> - - <%= number_to_human_size attachment.filesize %> +
+ + <%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%> -

-
+ <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename %> + <% end %> + ( + <%= number_to_human_size attachment.filesize %>) + +
<% end %> <% end %>
@@ -67,9 +72,10 @@
+
-
回复(5)
-
2015-07-26
+
回复(<%=activity.journals.count %>)
+
<%=format_date(activity.updated_on)%>
@@ -82,31 +88,34 @@
-
-
- 用户头像 -
-
-
- 尹教授 - 2015-08-01删除 -
-
请大家说下软件工程是什么!
-
-
-
-
-
- 用户头像 -
-
-
- Tang 学生 - 2015-08-01删除 -
-
软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
-
-
-
+ + <% activity.journals.reorder("created_on desc").each do |reply| unless activity.journals.nil?%> +
+
+ <%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %> +
+
+
+ <% if reply.try(:user).try(:realname) == ' ' %> + <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_date(reply.created_on) %> + + +
+ <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +
<%=string %>
+ <% end %> + <% else %> +
<%=reply.notes.html_safe %>
+ <% end %> +
+
+
+ <% end %> + <% end %>
\ No newline at end of file diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index a2b97d2da..248be6143 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -64,33 +64,33 @@
<% activity= activity.parent_id.nil? ? activity:activity.parent%> <% activity.children.reorder("created_on desc").each do |reply| unless activity.children.nil?%> -
-
- <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %> -
-
-
- <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%=format_date(reply.created_on)%> - <%= link_to( - l(:button_delete), - {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => 'replyGrey fr ml10' - ) if reply.course_destroyable_by?(User.current) %> - -
-
<%= reply.content.html_safe %>
-
-
-
- <% end %> +
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %> +
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_date(reply.created_on) %> + <%= link_to( + l(:button_delete), + {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete), + :class => 'replyGrey fr ml10' + ) if reply.course_destroyable_by?(User.current) %> + +
+
<%= reply.content.html_safe %>
+
+
+
+ <% end %> <% end %>