<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="History of the fedmsg bus" />
    <meta name="author" content="Ralph Bean" />

    {% if config.CONTENT_SECURITY_POLICY %}
    <meta
      http-equiv="Content-Security-Policy"
      content="{{ config.CONTENT_SECURITY_POLICY }}"
    />
    {% endif %}

    <link
      rel="shortcut icon"
      href="{{ url_for('static', filename='favicon.png') }}"
    />
    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='css/fedora-bootstrap-fonts.css') }}"
    />

    <title>Datagrepper</title>

    <!-- Bootstrap core CSS -->
    <link href="{{config.THEME_CSS_URL}}" rel="stylesheet" />
    <link
      href="{{ url_for('static', filename='css/raw.css') }}"
      rel="stylesheet"
    />
    <link
      rel="stylesheet"
      href="{{ url_for('static', filename='css/main.css') }}"
    />
  </head>

  <body>
    <div class="masthead">
      <div class="container">
        <img
          src="{{ url_for('static', filename='datagrepper.png') }}"
          height="40px"
        />
      </div>
    </div>

    <nav class="navbar navbar-light navbar-underline p-t-0 p-b-0">
      <div class="container-narrow">
        <ul class="nav navbar-nav nav-justified nav-underline">
          <li class="nav-item">
            <a class="nav-link" href="{{ url_for('index') }}"
              >Getting&nbsp;started</a
            >
          </li>
          <li class="nav-item active">
            <a class="nav-link" href="{{ url_for('raw') }}?rows_per_page=1"
              >Feed</a
            >
          </li>
          <li class="nav-item">
            <a class="nav-link" href="{{ url_for('doc', page='reference') }}"
              >Reference</a
            >
          </li>
          <li class="nav-item">
            <a class="nav-link" href="{{ url_for('doc', page='widget') }}"
              >Embedding</a
            >
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              href="https://github.com/fedora-infra/datagrepper"
              >Source</a
            >
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              href="https://github.com/fedora-infra/datagrepper/issues"
              >Issues</a
            >
          </li>
        </ul>
      </div>
    </nav>
    <div class="bodycontent p-t-lg">
      <div class="container">
        <div class="page-header row">
          <div class="col-md-6">
            {% if heading %}
            <h1>{{heading}}</h1>
            {% else %}
            <h1>{{config.BUS_INFO.shortname}} <small>messages</small></h1>
            {% endif %}
            <p>
              See <a href="{{ url_for('index') }}">the documentation</a> for
              information on how to construct queries.
            </p>
            <p>
              The list of possible topics can be found in
              <a
                href="https://fedora-messaging.readthedocs.io/en/stable/user-guide/schemas.html"
              >
                Fedora Messaging's documentation </a
              >.
            </p>
          </div>
          <div class="col-md-4 col-md-offset-1 hidden">
            <div class="panel panel-default">
              <div class="panel-body text-center"></div>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-6 col-md-offset-3 m-b">
            <span
              id="messages-pending"
              class="btn btn-secondary btn-block hidden"
              role="button"
            ></span>
          </div>
          <table class="table table-sm" id="message-container">
            {% include 'raw.html' %}
          </table>
          {% if size == 'extra-large' %} {% autoescape false %} {{msg_string}}
          {% endautoescape %} {% endif %}
        </div>

        {% if response | length > 1 %}
        <div id="loader" class="row">
          <div class="col-md-4 col-md-offset-4">
            <div class="panel panel-default">
              <div class="panel-body text-center">Loading... please wait.</div>
            </div>
          </div>
        </div>
        {% endif %}
      </div>
    </div>

    <div class="footer p-t p-b text-center">
      <div class="container">
        <p class="text-muted credit">
          Datagrepper is Powered by
          <a href="{{config.BUS_INFO.docs}}">{{config.BUS_INFO.shortname}}</a>.
          The
          <a href="https://github.com/fedora-infra/datagrepper">source</a>
          and
          <a href="https://github.com/fedora-infra/datagrepper/issues"
            >issue tracker</a
          >
          are available on github.
        </p>
        <p class="text-muted">
          Running <code>datagrepper-{{grepper_version}}</code>,
          <code>datanommer.models-{{models_version}}</code>
        </p>
      </div>
    </div>

    <script src="{{ url_for('static', filename='jquery-2.1.0.min.js') }}"></script>
    {% if autoscroll %}
    <script src="{{ url_for('static', filename='autoscroll.js') }}"></script>
    {% if config.WEBSOCKET_URL %}
    <script src="{{ url_for('static', filename='live.js') }}"></script>
    <script>
      $(document).ready(function () {
        setup_websocket("{{config.WEBSOCKET_URL}}");
      });
    </script>
    {% endif %} {% endif %}
    <script>
      $("#messages-pending").hide();
    </script>
  </body>
</html>
