<section class="tab character-biography {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">

  <fieldset>
    <legend>{{localize "AWEMMY.Character.Identity"}}</legend>
    <div class="form-group">
      <label>{{localize "AWEMMY.Character.Pronouns"}}</label>
      {{formInput systemFields.pronouns value=system.pronouns disabled=isPlayMode}}
    </div>
    <div class="form-group">
      <label>{{localize "AWEMMY.Character.Specialization"}}</label>
      {{formInput systemFields.specialization value=system.specialization disabled=isPlayMode}}
    </div>
  </fieldset>

  <!-- Field (max 1) -->
  <fieldset class="items-list-fieldset">
    <legend>{{localize "AWEMMY.Item.Field"}}</legend>
    {{#each fields}}
    <div class="item-row" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-drag="true">
      <img src="{{img}}" class="item-img" alt="{{name}}" />
      <span class="item-name">{{name}}</span>
      <span class="item-key-attr">
        <a class="rollable field-roll" data-action="rollField" data-attribute-id="{{system.keyAttribute}}" data-tooltip="Roll {{keyAttrLabel}}">
          <i class="fas fa-dice-d20"></i> {{keyAttrLabel}}
        </a>
        {{#if keyAttr2Label}}
        / <a class="rollable field-roll" data-action="rollField" data-attribute-id="{{system.keyAttribute2}}" data-tooltip="Roll {{keyAttr2Label}}">
          {{keyAttr2Label}}
        </a>
        {{/if}}
      </span>
      <div class="item-controls">
        <a class="item-control" data-action="edit" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Edit"><i class="fas fa-edit"></i></a>
        <a class="item-control" data-action="delete" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Delete"><i class="fas fa-trash"></i></a>
      </div>
    </div>
    {{/each}}
    {{#unless fields.length}}<div class="item-row item-empty"><em>{{localize "AWEMMY.Character.DropField"}}</em></div>{{/unless}}
  </fieldset>

  <!-- Specialization (max 1, rattachée à un Field par nom) -->
  <fieldset class="items-list-fieldset">
    <legend>{{localize "AWEMMY.Item.Specialization"}}</legend>
    {{#each specializations}}
    <div class="item-row" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-drag="true">
      <img src="{{img}}" class="item-img" alt="{{name}}" />
      <span class="item-name">{{name}}</span>
      {{#if system.fieldName}}
      <span class="item-field-link {{#unless fieldMatch}}no-match{{/unless}}" data-tooltip="{{system.fieldName}}">
        <i class="fas fa-link"></i> {{system.fieldName}}
        {{#unless fieldMatch}}<i class="fas fa-exclamation-triangle"></i>{{/unless}}
      </span>
      {{/if}}
      {{#if attrOverrideLabel}}
      <span class="item-key-attr">
        <i class="fas fa-arrow-right"></i> {{attrOverrideLabel}}
      </span>
      {{/if}}
      <div class="item-controls">
        <a class="item-control" data-action="edit" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Edit"><i class="fas fa-edit"></i></a>
        <a class="item-control" data-action="delete" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Delete"><i class="fas fa-trash"></i></a>
      </div>
    </div>
    {{/each}}
    {{#unless specializations.length}}<div class="item-row item-empty"><em>{{localize "AWEMMY.Character.DropSpecialization"}}</em></div>{{/unless}}
  </fieldset>

  <!-- Archetypes (multiple) -->
  <fieldset class="items-list-fieldset">
    <legend>{{localize "AWEMMY.Item.Archetype"}}</legend>
    {{#each archetypes}}
    <div class="item-row" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-drag="true">
      <img src="{{img}}" class="item-img" alt="{{name}}" />
      <span class="item-name">{{name}}</span>
      <div class="item-controls">
        <a class="item-control" data-action="edit" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Edit"><i class="fas fa-edit"></i></a>
        <a class="item-control" data-action="delete" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Delete"><i class="fas fa-trash"></i></a>
      </div>
    </div>
    {{/each}}
    {{#unless archetypes.length}}<div class="item-row item-empty"><em>{{localize "AWEMMY.Character.DropArchetype"}}</em></div>{{/unless}}
  </fieldset>

  <!-- Background (max 1) -->
  <fieldset class="items-list-fieldset">
    <legend>{{localize "AWEMMY.Item.Background"}}</legend>
    {{#each backgrounds}}
    <div class="item-row" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-drag="true">
      <img src="{{img}}" class="item-img" alt="{{name}}" />
      <span class="item-name">{{name}}</span>
      <div class="item-controls">
        <a class="item-control" data-action="edit" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Edit"><i class="fas fa-edit"></i></a>
        <a class="item-control" data-action="delete" data-item-id="{{id}}" data-item-uuid="{{uuid}}" data-tooltip="Delete"><i class="fas fa-trash"></i></a>
      </div>
    </div>
    {{/each}}
    {{#unless backgrounds.length}}<div class="item-row item-empty"><em>{{localize "AWEMMY.Character.DropBackground"}}</em></div>{{/unless}}
  </fieldset>

  <fieldset>
    <legend>{{localize "AWEMMY.Character.Description"}}</legend>
    {{formInput
      systemFields.description
      enriched=enrichedDescription
      value=system.description
      name="system.description"
      toggled=true
    }}
  </fieldset>

  <fieldset>
    <legend>{{localize "AWEMMY.Character.Notes"}}</legend>
    {{formInput
      systemFields.notes
      enriched=enrichedNotes
      value=system.notes
      name="system.notes"
      toggled=true
    }}
  </fieldset>

</section>

