Added some {{#if}} statements to avoid rendering the contents of our
modals until they're actually visible.