protected function injectAlert(Response $response)
    {
        $content = $response->getContent();

        $pos = strripos($content, '<body>');
        if (false !== $pos) {
            $renderedContent = soda_cms_view('partials.draft-alert')->render();

            $content = substr($content, 0, $pos).$renderedContent.substr($content, $pos);

            // Update the new content and reset the content length
            $response->setContent($content);
            $response->headers->remove('Content-Length');
        }
    }