<section class="resources">
<section class="resource-items">
    {{#each resources as |res|}}
	<div class="resource">
		<h1>
			<input name="data.resources.{{res.name}}.label" type="text" value="{{res.label}}"
				placeholder="{{res.placeholder}}" />
		</h1>
		<div class="attribute-value">
			<input name="data.resources.{{res.name}}.value" type="text" value="{{res.value}}" data-dtype="Number"
				placeholder="0" class="value-number" />
			<span class="value-separator">/</span>
			<input name="data.resources.{{res.name}}.max" type="text" value="{{res.max}}" data-dtype="Number"
				placeholder="0" class="value-number" />
		</div>
		<footer class="attribute-footer">
			<label class="recharge checkbox">
				{{ localize "SW5E.AbbreviationSR" }} <input name="data.resources.{{res.name}}.sr" type="checkbox"
					{{checked res.sr}} />
			</label>
			<label class="recharge checkbox">
				{{ localize "SW5E.AbbreviationLR" }} <input name="data.resources.{{res.name}}.lr" type="checkbox"
					{{checked res.lr}} />
			</label>
		</footer>
	</div>
	{{/each}}

</section>
<section class="counters">
	<div class="counter">
		<h4 class="death-save rollable">{{ localize "SW5E.DeathSave" }}</h4>
		<div class="counter-value">
			<div class="death-success">
				<i class="fas fa-check"></i>
				<input type="text" name="data.attributes.death.success" data-dtype="Number" placeholder="0"
					value="{{data.attributes.death.success}}" />
			</div>
			<div class="death-fail">
				<i class="fas fa-times"></i>
				<input type="text" name="data.attributes.death.failure" data-dtype="Number" placeholder="0"
					value="{{data.attributes.death.failure}}" />
			</div>
		</div>
	</div>
	<div class="counter">
		<h4>{{ localize "SW5E.Exhaustion" }}</h4>
		<div class="counter-value">
			<input type="text" name="data.attributes.exhaustion" data-dtype="Number" placeholder="0"
				value="{{data.attributes.exhaustion}}" />
		</div>
	</div>
	<div class="counter">
		<h4>{{ localize "SW5E.Inspiration" }}</h4>
		<div class="counter-value">
			<input type="checkbox" name="data.attributes.inspiration" data-dtype="Boolean"
				{{checked data.attributes.inspiration}} />
		</div>
	</div>
</section>
<section class="traits">
    <label>
        {{localize "SW5E.Size"}}
        <select class="actor-size" name="data.traits.size">
            {{#select data.traits.size}}
            {{#each config.actorSizes as |label size|}}
            <option value="{{size}}">{{label}}</option>
            {{/each}}
            {{/select}}
        </select>
    </label>
    <label class="{{#unless data.traits.senses}}inactive{{/unless}}">
        {{#unless isVehicle}}
        <label>{{localize "SW5E.Senses"}}</label>
        <a class="config-button" data-action="senses" title="{{localize 'SW5E.SensesConfig'}}"><i class="fas fa-cog"></i></a>
        <ul class="traits-list">
        {{#each senses as |v k|}}
            <li class="tag {{k}}">{{v}}</li>
        {{/each}}
        </ul>
        {{/unless}}
    </label>
    <div class="languages">
        <label data-options="share-languages" class="languages">{{localize "SW5E.Languages"}}</label>
        <a class="trait-selector" data-options="languages" data-target="data.traits.languages">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
            {{#each data.traits.languages.selected as |v k|}}
            <li>{{v}}</li>
            {{/each}}
        </ul>
    </div>	
    {{#unless isVehicle}}
    <div class="form-group ">
        <label>{{localize "SW5E.SpecialTraits"}}</label>
        <a class="config-button" data-action="flags" title="{{localize 'SW5E.SpecialTraits'}}"><i class="fas fa-cog"></i></a>
    </div>
    {{/unless}}

    <div>
        <label>{{localize "SW5E.TraitArmorProf"}}</label>
        <a class="trait-selector" data-options="armorProficiencies" data-target="data.traits.armorProf">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.armorProf.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>
    <div>
        <label>{{localize "SW5E.TraitToolProf"}}</label>
        <a class="trait-selector" data-options="toolProficiencies" data-target="data.traits.toolProf">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.toolProf.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>
    <div>
        <label>{{localize "SW5E.TraitWeaponProf"}}</label>
        <a class="trait-selector" data-options="weaponProficiencies" data-target="data.traits.weaponProf">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.weaponProf.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>	
    <div>
        <label>{{localize "SW5E.DamImm"}}</label>
        <a class="trait-selector" data-options="damageResistanceTypes" data-target="data.traits.di">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.di.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>
    <div>
        <label>{{localize "SW5E.DamRes"}}</label>
        <a class="trait-selector" data-options="damageResistanceTypes" data-target="data.traits.dr">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.dr.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>
    <div>
        <label>{{localize "SW5E.DamVuln"}}</label>
        <a class="trait-selector" data-options="damageResistanceTypes" data-target="data.traits.dv">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.dv.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>

    <div>
        <label>{{localize "SW5E.ConImm"}}</label>
        <a class="trait-selector" data-options="conditionTypes" data-target="data.traits.ci">
            <i class="fas fa-edit"></i>
        </a>
        <ul class="traits-list">
        {{#each data.traits.ci.selected as |v k|}}
            <li>{{v}}</li>
        {{/each}}
        </ul>
    </div>{{#if isCharacter}}

    {{/if}}
    <ul class="passives"></ul>
</section>
