{% extends 'core/base.html' %}

{% block content %}
  <h2>Incoming Transfer Requests</h2>
  {% if pending %}
    <ul>
    {% for tr in pending %}
      <li>
        Plant: {{ tr.plant.custom_slug or tr.plant.uuid }} |
        From: {{ tr.seller.username }} |
        <form action="{{ url_for('transfer.approve_request', request_id=tr.id) }}" method="post" style="display:inline">
          {% csrf_token %}
          <button type="submit">Approve</button>
        </form>
        <form action="{{ url_for('transfer.reject_request', request_id=tr.id) }}" method="post" style="display:inline">
          {% csrf_token %}
          <button type="submit">Reject</button>
        </form>
      </li>
    {% endfor %}
    </ul>
  {% else %}
    <p>No pending requests.</p>
  {% endif %}
{% endblock %}
