foundryvtt-reve-de-dragon/templates/item-sheet.html
Vincent Vandemeulebrouck 509b7f97dc Utilisation de system dans les Item/Actor Sheet
Utilisation de system dans les data de formulaire pour tous
les Item/Actor (à la base, ou les sous-éléments)

Corrections sur les sorts en réserve (ce ne sont pas des Item)

Petites améliorations:

* `actor.itemTypes[type]`
   revient à faire (sans besoin de filtrer)
    `actor.items.filter(it => it.type == type)`
* dans les ItemSheet, this.object et this.document
  remplacés par this.item
* dans les ActorSheet, this.object et this.document
  remplacés par this.actor

Quelques corrections en plus:
* parade ne marchait pas
* problèmes sur le commerce
2022-09-07 18:47:56 +02:00

65 lines
3.1 KiB
HTML

<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
<div class="resource">
<label>Quantity</label>
<input type="text" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>Weight</label>
<input type="text" name="system.weight" value="{{system.weight}}" data-dtype="Number"/>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="attributes">Attributes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Description Tab --}}
<div class="tab" data-group="primary" data-tab="description">
{{editor system.description target="system.description" button=true owner=owner editable=editable}}
</div>
{{!-- Attributes Tab --}}
<div class="tab attributes" data-group="primary" data-tab="attributes">
<header class="attributes-header flexrow">
<span class="attribute-key">Attribute Key</span>
<span class="attribute-value">Value</span>
<span class="attribute-label">Label</span>
<span class="attribute-dtype">Data Type</span>
<a class="attribute-control" data-action="create"><i class="fas fa-plus"></i></a>
</header>
<ol class="attributes-list">
{{#each system.attributes as |attr key|}}
<li class="attribute flexrow" data-attribute="{{key}}">
<input class="attribute-key" type="text" name="system.attributes.{{key}}.key" value="{{key}}"/>
{{#if attr.isCheckbox}}
<label class="attribute-value checkbox"><input type="checkbox" name="system.attributes.{{key}}.value" {{checked attr.value}}/></label>
{{else}}
<input class="attribute-value" type="text" name="system.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
{{/if}}
<input class="attribute-label" type="text" name="system.attributes.{{key}}.label" value="{{attr.label}}"/>
<select class="attribute-dtype" name="system.attributes.{{key}}.dtype">
{{#select attr.dtype}}
{{#each ../dtypes as |t|}}
<option value="{{t}}">{{t}}</option>
{{/each}}
{{/select}}
</select>
<a class="attribute-control" data-action="delete"><i class="fas fa-trash"></i></a>
</li>
{{/each}}
</ol>
</div>
</section>
</form>