Skip to content

Commit

Permalink
Add expansion of time info on touch and mouse activation
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerJeromin committed Nov 22, 2023
1 parent 5da286b commit 656e82f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ small, aside {
time[title] {
text-decoration: underline dotted;
}
time[title]:active::after,
time[title]:focus::after {
content: " (" attr(title) ")";
}

#container { position: relative; }

Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def dir
end

def friendly_date(date)
tag.time(time_ago_in_words(date), :title => l(date, :format => :friendly), :datetime => date.xmlschema)
tag.time(time_ago_in_words(date), :title => l(date, :format => :friendly), :datetime => date.xmlschema, :tabindex => 0)
end

def friendly_date_ago(date)
tag.time(time_ago_in_words(date, :scope => :"datetime.distance_in_words_ago"), :title => l(date, :format => :friendly), :datetime => date.xmlschema)
tag.time(time_ago_in_words(date, :scope => :"datetime.distance_in_words_ago"), :title => l(date, :format => :friendly), :datetime => date.xmlschema, :tabindex => 0)
end

def body_class
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/changesets_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def changeset_details(changeset)
end

if params.key?(:display_name)
t "browse.#{action}_ago_html", :time_ago => tag.time(time, :title => title, :datetime => datetime)
t "browse.#{action}_ago_html", :time_ago => tag.time(time, :title => title, :datetime => datetime, :tabindex => 0)
else
t "browse.#{action}_ago_by_html", :time_ago => tag.time(time, :title => title, :datetime => datetime),
t "browse.#{action}_ago_by_html", :time_ago => tag.time(time, :title => title, :datetime => datetime, :tabindex => 0),
:user => changeset_user_link(changeset)
end
end
Expand Down

0 comments on commit 656e82f

Please sign in to comment.