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

  This file is part of Invenio.
  Copyright (C) 2016-2022 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.
#}

{% extends "invenio_requests/details/index.html" %}

{% set active_dashboard_menu_item = 'requests' %}
{% set active_community_header_menu_item = 'requests' %}

{%- block request_header %}
  <div class="ui grid">
    <div class="sixteen wide mobile eight wide tablet eight wide computer column left floated left aligned">
      <h2 class="ui header">
        <div class="ui label green ml-0">{{_("New submission")}}</div>
        {{ request.title }}
      </h2>

      {% if record %}
      <div class="ui horizontal list" role="list">
      {% for item in record.metadata.creators %}
        <div class="item" role="listitem">
          <div class="content"><i class="user icon"></i>
            {{ item.person_or_org.name }}</div>
        </div>
      {% endfor %}
      </div>
    {% endif %}
    </div>

    {% block request_actions %}
      {{ super() }}
    {% endblock request_actions %}
  </div>
{%- endblock request_header %}

{% block request_timeline %}
<div
  class="ui container invenio-tab-container fluid rel-pt-3"
  id="request-community-submission-tab-container"
>
  <div
    class="ui secondary pointing menu invenio-tab-menu"
    id="request-community-submission-tab"
  >
    <a
      class="active item"
      data-tab="conversation"
      role="tab"
      aria-selected="true"
      aria-controls="conversation"
      id="conversation-tab-menu"
    >
      {{_("Conversation")}}
    </a>

    {% if record %}
    <a
      class="item"
      data-tab="record"
      id="record-tab-menu"
      aria-controls="record"
    >
      {{_("Record")}}
    </a>
    {% endif %}
  </div>

  <div
    class="ui bottom attached tab segment active borderless p-0"
    data-tab="conversation"
    role="tabpanel"
    aria-labelledby="conversation"
    id="conversation-tab"
  >
    <div class="ui divider hidden"></div>
    {{ super() }}
  </div>

  {% if record %}
  <div class="ui bottom attached tab segment borderless" data-tab="record"
       role="tabpanel" aria-labelledby="record" id="record-tab"
       hidden="hidden">
    <div class="ui divider hidden"></div>
    {% set use_theme_basic_template = false %}
    {%- set preview_submission_request = true %}
    {% include "invenio_app_rdm/records/detail.html" %}
  </div>
  {% endif %}
</div>

{% endblock request_timeline %}
