From 4c87071765c721a24366633533e77d4813aa4d5a Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 20 Aug 2015 17:24:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 14 -------- app/controllers/users_controller.rb | 6 ++++ app/views/users/show.html.erb | 52 ++++++++++++++++++++++++----- db/schema.rb | 8 +---- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 25536615a..acff52dc9 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -419,20 +419,6 @@ class AdminController < ApplicationController def messages_list @memo = Memo.reorder("created_at desc") -=begin - case params[:format] - when 'xml', 'json' - @offset, @limit = api_offset_and_limit({:limit => 30}) - else - @limit = 30#per_page_option - end - - @memo_count = @memo.count - @memo_pages = Paginator.new @memo_count, @limit, params['page'] - @offset ||= @memo_pages.offset - @memo = @memo.limit(@limit).offset(@offset).all -=end - respond_to do |format| format.html end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 058cf971f..2e3ec769d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -534,6 +534,12 @@ class UsersController < ApplicationController end def show + if @user == User.current + @user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc') +=begin + SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) +=end + end render :layout=>'new_base_user' end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4975229eb..5e5082082 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -10,7 +10,7 @@
  • 作业动态
  • 通知动态
  • 论坛动态
  • -
  • 问卷动态
  • +
  • @@ -24,7 +24,40 @@
  • -
    + <% @user_activities.each do |user_activity| unless @user_activities.nil? %> + <% case user_activity.act_type.to_s%> + <% when 'CourseActivity'%> + <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first%> + <% case @course_act.course_act_type.to_s %> + <% when 'HomeworkCommon'%> +
    +
    用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    + <% end %> + <% end %> + <% end %> +
    用户头像
    @@ -34,7 +67,7 @@
    截止时间:2015-08-20
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    -
    +
    -
    + +
    @@ -139,7 +173,7 @@
    用户头像
    - +
    很开心!
    @@ -147,7 +181,7 @@
    用户头像
    - +
    假期好热,没出去。
    @@ -199,7 +233,7 @@
    用户头像
    - +
    尹教授 2015-08-01删除
    请大家说下软件工程是什么!
    @@ -207,7 +241,7 @@
    用户头像
    - +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    diff --git a/db/schema.rb b/db/schema.rb index 7e3743b0e..c390dc2fe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -474,13 +474,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -893,6 +886,7 @@ ActiveRecord::Schema.define(:version => 20150820025358) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e1fb2a6babe5a21eb0ac3dd7d2d6758ddbf7b92c Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 21 Aug 2015 16:07:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 11 +- app/views/users/_course_news.html.erb | 36 +++ app/views/users/show.html.erb | 423 +++++++++++++------------- app/views/users/show_chen.erb | 279 +++++++++++++++++ public/stylesheets/new_public.css | 2 +- 5 files changed, 538 insertions(+), 213 deletions(-) create mode 100644 app/views/users/_course_news.html.erb create mode 100644 app/views/users/show_chen.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2e3ec769d..e6e4f96d7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -534,12 +534,13 @@ class UsersController < ApplicationController end def show - if @user == User.current + #if @user == User.current + @user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc') -=begin - SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) -=end - end + + #SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) + #else + #end render :layout=>'new_base_user' end diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb new file mode 100644 index 000000000..f57e05e34 --- /dev/null +++ b/app/views/users/_course_news.html.erb @@ -0,0 +1,36 @@ +
    +
    +
    + <%= 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.course.name %>(课程名称) +
    + +
    +
    发布时间:<%= format_date(@activity.created_on) %>
    +
    +
    (通知描述)<%= @activity.description.html_safe %>
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 5e5082082..416c5485c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -24,23 +24,81 @@
    - <% @user_activities.each do |user_activity| unless @user_activities.nil? %> - <% case user_activity.act_type.to_s%> - <% when 'CourseActivity'%> - <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first%> - <% case @course_act.course_act_type.to_s %> - <% when 'HomeworkCommon'%> -
    -
    用户头像
    +
    +<% @user_activities.each do |user_activity| + unless @user_activities.nil? %> + <% case user_activity.act_type.to_s %> + <% when 'CourseActivity' %> + <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first %> + <% 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 %>
    + +
    +
    +
    +
    + <% when 'News' %> + <% @activity=News.where("id=#{@course_act.course_act_id}").first %> + + <% 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 %>(课程讨论区) +
    +
    - -
    截止时间:2015-08-20
    +
    时间:<%= format_date(@activity.created_on) %>
    -
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - - <% end %> - <% end %> +
    +
    +
    回复(<%=@activity.replies_count %>)
    +
    2015-07-31
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 黄井泉 学生 + 2015-08-01删除 +
    +
    很开心!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 陈正东 学生 + 2015-08-02删除 +
    +
    假期好热,没出去。
    +
    +
    +
    +
    +
    + <% end %> + <% 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 %> +
    + +
    (缺陷描述)<%=@activity.description.html_safe %>
    +
    + 文件附件.zip(123KB) +
    +
    + 图片附件.png(123KB) +
    + +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-26
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 尹教授 + 2015-08-01删除 +
    +
    请大家说下软件工程是什么!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    + Tang 学生 + 2015-08-01删除 +
    +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    +
    +
    +
    +
    +
    + <% when 'Message' %> + <% end %> <% end %> -
    -
    用户头像
    -
    - - -
    - -
    截止时间:2015-08-20
    -
    -
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - -
    -
    -
    - - -
    -
    -
    -
    用户头像
    -
    - - -
    -
    时间:2015-07-31
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    回复(5)
    -
    2015-07-31
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    用户头像
    -
    - -
    很开心!
    -
    -
    -
    -
    -
    用户头像
    -
    - -
    假期好热,没出去。
    -
    -
    -
    -
    -
    -
    -
    -
    用户头像
    -
    - - -
    -
    指派给  苏稳
    -
    时间:2015-08-20
    -
    -
    (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - - -
    - -
    -
    -
    -
    -
    -
    -
    回复(5)
    -
    2015-07-26
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    用户头像
    -
    -
    尹教授 2015-08-01删除
    -
    请大家说下软件工程是什么!
    -
    -
    -
    -
    -
    用户头像
    -
    - -
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    -
    -
    -
    -
    -
    \ No newline at end of file +<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/users/show_chen.erb b/app/views/users/show_chen.erb new file mode 100644 index 000000000..74b303fad --- /dev/null +++ b/app/views/users/show_chen.erb @@ -0,0 +1,279 @@ +
    +
    +
    最新动态
    + +
    + +
    +
    + 用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    +
    +
    +
    +
    + 用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    +
    + + + +
    +
    +
    + 用户头像
    +
    + + +
    +
    时间:2015-07-31
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-31
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    黄井泉 学生 + 2015-08-01删除 +
    +
    很开心!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    陈正东 学生 + 2015-08-02删除 +
    +
    假期好热,没出去。
    +
    +
    +
    +
    +
    +
    +
    +
    + 用户头像
    +
    + + +
    +
    指派给  苏稳 +
    +
    时间:2015-08-20
    +
    +
    (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    +
    + 文件附件.zip(123KB) +
    +
    + 图片附件.png(123KB) +
    +
    + +
    +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-26
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    尹教授 + 2015-08-01删除 +
    +
    请大家说下软件工程是什么!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    Tang 学生 + 2015-08-01删除 +
    +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index 17057eabb..b71ff9604 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -471,7 +471,7 @@ a.postTypeGrey:hover {color:#15bccf;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:15px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:15px;} .homepagePostSubmitContainer {height:30px; margin-bottom:15px;} -.homepagePostSubmit {font-size:14px; color:#888888; width:80px; height:30px; text-align:center; vertical-align:middle; line-height:30px; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px;} +.homepagePostSubmit {font-size:14px; color:#888888; width:90px; height:30px; text-align:center; vertical-align:middle; line-height:30px; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:12px; color:#888888;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; height:30px; line-height:30px; vertical-align:middle;} From 011184b5372ae253b20c6ad663b31f2b701ff5e4 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 21 Aug 2015 17:26:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 39 ++++ app/views/users/_course_message.html.erb | 82 +++++++++ app/views/users/_course_news.html.erb | 16 +- app/views/users/_project_issue.html.erb | 87 +++++++++ app/views/users/_project_message.html.erb | 82 +++++++++ app/views/users/show.html.erb | 215 +--------------------- 6 files changed, 304 insertions(+), 217 deletions(-) create mode 100644 app/views/users/_course_homework.html.erb create mode 100644 app/views/users/_course_message.html.erb create mode 100644 app/views/users/_project_issue.html.erb create mode 100644 app/views/users/_project_message.html.erb diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb new file mode 100644 index 000000000..2534cad9d --- /dev/null +++ b/app/views/users/_course_homework.html.erb @@ -0,0 +1,39 @@ +
    +
    +
    + <%= 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 %>
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb new file mode 100644 index 000000000..24078696f --- /dev/null +++ b/app/views/users/_course_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.course.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/_course_news.html.erb b/app/views/users/_course_news.html.erb index f57e05e34..414ff79e8 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -1,24 +1,24 @@
    - <%= 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 %>
    发布时间:<%= format_date(activity.created_on) %>
    @@ -33,4 +35,24 @@
    +
    +
    +
    回复(<%=activity.comments_count %>)
    +
    <%=format_date(activity.updated_on)%>
    + +
    +
    + +
    +
    + + + +
    +
    + +
    \ No newline at end of file diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index a998cfc24..3b0087bb4 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -20,13 +20,38 @@
    时间:<%=format_date(activity.created_on) %>
    -
    (缺陷描述)<%=activity.description.html_safe %>
    -
    +
    (缺陷描述)<%=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 %> + +

    +
    + <% end %> + <% end %> +
    +