<form class="{{cssClass}} {{actor.type}} flexcol" autocomplete="off">

    {{!-- Sheet Header --}}
    <header class="sheet-header">

        <input class="sheet-name" type="text" name="actor.name" value="{{actor.name}}"/>

    </header>

    {{!-- Sheet Tab Navigation --}}
    <nav class="sheet-tabs tabs" data-group="primary">
        <a class="item" data-tab="characters">Charaktere</a>
        <a class="item" data-tab="inventory">Inventar</a>
        {{#if owner}}<a class="item" data-tab="settings">Sichtbarkeiten</a>{{/if}}
    </nav>

    {{!-- Sheet Body --}}
    <section class="sheet-body">
        <div class="tab characters" data-group="primary" data-tab="characters">
            {{#unless isGM}}
                <div class="characters-overview minimal">
                    {{#each characters}}
                        {{#if this.isVisible}}
                            <div class="character">
                                <div class="header clickable" data-id="{{this.id}}" data-operation="openActorSheet">
                                    <img class="profile-img" src="{{this.img}}" style="object-fit: cover;"
                                         title="{{this.name}}" alt="{{this.name}}"/>
                                    <span class="name">{{this.name}}</span>
                                </div>
                            </div>
                        {{/if}}
                    {{/each}}
                </div>
            {{else}}
                <div class="characters-overview">
                    <table>
                        <thead>
                        <tr>
                            <th></th>
                            {{#each this.fields.head}}
                                <th>
                                    <div class="character">
                                        <div class="header clickable" data-id="{{this.id}}"
                                             data-operation="openActorSheet">
                                            <img class="profile-img" src="{{this.img}}" style="object-fit: cover;"
                                                 title="{{this.name}}" alt="{{this.name}}"/>
                                            <span class="name">{{this.name}}</span>
                                        </div>
                                {{#if this.isLimited}}
                                    <div class="mini-attributes">
                                        {{#each this.attributes}}
                                            <div class="mini-attribute" data-actor-id="{{actor.id}}"
                                                 data-attribute="{{this.name}}" data-roll-data="{{this.value}}">
                                                <span class="value">{{this.value}}</span>
                                                <span class="name">{{this.name}}</span>
                                            </div>
                                        {{/each}}
                                    </div>
                                {{/if}}
                                    </div>
                                </th>
                            {{/each}}
                        </tr>
                        </thead>
                        <tbody>
                        {{#each this.fields}}
                            {{#unless (eq @key "head")}}
                                <tr>
                                    <th>
                                        {{ @key}}
                                    </th>

                                    {{#each this}}
                                        <td>
                                            {{#if (eq this "-")}}

                                            {{else}}
                                                {{#if this.taw}}
                                                    <div class="rollable" data-actor-id="{{this.actor}}"
                                                         data-taw="{{this.taw}}"
                                                         data-name="{{this.name}}"
                                                         data-eigenschaft1="{{this.eigenschaft1}}"
                                                         data-eigenschaft2="{{this.eigenschaft2}}"
                                                         data-eigenschaft3="{{this.eigenschaft3}}"
                                                         data-rollEigenschaft1="{{this.rollEigenschaft1}}"
                                                         data-rollEigenschaft2="{{this.rollEigenschaft2}}"
                                                         data-rollEigenschaft3="{{this.rollEigenschaft3}}">
                                                        {{this.taw}} ({{this.eigenschaft1}}, {{this.eigenschaft2}}
                                                        , {{this.eigenschaft3}})
                                                    </div>
                                                {{else}}
                                                    Ja
                                                {{/if}}
                                            {{/if}}
                                        </td>
                                    {{/each}}

                                </tr>
                            {{/unless}}
                        {{/each}}
                        </tbody>
                    </table>
                </div>
            {{/unless}}
        </div>
        <div class="tab inventory" data-group="primary" data-tab="inventory">
            {{> 'systems/DSA_4-1/templates/ui/partial-equipment-group-button.hbs' equipments}}
        </div>
        {{#if owner}}
            <div class="tab settings" data-group="primary" data-tab="settings">
                {{#each settings}}
                    <div>
                        <label><input name="system.settings.{{@key}}" type="checkbox" {{checked this}}> {{@key}}</label>
                    </div>
                {{/each}}
            </div>
        {{/if}}

    </section>

</form>
