{% from "./macros/verification.html" import show_verification %}

{% macro show_request(request) %}
  <dl>
    <div class="grid-x">
      <dt class="cell small-4 medium-2 large-1">Method</dt>
      <dd class="cell small-8 medium-10 large-11">{{ request.method.value }}</dd>
    </div>
    <div class="grid-x">
      <dt class="cell small-4 medium-2 large-1">Path</dt>
      <dd class="cell small-8 medium-10 large-11">{{ request.path }}</dd>
    </div>
    {% if request.headers %}
      <div class="grid-x">
        <dt class="cell small-4 medium-2 large-1">Headers</dt>
        <dd class="cell small-8 medium-10 large-11">{{ show_headers(request.headers) }}</dd>
      </div>
    {% endif %}
    {% if request.params %}
      <div class="grid-x">
        <dt class="cell small-4 medium-2 large-1">Params</dt>
        <dd class="cell small-8 medium-10 large-11">{{ request.params }}</dd>
      </div>
    {% endif %}
  </dl>
{% endmacro %}

{% macro show_headers(headers) %}
  <ul>
    {% for name, value in headers.items() %}
      <li>{{ name }}: {{ value }}</li>
    {% endfor %}
  </ul>
{% endmacro %}