end
if params.key?(:display_name)
- t "browse.#{action}_html",
- :time => time,
- :title => title
+ t "browse.#{action}_ago_html", :time_ago => tag.abbr(time, :title => title)
else
- t "browse.#{action}_by_html",
- :time => time,
- :title => title,
- :user => changeset_user_link(changeset)
+ t "browse.#{action}_ago_by_html", :time_ago => tag.abbr(time, :title => title),
+ :user => changeset_user_link(changeset)
end
end
<ul class="list-unstyled">
<li>
- <%= t "browse.#{common_details.visible? ? :edited : :deleted}_by_html",
- :time => time_ago_in_words(common_details.timestamp, :scope => :"datetime.distance_in_words_ago"),
- :user => changeset_user_link(common_details.changeset),
- :title => l(common_details.timestamp) %>
+ <%= t "browse.#{common_details.visible? ? :edited : :deleted}_ago_by_html",
+ :time_ago => tag.abbr(time_ago_in_words(common_details.timestamp, :scope => :"datetime.distance_in_words_ago"),
+ :title => l(common_details.timestamp)),
+ :user => changeset_user_link(common_details.changeset) %>
</li>
<li>
<%= t "browse.in_changeset" %>
browse:
created: "Created"
closed: "Closed"
- created_html: "Created <abbr title='%{title}'>%{time}</abbr>"
- closed_html: "Closed <abbr title='%{title}'>%{time}</abbr>"
- created_by_html: "Created <abbr title='%{title}'>%{time}</abbr> by %{user}"
- deleted_by_html: "Deleted <abbr title='%{title}'>%{time}</abbr> by %{user}"
- edited_by_html: "Edited <abbr title='%{title}'>%{time}</abbr> by %{user}"
- closed_by_html: "Closed <abbr title='%{title}'>%{time}</abbr> by %{user}"
+ created_ago_html: "Created %{time_ago}"
+ closed_ago_html: "Closed %{time_ago}"
+ created_ago_by_html: "Created %{time_ago} by %{user}"
+ closed_ago_by_html: "Closed %{time_ago} by %{user}"
+ deleted_ago_by_html: "Deleted %{time_ago} by %{user}"
+ edited_ago_by_html: "Edited %{time_ago} by %{user}"
version: "Version"
in_changeset: "Changeset"
anonymous: "anonymous"
# We need to explicitly reset the closed_at to some point in the future, and avoid the before_save callback
changeset.update_column(:closed_at, Time.now.utc + 1.day) # rubocop:disable Rails/SkipsModelValidations
- assert_match %r{^Created <abbr title='Mon, 01 Jan 2007 00:00:00 \+0000'>.*</abbr> by anonymous$}, changeset_details(changeset)
+ assert_match %r{^Created <abbr title="Mon, 01 Jan 2007 00:00:00 \+0000">.*</abbr> by anonymous$}, changeset_details(changeset)
changeset = create(:changeset, :created_at => Time.utc(2007, 1, 1, 0, 0, 0), :closed_at => Time.utc(2007, 1, 2, 0, 0, 0))
user_link = %(<a href="/user/#{ERB::Util.u(changeset.user.display_name)}">#{changeset.user.display_name}</a>)
- assert_match %r{^Closed <abbr title='Created: Mon, 01 Jan 2007 00:00:00 \+0000 Closed: Tue, 02 Jan 2007 00:00:00 \+0000'>.*</abbr> by #{user_link}$}, changeset_details(changeset)
+ assert_match %r{^Closed <abbr title="Created: Mon, 01 Jan 2007 00:00:00 \+0000 Closed: Tue, 02 Jan 2007 00:00:00 \+0000">.*</abbr> by #{user_link}$}, changeset_details(changeset)
end
end