Skip to content
  • Deimos's avatar
    Use intercooler for comment reply form · 6227f747
    Deimos authored
    Previously, the comment reply form was being created entirely
    client-side by cloning and modifying a <template>. This was nice because
    it meant that a network request wasn't necessary to display the form,
    but it also had downsides.
    
    For example, if a topic was locked after a user had already loaded the
    page (or their notifications page with a comment from that topic), they
    would still be able to click Reply and type in a comment, and wouldn't
    know that replying wasn't possible until they actually tried to submit
    the comment.
    
    By switching to using intercooler for this form, we can do server-side
    validation to check permissions before showing the form, and it also
    simplifies some other aspects, such as the warning about replying to an
    old comment, which previously needed a data-js-old-warning-age attribute
    in the HTML, but is now just part of generating the reply form template
    server-side.
    6227f747