Permalink
Browse files

Merge pull request #34 from jtgeibel/for-ce1-upstream

Fixes for edge date formatting and Rails 2.3.14 compatibility
  • Loading branch information...
2 parents bca2b39 + eef9b6b commit ce8c3810e5997e57e836dd4e6ff79f9549ba3128 @bborn bborn committed Nov 28, 2011
@@ -330,7 +330,7 @@ def time_ago_in_words(from_time, to_time = Time.now, include_seconds = false)
when 1..59 then :minutes_ago.l(:count => distance_in_minutes)
when 60..1440 then :hours_ago.l(:count => (distance_in_minutes.to_f / 60.0).round)
when 1440..2880 then :days_ago.l(:count => (distance_in_minutes.to_f / 1440.0).round) # 1.5 days to 2 days
- else I18n.l(from_time, :format => :time_ago)
+ else I18n.l(from_time.to_date, :format => :date_ago)
end
end
@@ -8,7 +8,7 @@ class Message < ActiveRecord::Base
has_many :children, :class_name => "Message", :foreign_key => "parent_id"
has_many :message_threads
- named_scope :parents, :conditions => "parent_id IS NULL"
+ # named_scope :conversation_roots, :conditions => "parent_id IS NULL"
validates_presence_of :body, :subject
validates_presence_of :recipient, :message => "is invalid"
@@ -52,4 +52,4 @@ def self.new_reply(sender, message_thread = nil, params = {})
message
end
-end
+end
@@ -58,7 +58,7 @@
%td.ca.inv.stat= topic.sb_posts_count
%td.ca.inv.stat= number_with_delimiter(topic.views)
%td.lp
- %abbr.updated{:title=>"#{topic.replied_at.xmlschema}"}= time_ago_in_words(topic.replied_at)
+ %abbr.updated{:title=>"#{topic.replied_at}"}= time_ago_in_words(topic.replied_at)
= :by.l
%span.author
%strong.fn= h(topic.replied_by_user.display_name)
@@ -7,7 +7,7 @@
%td.author.vcard{:width => "15%"}
.date
%a{"href"=>"##{post.dom_id}", "rel"=>"bookmark"}
- %abbr.updated{"title"=>"#{post.created_at.xmlschema}"}= time_ago_in_words(post.created_at)
+ %abbr.updated{"title"=>"#{post.created_at}"}= time_ago_in_words(post.created_at)
-if post.user
= avatar_for post.user
@@ -32,4 +32,4 @@
%td.body.entry-content{"id"=>"post-body-#{post.id}", :width => '85%'}
= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply', :plugin => 'community_engine'), "$('reply').toggle()" if logged_in?
- = post.body_html
+ = post.body_html
@@ -32,7 +32,7 @@
%tr.post{ :id => post.dom_id }
%td.author.vcard
.date
- %abbr.updated{ :title => post.created_at.xmlschema }
+ %abbr.updated{ :title => post.created_at }
= time_ago_in_words(post.created_at)
= avatar_for @users[post.user_id]
@@ -27,9 +27,9 @@
<tr class="post hentry" id="<%= post.dom_id %>">
<td class="author vcard">
<div class="date">
- <abbr class="updated" title="<%= post.created_at.xmlschema %>">
+ <abbr class="updated" title="<%= post.created_at %>">
<% if post.created_at > Time.now.utc-24.hours%>
- <%= time_ago_in_words(post.created_at).sub(/about /, '') %> ago
+ <%= time_ago_in_words(post.created_at) %> ago
<% else %>
<%= post.created_at.strftime("%b %e, %Y")%>
<% end %>
@@ -67,7 +67,7 @@
%a{"name"=>"#{@posts.to_a.first.dom_id}", "id"=>"#{@posts.to_a.first.dom_id}"} &nbsp;
%br.clear
%br
- %table.posts.wide{"cellspacing"=>"0", "border"=>"0", "cellpadding"=>"0"}
+ %table.posts.wide#posts{"cellspacing"=>"0", "border"=>"0", "cellpadding"=>"0"}
- for post in @posts do
=render :partial => 'sb_posts/sb_post', :locals => {:post => post}
Oops, something went wrong. Retry.

0 comments on commit ce8c381

Please sign in to comment.