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

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

        <img src="{{actor.img}}" data-edit="img" title="{{actor.name}}"/>
        <input type="text" name="name" value="{{actor.name}}" placeholder="Name"/>

    </header>

    {{!-- Sheet Tab Navigation --}}
    <nav class="sheet-tabs tabs" style="flex: 0" data-group="primary">
        <a class="item" data-tab="meta">Kopfdaten</a>
        <a class="item" data-tab="attacks">Attacken</a>
        <a class="item" data-tab="description">Beschreibung</a>
    </nav>

    {{!-- Sheet Body --}}
    <section class="sheet-body" style="flex: 1">

        <div class="tab meta" data-group="primary" data-tab="meta">
            <div>
                <div class="input">
                    <label for="system.lep.aktuell">Lebenspunkte</label>
                    <input type="text" name="system.lep.aktuell"
                           value="{{actor.system.lep.aktuell}}"/>
                </div>
                <div class="input">
                    <label for="system.rs">Rüstungsschutz</label>
                    <input type="text" name="system.rs"
                           value="{{actor.system.rs}}"/>
                </div>
                <div class="input">
                    <label for="system.mr">Magieresistenz</label>
                    <input type="text" name="system.mr"
                           value="{{actor.system.mr}}"/>

                </div>
                <div class="input compound">
                    <label>Initiative</label>
                    <div class="inline-label">
                        <input type="number" name="system.ini.wuerfel"
                               value="{{actor.system.ini.wuerfel}}"/>
                        <span class="inline">w6 + </span>
                    </div>
                    <input type="number" name="system.ini.aktuell"
                           value="{{actor.system.ini.aktuell}}"/>

                </div>
            </div>
        </div>
        <div class="tab attacks" data-group="primary" data-tab="attacks">

            <table class="attacks-table">
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Attacke</th>
                    <th>Parade</th>
                    <th>Schaden</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                {{#each this.attacks}}
                    <tr>
                        <td>
                            <input type="text" name="{{this.namepath}}"
                                   value="{{this.name}}"/>
                        </td>
                        <td class="rollable tablecell">
                            <div class="attacks-die die rollable attack" data-actor="{{actor.name}}"
                                 data-roll-type="attack" data-roll-name="{{this.name}}" data-roll="1d20<{{this.at}}cs">
                                {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
                            </div>
                            <input type="text" name="{{this.atpath}}"
                                   value="{{this.at}}"/>
                        </td>
                        <td class="rollable tablecell">
                            <div class="attacks-die die" data-roll-type="parry" data-roll-name="{{this.name}}"
                                 data-roll="1d20 + {{this.pa}}">
                                {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
                            </div>
                            <input type="text" name="{{this.papath}}"
                                   value="{{this.pa}}"/>
                        </td>
                        <td class="rollable tablecell">
                            <div class="attacks-die die" data-roll-type="damage" data-roll-name="{{this.name}}"
                                 data-roll="{{this.tp}}">
                                {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
                            </div>
                            <input type="text" name="{{this.tppath}}"
                                   value="{{this.tp}}"/>
                        </td>
                        <td>
                            <button class="button-inline remove-attack" data-index="{{this.index}}"><i
                                    class="fa-solid fa-trash"></i></button>
                        </td>
                    </tr>
                {{/each}}
                </tbody>
                <tfoot class="editor">
                <tr>
                    <th colspan="5">Attacke hinzufügen</th>
                </tr>
                <tr>

                    <td>
                        <input type="text" id="attack_name"/>
                    </td>

                    <td>
                        <input type="text" id="attack_at" placeholder="8"/>
                    </td>
                    <td>
                        <input type="text" id="attack_pa" placeholer="12"/>
                    </td>
                    <td>

                        <input type="text" id="attack_tp" placeholder="1d6+3"/>
                    </td>
                    <td>
                        <button class="button-inline add-attack"><i class="fa-solid fa-plus"></i></button>
                    </td>

                </tr>
                </tfoot>
            </table>

        </div>
        <div class="tab description" data-group="primary" data-tab="description">
            {{editor system.description target="system.description" button=true owner=owner editable=editable}}

        </div>
    </section>
</form>
