forked from public/foundryvtt-reve-de-dragon
Fix again achatVente
- remplacement des données/JSON dans le html par des Flags sur le ChatMessage - extraction de la gestion des infos de ventes pour rassembler la génération du ChatMessage - on ne perd plus la quantité ou le vendeur - attention au mergeObject: il modifie le premier parametre, ce qui modifiait parfois l'acteur (!!!) et toujours la quantité de l'objet du vendeur lors de la création de l'objet de l'acheteur!
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
{{log 'chat-vente-item' this}}
|
||||
<div class="post-item" data-transfer="{{transfer}}">
|
||||
<h3>{{#if alias}}{{alias}} propose: {{else}}Acheter {{/if}}{{item.name}}</h3>
|
||||
{{#if item.img}}
|
||||
@ -12,7 +13,7 @@
|
||||
<hr>
|
||||
<p>
|
||||
{{#unless quantiteIllimite}}
|
||||
<span>Lots disponibles: <span class="quantiteNbLots">{{quantiteNbLots}}</span></span><br>
|
||||
<span>Lots disponibles: {{nbLots}}</span><br>
|
||||
{{/unless}}
|
||||
{{#if (gt tailleLot 1)}}
|
||||
<span>Lots de: <span class="tailleLot">{{tailleLot}}</span></span><br>
|
||||
@ -22,15 +23,9 @@
|
||||
<span class="prixLot">{{numberFormat prixLot decimals=2 sign=false}}</span> Sols</strong></span><br>
|
||||
{{/if}}
|
||||
</p>
|
||||
{{#if (or (gt quantiteNbLots 0) quantiteIllimite)}}
|
||||
{{#if (or (gt nbLots 0) quantiteIllimite)}}
|
||||
<span class="chat-card-button-area">
|
||||
<a class="button-acheter chat-card-button"
|
||||
data-jsondata='{{jsondata}}'
|
||||
{{#if vendeurId}}data-vendeurId='{{vendeurId}}'{{/if}}
|
||||
data-tailleLot="{{tailleLot}}"
|
||||
data-quantiteNbLots="{{quantiteNbLots}}"
|
||||
data-quantiteIllimite="{{#if quantiteIllimite}}true{{else}}false{{/if}}"
|
||||
data-prixLot="{{prixLot}}">
|
||||
<a class="button-acheter chat-card-button">
|
||||
{{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}}</a>
|
||||
</span>
|
||||
{{/if}}
|
||||
|
@ -31,7 +31,7 @@
|
||||
<label>{{#if quantiteIllimite}}
|
||||
pas de limite
|
||||
{{else}}
|
||||
{{quantiteNbLots}}
|
||||
{{nbLots}}
|
||||
{{/if}}</label>
|
||||
</div>
|
||||
<div class="flexrow flex-group-left">
|
||||
@ -41,7 +41,7 @@
|
||||
</label>
|
||||
<div class="flexrow">
|
||||
<input name="nombreLots" class="nombreLots flex-shrink number-x2" type="number" min="1"
|
||||
{{#unless quantiteIllimite}} max="{{quantiteNbLots}}" {{/unless}}
|
||||
{{#unless quantiteIllimite}} max="{{nbLots}}" {{/unless}}
|
||||
value="{{choix.nombreLots}}"
|
||||
data-dtype="Number" />
|
||||
</div>
|
||||
|
@ -18,8 +18,8 @@
|
||||
quantiteIllimite}}checked{{/if}} />
|
||||
<label class="label-quantiteIllimite flex-shrink">disponibles</label>
|
||||
{{/unless}}
|
||||
<input name="quantiteNbLots" class="quantiteNbLots flex-shrink number-x2" type="number" min="1"
|
||||
max="{{quantiteMaxLots}}" value="{{quantiteNbLots}}" data-dtype="Number" />
|
||||
<input name="nbLots" class="nbLots flex-shrink number-x2" type="number" min="1"
|
||||
max="{{maxLots}}" value="{{nbLots}}" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flexrow flex-group-left">
|
||||
|
Reference in New Issue
Block a user