enhance card items (#75)

This commit is contained in:
Murilo Brito 2025-05-29 07:07:09 -03:00 committed by GitHub
parent 917bcd7056
commit c34c923406
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 727 additions and 534 deletions

View file

@ -1,11 +0,0 @@
<div>
<header class="flexcol">
<div class="title-container">
<img class="flex0" src="{{document.img}}" data-edit="img" data-action="onEditImage" title="{{document.name}}" height="64" width="64"/>
<div class="title-name">
{{formInput fields.name value=source.name rootId=partId}}
</div>
</div>
</header>
{{> "systems/daggerheart/templates/sheets/parts/heritage.hbs" }}
</div>

View file

@ -1,11 +0,0 @@
<div>
<header class="flexcol">
<div class="title-container">
<img class="flex0" src="{{document.img}}" data-edit="img" data-action="onEditImage" title="{{document.name}}" height="64" width="64"/>
<div class="title-name">
{{formInput fields.name value=source.name rootId=partId}}
</div>
</div>
</header>
{{> "systems/daggerheart/templates/sheets/parts/heritage.hbs" }}
</div>

View file

@ -1,101 +0,0 @@
<div>
<header class="flexcol">
<div class="title-container">
<img class="flex0" src="{{source.img}}" data-edit="img" data-action="onEditImage" title="{{source.name}}" height="64" width="64"/>
<div class="title-name">
{{formInput fields.name value=source.name rootId=partId}}
</div>
</div>
<nav class="sheet-tabs tabs">
{{#each tabs as |tab|}}
<a class="{{tab.cssClass}}" data-action="tab" data-group="{{tab.group}}" data-tab="{{tab.id}}">
<i class="{{tab.icon}}"></i>
<label>{{localize tab.label}}</label>
</a>
{{/each}}
</nav>
</header>
<section class="sheet-body">
<div class="tab {{this.tabs.general.cssClass}}" data-group="primary" data-tab="general">
{{formField systemFields.type value=source.system.type label="Type" localize=true blank=""}}
{{formField systemFields.foundation value=source.system.foundation label="Foundation" }}
{{formField systemFields.domain value=source.system.domain label="Domain" localize=true blank=""}}
{{formField systemFields.level value=source.system.level label="level" data-dtype="Number"}}
{{formField systemFields.recallCost value=source.system.recallCost label="Recall Cost" data-dtype="Number"}}
{{formField systemFields.effect value=source.system.effect label="Description" enriched=source.system.effect toggled=true}}
</div>
<div class="tab {{this.tabs.actions.cssClass}}" data-group="primary" data-tab="actions">
<h2>{{localize "Actions"}} <i class="fa-solid fa-plus icon-button" data-action="addAction"></i></h2>
<div class="flexrow">
{{#each source.system.actions as |action index|}}
<div data-action="editAction" data-index="{{index}}" class="ability-chip">
<img src="{{action.img}}" />
<div>{{action.name}}</div>
<button data-action="removeAction" data-index="{{index}}"><i class="fa-solid fa-x"></i></button>
</div>
{{/each}}
</div>
</div>
</section>
</div>
{{!-- <form class={{cssClass}} autocomplete="off">
<header class="flexcol">
<div class="flexrow">
<img class="flex0" src="{{item.img}}" data-edit="img" title="{{item.name}}" height="64" width="64"/>
<div class="title-name">
<h2><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h2>
</div>
</div>
</header>
<section class="sheet-body">
<div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Category"}}</label>
<div class="form-fields">
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Type"}}</label>
<select name="system.type">
{{selectOptions config.DOMAIN.cardTypes selected=item.system.type labelAttr="name" localize=true blank=""}}
</select>
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Foundation"}}</label>
<input name="system.foundation" type="checkbox" {{checked item.system.foundation}} />
</div>
</div>
<div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Domain"}}</label>
<div class="form-fields">
<select name="system.domain">
{{selectOptions config.DOMAIN.domains selected=item.system.domain labelAttr="name" localize=true blank=""}}
</select>
</div>
</div>
<div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Costs"}}</label>
<div class="form-fields">
<label>{{localize "DAGGERHEART.Sheets.DomainCard.Level"}}</label>
<input name="system.level" value="{{item.system.level}}" type="text" data-dtype="Number" />
<label>{{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}}</label>
<input name="system.recallCost" value="{{item.system.recallCost}}" type="text" data-dtype="Number" />
</div>
</div>
<div class="domain-card-description">
<h2>{{localize "DAGGERHEART.Sheets.DomainCard.Description"}}</h2>
{{editor item.system.effect target="system.effect" button=true}}
</div>
</section>
<h2>{{localize "Actions"}} <i class="fa-solid fa-plus icon-button" data-action="addAction"></i></h2>
<div class="flexrow">
{{#each this.actions as |action index|}}
<div data-action="editAction" data-index="{{index}}" class="ability-chip">
<img src="{{action.img}}" />
<div>{{action.name}}</div>
<button data-action="removeAction" data-index="{{index}}"><i class="fa-solid fa-x"></i></button>
</div>
{{/each}}
</div>
</form> --}}

View file

@ -0,0 +1,28 @@
<li class='feature-item' data-feature-id='{{feature.id}}'>
<div class='feature-line'>
<img class='image' src='{{feature.img}}' />
<h4>
{{feature.name}}
</h4>
{{#unless hideContrals}}
<div class='controls'>
<a
class='effect-control'
data-action='editFeature'
data-feature={{feature.uuid}}
data-tooltip='{{localize "DAGGERHEART.Tooltip.openItemWorld"}}'
>
<i class="fa-solid fa-globe"></i>
</a>
<a
class='effect-control'
data-action='deleteFeature'
data-feature={{feature.uuid}}
data-tooltip='{{localize "DAGGERHEART.Tooltip.delete"}}'
>
<i class='fas fa-trash'></i>
</a>
</div>
{{/unless}}
</div>
</li>

View file

@ -6,5 +6,6 @@
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Feature.Description"}}</legend>
{{formInput systemFields.description value=source.system.description enriched=source.system.description localize=true toggled=true}}
{{formField systemFields.effect value=source.system.effect enriched=source.system.effect toggled=true}}
</fieldset>
</section>

View file

@ -0,0 +1,14 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Feature.Tabs.Features"}}</legend>
<div class="feature-list">
{{#each source.system.abilities as |feature key|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}}
{{/each}}
</div>
</fieldset>
</section>

View file

@ -0,0 +1,9 @@
<header class='item-card-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class='item-info'>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize 'TYPES.Item.ancestry'}}</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,9 @@
<header class='item-card-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class='item-info'>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize 'TYPES.Item.community'}}</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,26 @@
<header class='item-card-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class="item-icons-list">
<span class="item-icon">
<span class="recall-label">{{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}}</span>
<span class="recall-value">{{source.system.recallCost}}</span>
<i class="fa-solid fa-bolt"></i>
</span>
</div>
<div class='item-info'>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize 'TYPES.Item.domainCard'}}</h3>
<h3>
{{localize (concat 'DAGGERHEART.Domain.CardTypes.' source.system.type)}}
<span>-</span>
{{source.system.domain}}
<span>-</span>
<span>
{{localize "DAGGERHEART.Sheets.DomainCard.Level"}}:
{{source.system.level}}
</span>
</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,20 @@
<section
class='tab {{tabs.settings.cssClass}} {{tabs.settings.id}}'
data-tab='{{tabs.settings.id}}'
data-group='{{tabs.settings.group}}'
>
<fieldset class="two-columns">
<legend>{{localize tabs.settings.label}}</legend>
<span>{{localize "DAGGERHEART.Sheets.DomainCard.Type"}}</span>
{{formField systemFields.type value=source.system.type localize=true blank=""}}
<span>{{localize "DAGGERHEART.Sheets.DomainCard.Foundation"}}</span>
{{formField systemFields.foundation value=source.system.foundation }}
<span>{{localize "DAGGERHEART.Sheets.DomainCard.Domain"}}</span>
{{formField systemFields.domain value=source.system.domain localize=true blank=""}}
<span>{{localize "DAGGERHEART.Sheets.DomainCard.Level"}}</span>
{{formField systemFields.level value=source.system.level data-dtype="Number"}}
<span>{{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}}</span>
{{formField systemFields.recallCost value=source.system.recallCost data-dtype="Number"}}
</fieldset>
</section>