<div class="tab info sheet-part {{#if @root.tabs.info.active}}active{{/if}}" data-group="sheet" data-tab="info">
  <div class="grid grid-2col">
    {{!-- Origine / Concept --}}
    <div>
      <h4>{{ localize 'IDENTITY.origin' }}</h4>
      <div class="group-field">
        {{#if isEditMode}}
        <input type="text" name="system.identity.origin" value="{{system.identity.origin}}" placeholder="Origine..." />
        {{else}}
        <span>{{system.identity.origin}}</span>
        {{/if}}
      </div>
    </div>

    <div>
      <h4>{{ localize 'IDENTITY.theme' }}</h4>
      <div class="group-field">
        {{#if isEditMode}}
        <input type="text" name="system.identity.theme" value="{{system.identity.theme}}" placeholder="Concept..." />
        {{else}}
        <span>{{system.identity.theme}}</span>
        {{/if}}
      </div>
    </div>

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

    {{!-- Objectifs --}}
    <div class="grid-span-2">
      <h4>{{ localize 'VERMINE.objectives' }}</h4>

      <h5>{{ localize 'VERMINE.major_objectives' }}</h5>
      <ol class="group-list">
        {{#each system.objectives.major as |objective id|}}
        <li class="item" data-index="{{id}}">
          <div class="item-name">
            {{#if @root.isEditMode}}
            <input type="text" name="system.objectives.major.{{id}}" value="{{objective}}"
                   placeholder="{{ localize 'VERMINE.major_objective_placeholder' }}" />
            {{else}}
            <span>{{objective}}</span>
            {{/if}}
          </div>
          <div class="item-controls">
            {{#if @root.isEditMode}}
            <a class="item-control objective-delete" data-action="deleteObjective" title="{{ localize 'UI.effect_delete' }}"
               data-type="major" data-index="{{id}}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
      {{#if isEditMode}}
      <a class="item-control item-create" data-action="addObjective" title="{{ localize 'UI.add' }}"
         data-type="major_objective"><i class="fas fa-plus"></i> {{ localize 'ITEMS.new_objective' }}</a>
      {{/if}}

      <h5>{{ localize 'VERMINE.minor_objectives' }}</h5>
      <ol class="group-list">
        {{#each system.objectives.minor as |objective id|}}
        <li class="item" data-index="{{id}}">
          <div class="item-name">
            {{#if @root.isEditMode}}
            <input type="text" name="system.objectives.minor.{{id}}" value="{{objective}}"
                   placeholder="{{ localize 'VERMINE.minor_objective_placeholder' }}" />
            {{else}}
            <span>{{objective}}</span>
            {{/if}}
          </div>
          <div class="item-controls">
            {{#if @root.isEditMode}}
            <a class="item-control objective-delete" data-action="deleteObjective" title="{{ localize 'UI.effect_delete' }}"
               data-type="minor" data-index="{{id}}"><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </li>
        {{/each}}
      </ol>
      {{#if isEditMode}}
      <a class="item-control item-create" data-action="addObjective" title="{{ localize 'UI.add' }}"
         data-type="minor_objective"><i class="fas fa-plus"></i> {{ localize 'ITEMS.new_objective' }}</a>
      {{/if}}
    </div>

    {{!-- Totem --}}
    <div class="grid-span-2">
      <h4>{{ localize 'IDENTITY.totem' }}</h4>
      <div class="group-field">
        {{#if (eq system.identity.totem "")}}
        <a data-action="chooseTotem" class="chooseTotem">{{ localize 'VERMINE.totem_picker' }}</a>
        {{else}}
        <div class="totem-display flexrow">
          <span>{{ smarttl "TOTEMS" system.identity.totem }}</span>
          <a data-action="chooseTotem" class="chooseTotem">{{ localize 'UI.effect_edit' }}</a>
        </div>
        <div class="totem-base grid grid-2col">
          <div class="item-name"><strong>{{ localize 'IDENTITY.instincts' }}</strong><br />{{ smarttl "TOTEMS" system.identity.totem "instincts" }}</div>
          <div class="item-name"><strong>{{ localize 'IDENTITY.prohibits' }}</strong><br />{{ smarttl "TOTEMS" system.identity.totem "bans" }}</div>
        </div>
        {{/if}}
      </div>
      <div class="group-field">
        <label>{{ localize 'IDENTITY.instincts' }}:</label>
        {{#if isEditMode}}
        <input type="text" name="system.identity.instincts" value="{{system.identity.instincts}}"
               placeholder="{{ localize 'VERMINE.instincts_placeholder' }}" />
        {{else}}
        <span>{{system.identity.instincts}}</span>
        {{/if}}
      </div>
      <div class="group-field">
        <label>{{ localize 'IDENTITY.prohibits' }}:</label>
        {{#if isEditMode}}
        <input type="text" name="system.identity.prohibits" value="{{system.identity.prohibits}}"
               placeholder="{{ localize 'VERMINE.prohibits_placeholder' }}" />
        {{else}}
        <span>{{system.identity.prohibits}}</span>
        {{/if}}
      </div>
    </div>

    {{!-- Capacités de groupe --}}
    <div class="grid-span-2">
      <h4>{{ localize 'VERMINE.group_abilities' }}{{#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="group-list">
        {{#each abilities as |item id|}}
        {{#if (ne item.system.type 'totem')}}
        <li class="item" data-item-id="{{item._id}}">
          <div class="item-name">
            <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">
            {{#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>

    {{!-- Capacités de totem --}}
    <div class="grid-span-2">
      <h4>{{ localize 'VERMINE.totem_abilities' }}{{#if isEditMode}}<a class="item-control item-create" data-action="createTotemAbility" title="{{ localize 'ITEMS.new_ability' }}"><i class="fas fa-plus"></i></a>{{/if}}</h4>
      <ol class="group-list">
        {{#each totem_abilities as |item id|}}
        <li class="item" data-item-id="{{item._id}}">
          <div class="item-name">
            <a class="item-control item-edit" data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'UI.effect_edit' }}">{{item.name}}</a>
            <span class="hexa" title="{{ localize 'VERMINE.level' }}">{{item.system.level.value}}</span>
            <span title="{{ localize 'VERMINE.learning' }}">{{item.system.learn.threshold}}{{#ifgt item.system.learn.hindrance 0}}/{{ roman item.system.learn.hindrance }}{{/ifgt}}</span>
          </div>
          <div class="item-controls">
            {{#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>
