{% extends "base.html" %}

{% block content %}

<div class="action">
  <button onClick="refresh(this)" type="button" value="Refresh" title="new iteration">↻</button>
</div>

<a href="{{ url_for('main.index') }}" class="h1 text-left"> ⇽ </a>

  {% for result in results %}
  <div class="col text-center mt-2" id="result">

    {% if result['title'] is defined %}
    <p class="h1 mb-2">
      Title:
      {{ result['title'] }}
    </p>
    {% endif %}

    {% if result['year'] is defined %}
    <p class="mb-2">
      Year:
      {{ result['year'] }}
    </p>
    {% endif %}

    {% if result['original_title'] is defined %}
      Original language title:
      {{ result['original_title'] }}
    <br><br>
    {% endif %}

    {% if result['abstract'] is defined %}
    <p>
      Abstract:
      {{ result['abstract'] }}
    </p>
    {% endif %}

    {% if result['original_abstract'] is defined %}
    <p>
      Original language abstract:
      {{ result['original_abstract'] }}
    </p>
    <br><br>
    {% endif %}

    European Patent Office PDF:
    <a href="{{ url_for('search.id_search', id=result['id'], core='all') }}">
      <span class="result-entry">
        {{ result['application_id'] }}
      </span>
    </a>

    {% if result['image'] is defined %}
    <div class="col text-center">
      <img class="img-fluid" src="data:image/jpg;base64,{{ result['image'] }}" alt="Drawing accompanying patent for{{ result['title'] }}" />
    </div>
    {% endif %}

  </div>
  {% endfor %}

{% endblock %}
