<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    .dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
    #operator_info_panel {
      width: 27em;
      margin: 4em auto 0 auto;
      line-height: 1.2em;
    }
    #show_operator_info { text-decoration: none; color: #99f; font-size: smaller; }
    #show_operator_info:hover { text-decoration: underline; }
    #operator_info { color: #444; text-align: justify; }
  </style>
</head>

<body>
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
    <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  </div>
  <div id="operator_info_panel">
    <a id="show_operator_info" href="javascript:void(showOperatorInfo())">Information for the administrator of this website</a>
    <div id="operator_info" style="display: none">
      <p>The {{PROGRAM_NAME}} application server encountered an error while starting your web application.
        Because you are running this web application in staging or production mode, the details of the error
        have been omitted from this web page for security reasons.</p>
      <p><strong>Please read the web server error log to find the details of the error.</strong>
        If you don't know where the web server error log is, read the troubleshooting documentation below.</p>
      <p>Alternatively, you can turn on the "friendly error pages" feature (see below), which will make {{PROGRAM_NAME}} show many details about the error right in the browser.</p>
      <p>{{PROGRAM_NAME}} troubleshooting documentation:</p>
      <ul>
        <li><a href="{{NGINX_DOC_URL|raw}}#troubleshooting">Nginx integration mode</a></li>
        <li><a href="{{APACHE2_DOC_URL|raw}}#troubleshooting">Apache integration mode</a></li>
        <li><a href="{{STANDALONE_DOC_URL|raw}}#troubleshooting">Standalone mode</a></li>
      </ul>
      <p>To turn on friendly error pages:</p>
      <ul>
        <li><a href="{{NGINX_DOC_URL|raw}}#PassengerFriendlyErrorPages">Nginx integration mode</a></li>
        <li><a href="{{APACHE2_DOC_URL|raw}}#PassengerFriendlyErrorPages">Apache integration mode</a></li>
        <li>Standalone mode: pass the <code>--friendly-error-pages</code> parameter to the <code>passenger</code> command.</li>
      </ul>
    </div>
  </div>

  <script>
    function showOperatorInfo() {
      document.getElementById('operator_info').style.display = 'block';
    }
  </script>
</body>
</html>
