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 @@