Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def smart_time_display(time)
end
end

def absolute_time_display(time)
return "" if time.nil?
time.strftime("%B %d, %Y at %I:%M %p")
end

def render_message_body(body)
QuotedEmailFormatter.new(body.to_s).to_html.html_safe
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/activities/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.activity-card class=("is-unread" if activity.read_at.nil?)
.activity-meta
span.activity-type = activity.activity_type.humanize
span.activity-time = smart_time_display(activity.created_at)
span.activity-time title=absolute_time_display(activity.created_at) = smart_time_display(activity.created_at)
- if activity.read_at.nil?
span.activity-unread-badge Unread

Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/_message.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.author-email = message.sender.email
.message-meta
.message-date
time datetime=message.created_at.iso8601 title=message.created_at.strftime("%B %d, %Y at %I:%M %p")
time datetime=message.created_at.iso8601 title=absolute_time_display(message.created_at)
= time_ago_in_words(message.created_at)
| ago
- if message.reply_to
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/_topics.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- last_message = topic.messages.order(:created_at).last
.activity-info
.activity-replies = "#{topic.messages.count - 1} replies"
.activity-time = smart_time_display(last_message.created_at)
.activity-time title=absolute_time_display(last_message.created_at) = smart_time_display(last_message.created_at)
- if user_signed_in?
- state = @topic_states&.dig(topic.id) || {}
- status = state[:status]
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/_topics_page.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.topic-column.activity-col
- last_message = topic.messages.order(:created_at).last
.activity-info
.activity-time = time_ago_in_words(last_message.created_at) + " ago"
.activity-time title=absolute_time_display(last_message.created_at) = time_ago_in_words(last_message.created_at) + " ago"
small.activity-author by #{last_message.sender.name}

/ Next page Turbo Frame for infinite scroll
Expand Down
Loading