Add missing anchors and hover links when publishing draft replies.
Review Request #11287 — Created Nov. 18, 2020 and updated
Review Board 3.0 introduced standardized anchors for comments and handy
icons for getting the link to the comment when hovering over, helping
reviewers point to specific comments without digging through the HTML.
These were only provided when loading a page, though. When publishing a
draft reply, those anchors and hover links wouldn't be made available.
Although reloading the page would make them appear, it was an annoying
This change adds in the HTML for these when publishing a reply. To keep
prefixes specific to certain types of replies (diff comments, header
replies, etc.) for the anchor in the HTML as a new data attribute, and
fetch that out on the client side. This lets us keep all our logic for
differentiating anchors solely in the server-side templates and template
tags, so that we won't have to further rework the client-side code as we
introduce new types of replies.
Created replies for reviews headers and footers, diff comments, general
comments, and file attachment comments. Verified that the anchors worked
and that the links took me to the right spot. Also verified that they
matched the anchor names on page reload.
Since this isn't an es6 file here, we shouldn't have the trailing comma.