{% extends "request_pay.html" %}

{% block right_col %}
  {# TRANS: The label for a text box for setting the base payout amount. #}
  <dt>{% trans %}Set Base Payout{% endtrans %}</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 %}
          {# TRANS: A button that sets that when clicked will set the base payout of a request. #}
          <button class="btn btn-default evaluating-only" type="submit" disabled>{% trans %}Set{% endtrans %}</button>
          {% else %}
          <button class="btn btn-default evaluating-only" type="submit">{% trans %}Set{% endtrans %}</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 %}
        {# TRANS: The type of modifier to apply. This button opens a dropdown with the possible kinds of modifier to apply. #}
        {% trans %}Type{% endtrans %} <span class="caret"></span>
        </button>
        <ul id="request-modifier-type" class="dropdown-menu pull-right">
          {# TRANS: A modifier that applies a percentage of the base payout as a bonus. For example, a 10% bonus on 10000000 ISK means the total payout would be 11000000 ISK. #}
          <li><a href="#" id="rel-bonus">{% trans %}% Bonus{% endtrans %}</a></li>
          {# TRANS: A modifier that applies a percentage of the base payout as a penalty. #}
          <li><a href="#" id="rel-deduct">{% trans %}% Deduction{% endtrans %}</a></li>
          {# TRANS: A modifier that applies some flat amount (in millions of ISK) as a bonus. #}
          <li><a href="#" id="abs-bonus">{% trans %}M ISK Bonus{% endtrans %}</a></li>
          {# TRANS: A modifier that applies some flat amount in millions of ISK as a penalty (a deduction from the calculated payout). #}
          <li><a href="#" id="abs-deduct">{% trans %}M ISK Deduction{% endtrans %}</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">
    {{ 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 %}
