Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from jtgeibel/for-ce1-upstream
Browse files Browse the repository at this point in the history
Fixes for edge date formatting and Rails 2.3.14 compatibility
  • Loading branch information
bborn committed Nov 28, 2011
2 parents bca2b39 + eef9b6b commit ce8c381
Show file tree
Hide file tree
Showing 16 changed files with 666 additions and 666 deletions.
2 changes: 1 addition & 1 deletion app/helpers/base_helper.rb
Expand Up @@ -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 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 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 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
end end


Expand Down
4 changes: 2 additions & 2 deletions app/models/message.rb
Expand Up @@ -8,7 +8,7 @@ class Message < ActiveRecord::Base
has_many :children, :class_name => "Message", :foreign_key => "parent_id" has_many :children, :class_name => "Message", :foreign_key => "parent_id"
has_many :message_threads 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 :body, :subject
validates_presence_of :recipient, :message => "is invalid" validates_presence_of :recipient, :message => "is invalid"
Expand Down Expand Up @@ -52,4 +52,4 @@ def self.new_reply(sender, message_thread = nil, params = {})
message message
end end


end end
2 changes: 1 addition & 1 deletion app/views/forums/show.html.haml
Expand Up @@ -58,7 +58,7 @@
%td.ca.inv.stat= topic.sb_posts_count %td.ca.inv.stat= topic.sb_posts_count
%td.ca.inv.stat= number_with_delimiter(topic.views) %td.ca.inv.stat= number_with_delimiter(topic.views)
%td.lp %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 = :by.l
%span.author %span.author
%strong.fn= h(topic.replied_by_user.display_name) %strong.fn= h(topic.replied_by_user.display_name)
Expand Down
4 changes: 2 additions & 2 deletions app/views/sb_posts/_sb_post.html.haml
Expand Up @@ -7,7 +7,7 @@
%td.author.vcard{:width => "15%"} %td.author.vcard{:width => "15%"}
.date .date
%a{"href"=>"##{post.dom_id}", "rel"=>"bookmark"} %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 -if post.user
= avatar_for post.user = avatar_for post.user
Expand All @@ -32,4 +32,4 @@


%td.body.entry-content{"id"=>"post-body-#{post.id}", :width => '85%'} %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? = 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
2 changes: 1 addition & 1 deletion app/views/sb_posts/index.html.haml
Expand Up @@ -32,7 +32,7 @@
%tr.post{ :id => post.dom_id } %tr.post{ :id => post.dom_id }
%td.author.vcard %td.author.vcard
.date .date
%abbr.updated{ :title => post.created_at.xmlschema } %abbr.updated{ :title => post.created_at }
= time_ago_in_words(post.created_at) = time_ago_in_words(post.created_at)


= avatar_for @users[post.user_id] = avatar_for @users[post.user_id]
Expand Down
4 changes: 2 additions & 2 deletions app/views/sb_posts/monitored.html.erb
Expand Up @@ -27,9 +27,9 @@
<tr class="post hentry" id="<%= post.dom_id %>"> <tr class="post hentry" id="<%= post.dom_id %>">
<td class="author vcard"> <td class="author vcard">
<div class="date"> <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%> <% 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 %> <% else %>
<%= post.created_at.strftime("%b %e, %Y")%> <%= post.created_at.strftime("%b %e, %Y")%>
<% end %> <% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/show.html.haml
Expand Up @@ -67,7 +67,7 @@
%a{"name"=>"#{@posts.to_a.first.dom_id}", "id"=>"#{@posts.to_a.first.dom_id}"} &nbsp; %a{"name"=>"#{@posts.to_a.first.dom_id}", "id"=>"#{@posts.to_a.first.dom_id}"} &nbsp;
%br.clear %br.clear
%br %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 - for post in @posts do
=render :partial => 'sb_posts/sb_post', :locals => {:post => post} =render :partial => 'sb_posts/sb_post', :locals => {:post => post}


Expand Down
122 changes: 61 additions & 61 deletions lang/ui/de-DE.yml

Large diffs are not rendered by default.

0 comments on commit ce8c381

Please sign in to comment.