From f0e456729e1f6ab9510494ffd365c7d3e4e7cd45 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 12 Jul 2016 16:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E7=9A=84html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 8 ++++++++ app/views/layouts/_show_messages_list.html.erb | 16 ++++++++-------- .../users/_join_course_course_message.html.erb | 2 +- app/views/users/_user_message_course.html.erb | 10 +++++----- app/views/users/_user_message_forum.html.erb | 2 +- app/views/users/_user_message_system.html.erb | 2 +- .../users/_user_message_userfeedaback.html.erb | 2 +- 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23fd401fd..3a28e4b72 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3296,6 +3296,14 @@ def strip_html(text,len=0,endss="...") return ss end +def message_content content + content = (strip_html content).strip + if content.gsub(" ", "") == "" + content = "[非文本消息]" + end + content +end + def get_hw_index(hw,is_teacher) if is_teacher homeworks = hw.course.homework_commons.order("created_at asc") diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb index ba31c4379..0829b9c42 100644 --- a/app/views/layouts/_show_messages_list.html.erb +++ b/app/views/layouts/_show_messages_list.html.erb @@ -5,7 +5,7 @@