Fix and improve styling for links in the datagrids.
Review Request #9080 - Created July 15, 2017 and submitted
Our datagrids were rendering with extra, unwanted
<a>tags for some
columns. Part of this was due to an old change that regressed the
link=Falsesemantics, causing this flag to just result in
being ignored rather than disabling linking. Another part was due to the
<a>, which isn't legal and caused the browser
to do odd things that easily resulted in duplicate tags. Still another
was the need for rendering custom
<a>tags as part of the cell data
when in need of a custom CSS class (which often resulted in extra tags
link=Falseis respected. When provided, links will not be
generated for the row's object in the data automatically. Similarly, if
link_funcfails, the URL won't fall back to the URL for the row's
<a>tags no longer contain a
<div>. Instead, we just assign
display: blockto the
<a>. The cell also gained a
class to help with styling, so that there's no impact on custom
tags within the cell.
Columns can now accept a
link_css_classattribute, which specifies the
CSS class names (or a function returning them) to apply to the
reducing the work that a column has to do and reducing the amount of
data that must be cached.
This shouldn't outright break any consumers unless they're using
link=Falseand still expecting links to show up (which wasn't really
ever the intended behavior). However, they can now take advantage of
link_css_classto reduce the data they must render.
Tested with Review Board, both the current upstream and with a change
that takes advantage of the new