From 0e4019be2f8ded33bf67567246ae8344b867bf0b Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 10:23:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4=E4=B9=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/controllers/poll_controller.rb | 1 + app/helpers/application_helper.rb | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 11d1d6e18..db212aef7 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -115,7 +115,7 @@ class MemosController < ApplicationController REPLIES_PER_PAGE = 20 unless const_defined?(:REPLIES_PER_PAGE) def show - #更新贴吧帖子留言对应的memo_messages的viewed字段 + # 更新贴吧帖子留言对应的memo_messages的viewed字段 query_memo_messages = @memo.memo_messages pre_count = REPLIES_PER_PAGE diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 1bbcf9bb4..a8f2a11f1 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -28,6 +28,7 @@ class PollController < ApplicationController render_403 return end + # 问卷消息状态更新 query_course_poll = @poll.course_messages query_course_poll.each do |query| if User.current.id == query.user_id diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 496565c23..76f36b34d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -756,16 +756,16 @@ module ApplicationHelper return ss end - # def time_tag(time, *args) - # options = args.extract_options! - # text = distance_of_time_in_words(Time.now, time) - # if @project - # content_tag('acronym', text, options.reverse_merge(:title => format_time(time))) - # # link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)},options.reverse_merge(:title => format_time(time))) - # else - # content_tag('acronym', text, options.reverse_merge(:title => format_time(time))) - # end - # end + def time_tag(time, *args) + options = args.extract_options! + text = distance_of_time_in_words(Time.now, time) + if @project + content_tag('acronym', text, options.reverse_merge(:title => format_time(time))) + # link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)},options.reverse_merge(:title => format_time(time))) + else + content_tag('acronym', text, options.reverse_merge(:title => format_time(time))) + end + end def syntax_highlight_lines(name, content) lines = []