{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2016-2020 CERN.

  Invenio is free software; you can redistribute it and/or modify it
  under the terms of the MIT License; see LICENSE file for more details.
#}

{% if base_template|default(false) %}
  {%- extends base_template %}
{% else %}
  {%- extends config.BASE_TEMPLATE %}
{% endif %}

{% set title = _("Request ") %}

{% block page_body %}
  {{ super() }}
  {%- block request_body %}
    <div class="ui container request-detail-page">

      {%- block request_header %}
        <div class="ui stackable grid">

          <div class="sixteen wide mobile ten wide tablet eight wide computer column">
            <h2 class="ui header">
              {% block request_header_title %}
                {{ invenio_request.title }}
              {% endblock request_header_title %}
            </h2>
          </div>

          <div class="sixteen wide mobile six wide tablet eight wide computer column right floated right aligned">
            {% block request_actions %}
              <div id="request-actions" class="rel-mb-1"></div>
            {% endblock request_actions %}
          </div>
        </div>

        <div class="ui divider"></div>

      {%- endblock request_header %}

    {%- block request_timeline %}
    <div id="request-detail"
         data-record='{{ invenio_request | tojson }}'
         data-default-query-config='{{ dict(size=config["REQUESTS_TIMELINE_PAGE_SIZE"]) | tojson }}'
         data-user-avatar='{{ user_avatar | tojson }}'
    >{# react app root #}</div>
    {%- endblock request_timeline %}

    </div>
  {% endblock request_body %}
{% endblock page_body %}

{% block javascript %}
  {{ super() }}
  {% include config.THEME_JAVASCRIPT_TEMPLATE %}
  {{ webpack['invenio-requests-base.js'] }}
{% endblock %}
