<div class="tab info sheet-part" data-group="sheet" data-tab="info">
  <div class="grid grid-2col">
    {{!-- Group Identity --}}

    <div>
      <h4>{{ localize 'IDENTITY.origin' }}</h4>
      <div class="flexrow flex-group-center">
        {{#if isEditMode}}
        <input type="text" name="system.identity.origin" value="{{system.identity.origin}}"
               placeholder="Origine..." style="flex: 1;" />
        {{else}}
        <span>{{system.identity.origin}}</span>
        {{/if}}
      </div>
    </div>

    <div>
      <h4>{{ localize 'IDENTITY.theme' }}</h4>
      <div class="flexrow flex-group-center">
        {{#if isEditMode}}
        <input type="text" name="system.identity.theme" value="{{system.identity.theme}}"
               placeholder="Concept..." style="flex: 1;" />
        {{else}}
        <span>{{system.identity.theme}}</span>
        {{/if}}
      </div>
    </div>

    {{!-- Group Notes --}}
    <div class="grid-span-2">
      <fieldset>
        <legend><h4>{{ localize 'IDENTITY.notes' }}</h4></legend>
        {{formInput systemFields.identity.fields.notes enriched=enrichedNotes value=system.identity.notes name="system.identity.notes" toggled=true}}
      </fieldset>
    </div>

    {{!-- Group Abilities (from items) --}}
    <div class="grid-span-2">
      <h4>
        <span>{{ localize 'VERMINE.abilities' }}</span>
        {{#if isEditMode}}
        <a class="item-control item-create" data-action="create" data-type="ability" title="{{ localize 'ITEMS.new_ability' }}"><i class="fas fa-plus"></i></a>
        {{/if}}
      </h4>
      <ol class="list-item">
        {{#each abilities as |item id|}}
        {{#if (ne item.type 'totem')}}
        <li class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name" style="flex:4;">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
          </div>
          <div class="item-controls flexrow">
            {{#if @root.isEditMode}}
            <a class="item-control item-delete" data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_delete' }}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/if}}
        {{/each}}
      </ol>
    </div>

    {{!-- Specialties --}}
    <div>
      <h4>
        <span>{{ localize 'ITEMS.specialties' }}</span>
        {{#if isEditMode}}
        <a class="item-control item-create" data-action="create" data-type="specialty" title="{{ localize 'ITEMS.new_specialty' }}"><i class="fas fa-plus"></i></a>
        {{/if}}
      </h4>
      <ol class="list-item">
        {{#each specialties as |item id|}}
        <li class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name" style="flex:4;">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
          </div>
          <div class="item-controls flexrow">
            {{#if @root.isEditMode}}
            <a class="item-control item-delete" data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_delete' }}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
    </div>

    {{!-- Backgrounds --}}
    <div>
      <h4>
        <span>{{ localize 'ITEMS.backgrounds' }}</span>
        {{#if isEditMode}}
        <a class="item-control item-create" data-action="create" data-type="background" title="{{ localize 'ITEMS.new_background' }}"><i class="fas fa-plus"></i></a>
        {{/if}}
      </h4>
      <ol class="list-item">
        {{#each backgrounds as |item id|}}
        <li class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name" style="flex:4;">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
          </div>
          <div class="item-controls flexrow">
            {{#if @root.isEditMode}}
            <a class="item-control item-delete" data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_delete' }}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
    </div>

    {{!-- Traumas --}}
    <div>
      <h4>
        <span>{{ localize 'ITEMS.traumas' }}</span>
        {{#if isEditMode}}
        <a class="item-control item-create" data-action="create" data-type="trauma" title="{{ localize 'ITEMS.new_trauma' }}"><i class="fas fa-plus"></i></a>
        {{/if}}
      </h4>
      <ol class="list-item">
        {{#each traumas as |item id|}}
        <li class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name" style="flex:4;">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
          </div>
          <div class="item-controls flexrow">
            {{#if @root.isEditMode}}
            <a class="item-control item-delete" data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_delete' }}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
    </div>

    {{!-- Evolutions --}}
    <div>
      <h4>
        <span>{{ localize 'ITEMS.evolutions' }}</span>
        {{#if isEditMode}}
        <a class="item-control item-create" data-action="create" data-type="evolution" title="{{ localize 'ITEMS.new_evolution' }}"><i class="fas fa-plus"></i></a>
        {{/if}}
      </h4>
      <ol class="list-item">
        {{#each evolutions as |item id|}}
        <li class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name" style="flex:4;">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
          </div>
          <div class="item-controls flexrow">
            {{#if @root.isEditMode}}
            <a class="item-control item-delete" data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_delete' }}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
    </div>
  </div>
</div>
