{% 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>

<div class="compare mt-5">

  {% for result in results %}
    <div class="mt-5 text-center skewY">

    {% 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['country'] is defined %}
    <p class="mb-2">
      Country:
      {{ result['country'].name }}
      {{ result['country'].flag }}
    </p>
    {% endif %}

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

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

    {% if result['original_abstract'] is defined %}
    <p class="mb-2">
      Original language abstract:
      {{ result['original_abstract'] }}
    </p>
    {% endif %}

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

    {% 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 %}

</div>

{% endblock %}