{{!-- Action Type --}}
<div class="form-group select">
    <label>{{ localize "SW5E.ItemActionType" }}</label>
    <select name="data.actionType">
        {{#select data.actionType}}
        <option value=""></option>
        {{#each config.itemActionTypes as |name type|}}
        <option value="{{type}}">{{name}}</option>
        {{/each}}
        {{/select}}
    </select>
</div>
{{#if data.actionType}}

{{!-- Ability Modifier --}}
<div class="form-group select">
    <label>{{ localize "SW5E.AbilityModifier" }}</label>
    <select name="data.ability">
        {{#select data.ability}}
        <option value="">{{ localize "SW5E.Default" }}</option>
        {{#each config.abilities as |ability a|}}
        <option value="{{a}}">{{ability}}</option>
        {{/each}}
        {{/select}}
    </select>
</div>

{{!-- Attack Roll Bonus --}}
{{#if hasAttackRoll }}
<div class="form-group">
    <label>{{ localize "SW5E.ItemAttackBonus" }}</label>
    <div class="form-fields">
        <input type="text" name="data.attackBonus" value="{{data.attackBonus}}"/>
    </div>
</div>
{{/if}}

{{!-- Damage Formula --}}
<h4 class="damage-header">
    {{#unless isHealing }}{{ localize "SW5E.Damage" }}{{ else }}{{ localize "SW5E.Healing" }}{{/unless}} {{ localize "SW5E.Formula" }}
    <a class="damage-control add-damage"><i class="fas fa-plus"></i></a>
</h4>
<ol class="damage-parts form-group">
    {{#each data.damage.parts as |part i| }}
    <li class="damage-part flexrow" data-damage-part="{{i}}">
        <input type="text" name="data.damage.parts.{{i}}.0" value="{{lookup this "0"}}"/>
        <select name="data.damage.parts.{{i}}.1">
            {{#select (lookup this "1") }}
            <option value="">{{ localize "SW5E.None" }}</option>
            {{#each ../config.damageTypes as |name type|}}
            <option value="{{type}}">{{name}}</option>
            {{/each}}
            {{#each ../config.healingTypes as |name type|}}
            <option value="{{type}}">{{name}}</option>
            {{/each}}
            {{/select}}
        </select>
        <a class="damage-control delete-damage"><i class="fas fa-minus"></i></a>
    </li>
    {{/each}}
</ol>

{{!-- Versatile Damage --}}
{{#if data.damage.parts.length }}
<div class="form-group">
    <label>{{ localize "SW5E.VersatileDamage" }}</label>
    <div class="form-fields">
        <input type="text" name="data.damage.versatile" value="{{data.damage.versatile}}" placeholder="{{ localize 'SW5E.Formula' }}"/>
    </div>
</div>
{{/if}}

{{!-- Other Formula --}}
<div class="form-group">
    <label>{{ localize "SW5E.OtherFormula" }}</label>
    <div class="form-fields">
        <input type="text" name="data.formula" value="{{data.formula}}" placeholder="{{ localize 'SW5E.Formula' }}"/>
    </div>
</div>

{{!-- Saving Throw --}}
<div class="form-group input-select">
    <label>{{ localize "SW5E.ActionSave" }}</label>
    <div class="form-fields">
        <select name="data.save.ability">
            {{#select data.save.ability}}
            <option value=""></option>
            {{#each config.abilities as |ability a|}}
            <option value="{{a}}">{{ability}}</option>
            {{/each}}
            {{/select}}
        </select>
        <span>{{ localize "SW5E.VsDC" }}</span>
        <input type="text" name="data.save.dc" value="{{#if data.save.dc}}{{data.save.dc}}{{/if}}" data-dtype="Number" placeholder="{{ localize 'SW5E.AbbreviationDC' }}" {{#unless isFlatDC}}disabled{{/unless}}/>
        <select name="data.save.scaling">
            {{#select data.save.scaling}}
            <option value="power">{{ localize "SW5E.Powercasting" }}</option>
            {{#each config.abilities as |ability a|}}
            <option value="{{a}}">{{ability}}</option>
            {{/each}}
            <option value="flat">{{ localize "SW5E.Flat" }}</option>
            {{/select}}
        </select>
    </div>
</div>

{{!-- Chat Message Flavor --}}
<div class="form-group stacked">
    <label>{{ localize "SW5E.ChatFlavor" }}</label>
    <input type="text" name="data.chatFlavor" value="{{data.chatFlavor}}"/>
</div>
{{/if}}