<div id='condition'>
  <div class='header'>{{localize 'GURPS.conditions'}}</div>
  <div class='fieldblock'>

    {{#if (ne system.conditions.maneuver 'undefined')}}
      <div class='label-field-pair'>
        {{#if (eq view 'condensed')}}
          <div class='label'>{{localize 'GURPS.maneuver'}}:</div>
          <div class='field details'>
            <details id='maneuver'>
              <summary>
                {{#with (getManeuver system.conditions.maneuver) as |maneuver|}}
                  <img
                    class='button'
                    src='{{maneuver.icon}}'
                    title='{{localize maneuver.label}}'
                    alt='{{maneuver.name}}'
                  />
                {{/with}}
              </summary>
              <div class='popup square5x4'>
                {{#each (listAllManeuvers) as |this key|}}
                  <img class='button' src='{{icon}}' title='{{localize label}}' alt='{{key}}' />
                {{/each}}
              </div>
            </details>
          </div>
        {{else}}
          <div class='label'>{{localize 'GURPS.maneuver'}}:</div>
          <div class='field' style='border: none;'>
            <select
              id='maneuver'
              name='system.conditions.maneuver'
              style='font-size: 90%; max-width: 14em;'
              {{disabled (or isEditing (not (inCombat this)))}}
            >
              <option value='undefined' {{select-if system.conditions.maneuver 'undefined'}}>
                {{localize 'GURPS.none'}}
              </option>
              {{#with system.conditions.maneuver as |maneuver|}}
                {{#each (listAllManeuvers) as |this key|}}
                  <option value='{{key}}' {{select-if maneuver key}}>
                    {{localize this.label}}
                  </option>
                {{/each}}
              {{/with}}
            </select>
          </div>
        {{/if}}
      </div>
    {{/if}}

    <div class='label-field-pair'>
      <div class='label'>{{localize 'GURPS.modifierPosture'}}:</div>
      {{#if (eq view 'condensed')}}
        <div class='field details'>
          <details id='posture'>
            <summary>
              {{#with (getPosture system.conditions.posture) as |posture|}}
                <img class='button' src='{{posture.img}}' title='{{localize posture.name}}' alt='{{posture.id}}' />
              {{/with}}
            </summary>
            <div class='popup square5x4'>
              <img
                class='button'
                src='systems/gurps/icons/statuses/dd-condition-standing.webp'
                title='{{localize "GURPS.status.Standing"}}'
                alt='standing'
              />
              {{#each (listAllPostures) as |this key|}}
                <img class='button' src='{{img}}' title='{{localize name}}' alt='{{id}}' />
              {{/each}}
            </div>
          </details>
        </div>
      {{else}}
        <div class='field' style='border: none;'>
          <select id='posture' name='system.conditions.posture' style='font-size: 90%;' {{disabled isEditing}}>
            <option value='standing' {{select-if system.conditions.posture 'standing'}}>{{localize
                'GURPS.status.Standing'
              }}
            </option>
            {{#with system.conditions.posture as |posture|}}
              {{#each (listAllPostures) as |this key|}}
                <option value='{{key}}' {{select-if posture key}}>
                  {{localize this.name}}
                </option>
              {{/each}}
            {{/with}}
          </select>
        </div>
      {{/if}}
    </div>

    <div class='label-field-pair'>
      <div class='label'>{{localize 'GURPS.conditionsCombatMove'}}:</div>
      <div class='field' name='system.conditions.combatmove'><span>{{system.conditions.move}}</span></div>
    </div>

    <div class='label-field-pair'>
      <div class='label'>{{localize 'GURPS.maxActionsPerTurn'}}:</div>
      {{#if isEditing}}
        <div class='field'>
          <input
            name='system.conditions.actions.maxActions'
            class='gcs-input'
            type='number'
            value='{{system.conditions.actions.maxActions}}'
          />
        </div>
      {{else}}
        <div class='field' name='system.conditions.actions.maxActions'><span
          >{{system.conditions.actions.maxActions}}</span></div>
      {{/if}}
    </div>

    <div class='label-field-pair'>
      <div class='label'>{{localize 'GURPS.maxBlocksPerTurn'}}:</div>
      {{#if isEditing}}
        <div class='field'>
          <input
            name='system.conditions.actions.maxBlocks'
            class='gcs-input'
            type='number'
            value='{{system.conditions.actions.maxBlocks}}'
          />
        </div>
      {{else}}
        <div class='field' name='system.conditions.actions.maxBlocks'><span
          >{{system.conditions.actions.maxBlocks}}</span></div>
      {{/if}}
    </div>

    <div class='label-field-pair'>
      <div class='label'>{{localize 'GURPS.activeEffects'}}:</div>
      <div class='field' style='border: none;'>
        <button id='open-modifier-popup'><i class='fa-regular fa-sparkles'></i></button>
      </div>
    </div>

  </div>
</div>