<div class="{{cssClass}}" data-actor-id="{{data._id}}">
    <header class="card-header">
        <h2 class="item-name">
            {{data.name}}
        </h2>
    </header>
    <section class="sheet-body">
        {{#if data.img}}<p><img src="{{data.img}}" title="{{data.name}}" /></p>{{/if}}

        {{!-- Sheet Header --}}
        <ul>
            {{!-- Identity --}}
            <li>{{#ifCond data.data.template '==' 'pow'}}{{localize 'l5r5e.sheets.region'}}{{else}}{{localize 'l5r5e.clans.label'}}{{/ifCond}} : {{data.data.identity.clan}}</li>
            <li>{{#ifCond data.data.template '==' 'pow'}}{{localize 'l5r5e.sheets.upbringing'}}{{else}}{{localize 'l5r5e.sheets.family'}}{{/ifCond}} : {{data.data.identity.family}}</li>
            <li>{{localize 'l5r5e.sheets.rank'}}  : {{data.data.identity.school_rank}}</li>
            <li>{{localize 'l5r5e.sheets.school'}} : {{data.data.identity.school}}</li>
            <li>{{localize 'l5r5e.roles'}} : {{data.data.identity.roles}}</li>

            {{!-- Social --}}
            <li>{{localize 'l5r5e.social.honor'}} : {{data.data.social.honor}}</li>
            <li>{{localize 'l5r5e.social.glory'}} : {{data.data.social.glory}}</li>
            <li>{{localize 'l5r5e.social.status'}} : {{data.data.social.status}}</li>

            {{!-- Rings --}}
            <li>{{localize 'l5r5e.rings.earth'}} : {{data.data.rings.earth}}</li>
            <li>{{localize 'l5r5e.rings.air'}} : {{data.data.rings.air}}</li>
            <li>{{localize 'l5r5e.rings.water'}} : {{data.data.rings.water}}</li>
            <li>{{localize 'l5r5e.rings.fire'}} : {{data.data.rings.fire}}</li>
            <li>{{localize 'l5r5e.rings.void'}} : {{data.data.rings.void}}</li>

            {{!-- Attributes --}}
            <li>{{localize 'l5r5e.attributes.endurance'}} : {{data.data.endurance}}</li>
            <li>{{localize 'l5r5e.attributes.composure'}} : {{data.data.composure}}</li>
            <li>{{localize 'l5r5e.attributes.focus'}} : {{data.data.focus}}</li>
            <li>{{localize 'l5r5e.attributes.vigilance'}} : {{data.data.vigilance}}</li>
            <li>{{localize 'l5r5e.attributes.voidpoints'}} : {{data.data.void_points.max}}</li>

            {{!-- Narrative : Social --}}
            <li>{{localize 'l5r5e.social.ninjo'}} : {{data.data.social.ninjo}}</li>
            <li>{{#ifCond data.data.template '==' 'pow'}}{{localize 'l5r5e.social.past'}}{{else}}{{localize 'l5r5e.social.giri'}}{{/ifCond}} : {{data.data.social.giri}}</li>
            <li>{{localize 'l5r5e.social.bushido_tenets.paramount'}} : {{data.data.social.bushido_tenets.paramount}}</li>
            <li>{{localize 'l5r5e.social.bushido_tenets.less_significant'}} : {{data.data.social.bushido_tenets.less_significant}}</li>
            <li>{{localize 'l5r5e.sheets.description' }} : {{{data.data.description}}}</li>
            <li>{{localize 'l5r5e.sheets.notes' }} : {{{data.data.notes}}}</li>
        </ul>

{{!-- a faire : Spé Skill/Ecoles pour les pnj --}}
        {{!-- Skills Tab : Skills --}}
        <h2>{{localize 'l5r5e.skills.title'}}</h2>
        <ul>
            {{#each data.data.skills as |category categoryId|}}
                <li>
                    <strong>{{localizeSkill categoryId 'title'}}</strong>
                    <ul>
                    {{#each category as |skillValue skillId|}}
                        <li>{{localizeSkill categoryId skillId}} : {{skillValue}}</li>
                    {{/each}}
                    </ul>
                </li>
            {{/each}}
        </ul>

        {{!-- Skills Tab : Techniques --}}
        <h2>{{localize 'l5r5e.techniques.title'}}</h2>
        <ul>
            {{#each data.splitTechniquesList as |list techName|}}
                <li>
                    <strong>{{localize (localize 'l5r5e.techniques.{techName}' techName=techName) }}</strong>
                    <ul>
                    {{#each list as |technique|}}
                        <li>
                            {{#ifCond techName '==' 'title_ability'}}
                                {{> 'systems/l5r5e/templates/items/title/title-text.html' data=technique editable=../../options.editable}}
                            {{else}}
                                {{> 'systems/l5r5e/templates/items/technique/technique-text.html' data=technique editable=../../options.editable}}
                            {{/ifCond}}
                        </li>
                    {{/each}}
                    </ul>
                </li>
            {{/each}}
        </ul>

        {{!-- Skills Tab : Signature Scrolls --}}
        <h2>{{localize 'l5r5e.advancements.signature_scroll' }}</h2>
        <ul>
            {{#each actor.items as |scroll|}}
                {{#ifCond scroll.data.type '==' 'signature_scroll'}}
                    <li>{{> 'systems/l5r5e/templates/items/signature-scroll/signature-scroll-text.html' data=scroll.data editable=../options.editable}}</li>
                {{/ifCond}}
            {{/each}}
        </ul>


         {{!-- Narrative : Advantages --}}
         <h2>{{localize 'l5r5e.social.advantages'}}</h2>
        <ul>
        {{#each data.items as |item|}}
            {{#ifCond '["distinction","passion"]' 'includes' item.data.peculiarity_type}}
                <li>{{> 'systems/l5r5e/templates/items/peculiarity/peculiarity-text.html' data=item editable=../options.editable}}</li>
            {{/ifCond}}
        {{/each}}
        </ul>

        {{!-- Narrative : Disadvantages --}}
        <h2>{{localize 'l5r5e.social.disadvantages'}}</h2>
        <ul>
        {{#each data.items as |item|}}
            {{#ifCond '["adversity","anxiety"]' 'includes' item.data.peculiarity_type}}
                <li>{{> 'systems/l5r5e/templates/items/peculiarity/peculiarity-text.html' data=item editable=../options.editable}}</li>
            {{/ifCond}}
        {{/each}}
        </ul>

        {{!-- Narrative : Bonds --}}
        <h2>{{localize 'l5r5e.social.bonds'}}</h2>
        <ul>
        {{#each data.items as |bond|}}
            {{#ifCond bond.type '==' 'bond'}}
                <li>{{> 'systems/l5r5e/templates/items/bond/bond-text.html' data=bond editable=../options.editable}}</li>
            {{/ifCond}}
        {{/each}}
        </ul>


        {{!-- Inventory Tab --}}
        {{!-- items list --}}
        <h2>{{localize 'l5r5e.sheets.equipment'}}</h2>
        <ul>
            <li>{{localize 'l5r5e.money.title'}} : {{data.data.money.koku}} {{localize 'l5r5e.money.koku'}} / {{data.data.money.bu}} {{localize 'l5r5e.money.bu'}} / {{data.data.money.zeni}} {{localize 'l5r5e.money.zeni'}}</li>
            {{#each data.splitItemsList as |cat type|}}
                <li>
                    <strong>{{localize (localize 'l5r5e.{type}s.title' type=type)}} ({{cat.length}})</strong>
                    <ul>
                    {{#each cat as |item|}}
                        <li>{{> 'systems/l5r5e/templates/items/item/item-text.html' data=item editable=../../options.editable}}</li>
                    {{/each}}
                    </ul>
                </li>
            {{/each}}
        </ul>

        {{!-- item patterns list --}}
        <h2>{{localize 'l5r5e.advancements.item_pattern'}}</h2>
        <ul>
        {{#each actor.items as |pattern|}}
            {{#ifCond pattern.data.type '==' 'item_pattern'}}

{{!-- json pattern.data --}}
{{!-- voir pkoi : data.linkedProperty.name --}}

                <li>{{> 'systems/l5r5e/templates/items/item-pattern/item-pattern-text.html' data=pattern.data editable=../options.editable}}</li>
            {{/ifCond}}
        {{/each}}
        </ul>


        {{!-- Experience Tab --}}
        <h2>{{localize 'l5r5e.sheets.experience'}}</h2>
        <ul>
            <li>{{localize 'l5r5e.advancements.total'}} : {{data.data.xp_total}}</li>
            <li>{{localize 'l5r5e.advancements.spent'}} : {{data.data.xp_spent}}</li>
            <li>{{localize 'l5r5e.advancements.saved'}} : {{data.data.xp_saved}}</li>
        </ul>

        {{!-- School progression --}}
        <h2>{{#if data.data.identity.school_curriculum_journal.name}}{{data.data.identity.school_curriculum_journal.name}}{{else}}{{localize 'l5r5e.sheets.school'}}{{/if}}</h2>
        <table>
            <tr>
                <th>{{localize 'l5r5e.sheets.name'}}</th>
                <th>{{localize 'l5r5e.sheets.school'}}</th>
                <th>{{localize 'l5r5e.advancements.spent'}}</th>
                <th>{{localize 'l5r5e.sheets.rank'}}</th>
            </tr>
            {{#each data.advancementsListByRank as |rankObject|}}
                <tr><th colspan="4">{{localize 'l5r5e.sheets.rank'}} {{rankObject.rank}}</th></tr>
                {{#each rankObject.list as |advancement|}}
                <tr>
                    <td>{{advancement.name}}</td>
                    <td>{{#if advancement.data.in_curriculum}}✓</i>{{/if}}</td>
                    <td>{{advancement.data.xp_used}}</td>
                    <td>{{advancement.data.rank}}</td>
                </tr>
                {{/each}}
            {{/each}}
        </table>

        {{!-- Others progression (does not count in school xp) --}}
        {{#if data.advancementsOthers}}
        <h2>{{localize 'l5r5e.advancements.title'}}</h2>
        <table>
            <tr>
                <th>{{localize 'l5r5e.sheets.name'}}</th>
                <th>{{localize 'l5r5e.advancements.spent'}}</th>
                <th>{{localize 'l5r5e.sheets.rank'}}</th>
            </tr>
            {{#each data.advancementsOthers as |advancement|}}
                <tr>
                    <td>{{advancement.name}}</td>
                    <td>{{advancement.data.xp_used}}</td>
                    <td>{{advancement.data.rank}}</td>
                </tr>
            {{/each}}
        </table>
        {{/if}}


        {{!-- 20Q --}}
        {{#ifCond data.data.twenty_questions.template '==' 'pow'}}
            {{setVar "suffix" "pow"}}
        {{else}}
            {{setVar "suffix" ""}}
        {{/ifCond}}
        <h2>{{localize 'l5r5e.twenty_questions.title'}}</h2>
        <ul>
            <li>{{localize (localize 'l5r5e.twenty_questions.part2.q4{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step4.stand_out}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part3.q7{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step7.clan_relations}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part3.q8{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step8.bushido}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part4.q9{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step9.success}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part4.q10{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step10.difficulty}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part4.q11{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step11.calms}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part4.q12{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step12.worries}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part4.q13{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step13.most_learn}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part5.q14{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step14.first_sight}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part5.q15{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step15.stress}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part5.q16{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step16.relations}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part6.q17{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step17.parents_pov}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part6.q18{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step18.heritage_name}}</li>
            <li>{{localize (localize 'l5r5e.twenty_questions.part7.q20{suffix}' suffix=suffix)}} : {{data.data.twenty_questions.step20.death}}</li>
        </ul>

    </section>
</div>
