Files
nairobi/app/components/concerns/table_action_link.rb
Javi Martín 9794ffbbf8 Use icons in admin table actions
The planned budget investments redesign includes using icons in some
tables, so we might as well use them everywhere.

The original design used Foundation to show the tooltips. We're using
CSS in order to keep the ERB/HTML code simple. One advantage of using
CSS is we can show the tooltip on focus as well, just like accessibility
guidelines recommend [1]. On the other hand, Foundation tooltips appear
on the sides when the link is at the bottom of the page, making sure
they're visible in this case, while CSS tooltips do not. Neither CSS
tooltips nor Foundation tooltips are dismissable, which might be an
accessibility issue.

Note we aren't changing any ERB files in order to replace links with
icons; we're only changing CSS and one line of Ruby code.

[1] https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus
2020-11-03 14:58:02 +01:00

8 lines
142 B
Ruby

module TableActionLink
extend ActiveSupport::Concern
def link_to(text, url, **options)
super(tag.span(text), url, options)
end
end