daggerheart/templates/sheets/rollTable/sheet.hbs
WBHarry a78ef1f70c
[Feature] RollTable Improvements (#1552)
* Initial - Branch Test

* reorganized path for better usage

* something to mess with

* registration things

* .

* root-template error

* pushing in for the day

* hook?

* help?

* .

* implementation initial

* updated comment

* overcomplicated it

* .

* Added Formula select to view mode

* .

* Prettied up roll-results template

* Removed SRD table descriptions

* Improved draw result description css

* Fallback for default dark dice

* .

---------

Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
2026-01-24 20:26:37 +01:00

49 lines
No EOL
2.1 KiB
Handlebars

<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">
{{#if usesAltFormula}}
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
{{/if}}
<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.displayImg}}" 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>