{% extends "request_pay.html" %}

{% block right_col %}
  <dt>Set Base Payout</dt>
  <dd>
    <form id="payoutForm" method="post">
      {{ payout_form.csrf_token() }}
      {{ payout_form.id_() }}
      {{ payout_form.value.label(class="sr-only") }}
      <div class="form-group input-group">
        {% if srp_request.status != ActionType.evaluating %}
        {{ payout_form.value(class="form-control evaluating-only", placeholder=payout_form.value.label.text, disabled='') }}
        {% else %}
        {{ payout_form.value(class="form-control evaluating-only", placeholder=payout_form.value.label.text) }}
        {% endif %}
        <span class="input-group-btn">
          {% if srp_request.status != ActionType.evaluating %}
          <button class="btn btn-default evaluating-only" type="submit" disabled>Set</button>
          {% else %}
          <button class="btn btn-default evaluating-only" type="submit">Set</button>
          {% endif %}
        </span>
      </div>
    </form>
  </dd>
  {{ super() }}
{% endblock right_col %}

{% block list_modifiers %}
  <form id="modifierForm" method="post">
    {{ macros.render_input(modifier_form.csrf_token) }}
    {{ macros.render_input(modifier_form.id_) }}
    {{ macros.render_input(modifier_form.type_) }}
    <div class="form-group input-group">
      {% if srp_request.status != ActionType.evaluating %}
      {{ modifier_form.value(class="form-control evaluating-only", disabled='') }}
      {% else %}
      {{ modifier_form.value(class="form-control evaluating-only") }}
      {% endif %}
      <div class="input-group-btn">
        {% if srp_request.status != ActionType.evaluating %}
        <button type="button" class="btn btn-default dropdown-toggle evaluating-only" data-toggle="dropdown" disabled>
        {% else %}
        <button type="button" class="btn btn-default dropdown-toggle evaluating-only" data-toggle="dropdown">
        {% endif %}
          Type <span class="caret"></span>
        </button>
        <ul id="request-modifier-type" class="dropdown-menu pull-right">
          <li><a href="#" id="rel-bonus">% Bonus</a></li>
          <li><a href="#" id="rel-deduct">% Deduction</a></li>
          <li><a href="#" id="abs-bonus">M ISK Bonus</a></li>
          <li><a href="#" id="abs-deduct">M ISK Deduction</a></li>
        </ul>
      </div>
    </div>
    <div class="form-group">
      {{ modifier_form.note.label }}
      {% if srp_request.status != ActionType.evaluating %}
      {{ modifier_form.note(class="form-control evaluating-only", disabled='') }}
      {% else %}
      {{ modifier_form.note(class="form-control evaluating-only") }}
      {% endif %}
    </div>
  </form>
  {{ super() }}
{% endblock list_modifiers %}

{% block modifier_header %}
  {% if not modifier.voided and srp_request.status == ActionType.evaluating %}
  <form class="form" method="post" action="{{ url_for('requests.get_request_details', request_id=srp_request.id) }}">
    {{ void_form.csrf_token }}
    {{ void_form.id_ }}
    <input class="form-control" id="modifier_id_{{ modifier.id }}" name="modifier_id" type="hidden" value="{{ modifier.id }}">
    <button class="close" type="submit" name="void_modifier">&times;</button>
  </form>
  {% endif %}
  {{ super () }}
{% endblock modifier_header %}
