Added Formula select to view mode

This commit is contained in:
WBHarry 2026-01-17 19:01:50 +01:00
parent 48b76e2961
commit 91d22292e1
4 changed files with 88 additions and 7 deletions

View file

@ -6,7 +6,7 @@
<div class="form-group">
<label>{{localize "Formula"}}</label>
<div class="form-fields">
<select name="flags.daggerheart.activeAltFormula">
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
</div>

View file

@ -0,0 +1,47 @@
<header class="sheet-header flexrow">
<img src="{{document.img}}" alt="{{localize "DOCUMENT.FIELDS.img.label"}}">
<h1>{{document.name}}</h1>
<div class="roll-table-view-formula-container">
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
<h4>{{selectedFormula}}</h4>
</div>
<button data-action="changeMode">
<i class="fa-solid fa-pen" inert></i>
<span>{{localize "TABLE.ACTIONS.ChangeMode.Edit"}}</span>
</button>
</header>
{{{descriptionHTML}}}
<table class="flexcol" data-results>
<thead>
<tr class="flexrow">
<th class="image flexrow"></th>
<th class="range flexrow">{{localize "TABLE_RESULT.FIELDS.range.label"}}</th>
<th class="details flexrow">{{localize "TABLE_RESULT.Details"}}</th>
<th class="controls flexrow"></th>
</tr>
</thead>
<tbody class="scrollable">
{{#each results as |result i|}}
<tr class="flexrow{{#if result.drawn}} drawn{{/if}}" data-result-id="{{result.id}}">
<td class="image">
<img src="{{result.img}}" alt="{{localize "TABLE_RESULT.FIELDS.img.label"}}" loading="lazy">
</td>
<td class="range">{{result.range}}</td>
<td class="details">
{{> "templates/sheets/roll-table/result-details.hbs" result=result}}
</td>
<td class="controls flexrow">
<button class="inline-control icon fa-solid fa-lock{{#unless result.drawn}}-open{{/unless}}"
data-action="lockResult"
data-tooltip aria-label="{{localize "TABLE.ACTIONS.ToggleDrawn"}}"></button>
<button class="inline-control icon fa-solid fa-up-from-bracket" data-action="drawSpecificResult"
data-tooltip aria-label="{{localize "TABLE.ACTIONS.DrawSpecificResult"}}"></button>
</td>
</tr>
{{/each}}
</tbody>
</table>