{{!-- ===================== ARTS MARTIAUX ===================== --}}

<div class="cde-kf-add-row">
  <a class="cde-kf-add-btn" data-action="create" data-type="kungfu" title="{{ localize 'CDE.KFCreate' }}">
    <i class="fas fa-plus"></i> {{ localize "CDE.KFCreate" }}
  </a>
</div>

{{#if kungfus.length}}
{{#each kungfus as |item|}}
<div class="cde-kf-card cde-kf--{{item.system.aspect}}">

  <div class="cde-kf-header">
    <img class="cde-kf-aspect-icon" src="{{ getElementIcon item.system.aspect }}" alt="{{item.system.aspect}}" />
    <img class="cde-kf-orient-icon" src="{{ getOrientationIcon item.system.orientation }}" alt="{{item.system.orientation}}"
         title="{{ getOrientationLabel item.system.orientation }}" />
    <div class="cde-kf-info">
      <span class="cde-kf-name">{{item.name}}</span>
      <span class="cde-kf-meta">
        {{#if (eq item.system.skill "rangedcombat")}}{{ localize "CDE.RangedCombat" }}{{else}}{{ localize "CDE.SkillKungfu" }}{{/if}}
        {{#if item.system.speciality}}&middot; <em>{{item.system.speciality}}</em>{{/if}}
      </span>
    </div>
    <a class="cde-roll-trigger cde-kf-roll-btn" data-libel-id="{{item._id}}-itemkungfu"
       title="{{ localize 'CDE.Roll' }} {{item.name}}">
      <i class="fas fa-dice-d10"></i>
    </a>
    <div class="cde-kf-controls">
      <a data-action="edit" data-item-id="{{item._id}}" title="{{ localize 'CDE.KFEdit' }}"><i class="fas fa-edit"></i></a>
      <a data-action="delete" data-item-id="{{item._id}}" title="{{ localize 'CDE.KFDelete' }}"><i class="fas fa-trash"></i></a>
    </div>
  </div>

  {{!-- Style --}}
  {{#if item.system.style}}
  <div class="cde-kf-style-row">
    <span class="cde-kf-style-label"><i class="fas fa-star"></i> {{ localize "CDE.Style" }}</span>
    <span class="cde-kf-style-text">{{item.system.style}}</span>
  </div>
  {{/if}}

  {{!-- Techniques --}}
  <ul class="cde-kf-techniques">
    {{#with item.system.techniques.technique1 as |tech|}}
    {{#if tech.name}}
    <li class="cde-kf-tech {{#if tech.check}}cde-kf-tech--mastered{{/if}}">
      <span class="cde-kf-tech-mastered" title="{{ localize 'CDE.Masterized' }}">
        {{#if tech.check}}<i class="fas fa-check-circle"></i>{{else}}<i class="far fa-circle"></i>{{/if}}
      </span>
      <span class="cde-act-badge cde-act--{{tech.activation}}" title="{{ getActivationLabel tech.activation }}">{{ getActivationLabel tech.activation }}</span>
      <span class="cde-kf-tech-name">{{#if tech.name}}{{tech.name}}{{else}}<em>—</em>{{/if}}</span>
    </li>
    {{/if}}
    {{/with}}
    {{#with item.system.techniques.technique2 as |tech|}}
    {{#if tech.name}}
    <li class="cde-kf-tech {{#if tech.check}}cde-kf-tech--mastered{{/if}}">
      <span class="cde-kf-tech-mastered" title="{{ localize 'CDE.Masterized' }}">
        {{#if tech.check}}<i class="fas fa-check-circle"></i>{{else}}<i class="far fa-circle"></i>{{/if}}
      </span>
      <span class="cde-act-badge cde-act--{{tech.activation}}" title="{{ getActivationLabel tech.activation }}">{{ getActivationLabel tech.activation }}</span>
      <span class="cde-kf-tech-name">{{#if tech.name}}{{tech.name}}{{else}}<em>—</em>{{/if}}</span>
    </li>
    {{/if}}
    {{/with}}
    {{#with item.system.techniques.technique3 as |tech|}}
    {{#if tech.name}}
    <li class="cde-kf-tech {{#if tech.check}}cde-kf-tech--mastered{{/if}}">
      <span class="cde-kf-tech-mastered" title="{{ localize 'CDE.Masterized' }}">
        {{#if tech.check}}<i class="fas fa-check-circle"></i>{{else}}<i class="far fa-circle"></i>{{/if}}
      </span>
      <span class="cde-act-badge cde-act--{{tech.activation}}" title="{{ getActivationLabel tech.activation }}">{{ getActivationLabel tech.activation }}</span>
      <span class="cde-kf-tech-name">{{#if tech.name}}{{tech.name}}{{else}}<em>—</em>{{/if}}</span>
    </li>
    {{/if}}
    {{/with}}
  </ul>

</div>
{{/each}}
{{else}}
<p class="cde-kf-empty">{{ localize "CDE.KFEmpty" }}</p>
{{/if}}
