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

{% block content %}
  <h2>Request Transfer: {{ plant.custom_slug or plant.uuid }}</h2>
  <form method="post">
    {% csrf_token %}
    {% if plant.owner_id == current_user.id %}
      <label for="buyer_id">Select Buyer:</label>
      <select name="buyer_id" id="buyer_id">
        {% for user in all_users %}
          <option value="{{ user.id }}">{{ user.username }}</option>
        {% endfor %}
      </select>
      <br>
      <label for="seller_message">Message (optional):</label><br>
      <textarea name="seller_message" id="seller_message"></textarea><br>
    {% else %}
      <label for="seller_id">Confirm Seller:</label>
      <select name="seller_id" id="seller_id">
        <option value="{{ all_users[0].id }}">{{ all_users[0].username }}</option>
      </select>
      <br>
      <label for="buyer_message">Message (optional):</label><br>
      <textarea name="buyer_message" id="buyer_message"></textarea><br>
    {% endif %}
    <button type="submit">Send Request</button>
  </form>
{% endblock %}
