added "Effects" and "Details" tab to all items
Additions: - partials for effects and details tab with navigation - loading of partials in main ds4.ts - add localization Changes: - empty "Details" tabs replaced by inclusion of partial - "Details" tab now displays default message - Previous "Details" tab of Trinket replaced by "Effects" tab
This commit is contained in:
parent
7986e91ab7
commit
9cf248754c
9 changed files with 68 additions and 39 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"DS4.Description": "Description",
|
||||
"DS4.Details": "Details",
|
||||
"DS4.Effects": "Effects",
|
||||
"DS4.AttackType": "Attack Type",
|
||||
"DS4.AttackTypeAbbr": "AT",
|
||||
"DS4.WeaponBonus": "Weapon Bonus",
|
||||
|
|
|
@ -31,7 +31,11 @@ Hooks.once("init", async function () {
|
|||
});
|
||||
|
||||
async function registerHandlebarsPartials() {
|
||||
const templatePaths = ["systems/ds4/templates/item/partials/description.hbs"];
|
||||
const templatePaths = [
|
||||
"systems/ds4/templates/item/partials/description.hbs",
|
||||
"systems/ds4/templates/item/partials/details.hbs",
|
||||
"systems/ds4/templates/item/partials/effects.hbs",
|
||||
];
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">{{localize "DS4.Description"}}</a>
|
||||
<a class="item" data-tab="effects">{{localize "DS4.Effects"}}</a>
|
||||
<a class="item" data-tab="details">{{localize "DS4.Details"}}</a>
|
||||
</nav>
|
||||
|
||||
|
@ -46,9 +47,11 @@
|
|||
{{!-- Description Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/description.hbs}}
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
{{!-- As you add new fields, add them in here! --}}
|
||||
</div>
|
||||
{{!-- Details Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/details.hbs}}
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/effects.hbs}}
|
||||
|
||||
</section>
|
||||
</form>
|
|
@ -10,6 +10,7 @@
|
|||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">{{localize "DS4.Description"}}</a>
|
||||
<a class="item" data-tab="effects">{{localize "DS4.Effects"}}</a>
|
||||
<a class="item" data-tab="details">{{localize "DS4.Details"}}</a>
|
||||
</nav>
|
||||
|
||||
|
@ -19,9 +20,11 @@
|
|||
{{!-- Description Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/description.hbs}}
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
{{!-- As you add new fields, add them in here! --}}
|
||||
</div>
|
||||
{{!-- Details Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/details.hbs}}
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/effects.hbs}}
|
||||
|
||||
</section>
|
||||
</form>
|
5
src/templates/item/partials/details.hbs
Normal file
5
src/templates/item/partials/details.hbs
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{!-- The item tab for details. --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
{{!-- As you add new fields, add them in here! --}}
|
||||
<p>Nothing to see yet.</p>
|
||||
</div>
|
22
src/templates/item/partials/effects.hbs
Normal file
22
src/templates/item/partials/effects.hbs
Normal file
|
@ -0,0 +1,22 @@
|
|||
{{!-- Tab for the items view to manage effects --}}
|
||||
<div class="tab details" data-group="primary" data-tab="effects">
|
||||
<ol class="effects-list">
|
||||
<li class="effect flexrow effect-header">
|
||||
<div class="effect-image"></div>
|
||||
<div class="effect-name">Name</div>
|
||||
<div class="effect-controls">
|
||||
<a class="effect-control effect-create" title="Create Effect"><i
|
||||
class="fas fa-plus"></i> Add effect</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each item.effects as |effect id|}}
|
||||
<li class="effect flexrow" data-effect-id="{{effect._id}}">
|
||||
<h4 class="effect-name">{{effect.label}}</h4>
|
||||
<div class="effect-controls">
|
||||
<a class="effect-control effect-edit" title="Edit Effect"><i class="fas fa-edit"></i></a>
|
||||
<a class="effect-control effect-delete" title="Delete Effect"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
|
@ -17,6 +17,7 @@
|
|||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">{{localize "DS4.Description"}}</a>
|
||||
<a class="item" data-tab="effects">{{localize "DS4.Effects"}}</a>
|
||||
<a class="item" data-tab="details">{{localize "DS4.Details"}}</a>
|
||||
</nav>
|
||||
|
||||
|
@ -26,9 +27,11 @@
|
|||
{{!-- Description Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/description.hbs}}
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
{{!-- As you add new fields, add them in here! --}}
|
||||
</div>
|
||||
{{!-- Details Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/details.hbs}}
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/effects.hbs}}
|
||||
|
||||
</section>
|
||||
</form>
|
|
@ -10,6 +10,7 @@
|
|||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">{{localize "DS4.Description"}}</a>
|
||||
<a class="item" data-tab="effects">{{localize "DS4.Effects"}}</a>
|
||||
<a class="item" data-tab="details">{{localize "DS4.Details"}}</a>
|
||||
</nav>
|
||||
|
||||
|
@ -19,27 +20,11 @@
|
|||
{{!-- Description Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/description.hbs}}
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
<ol class="effects-list">
|
||||
<li class="effect flexrow effect-header">
|
||||
<div class="effect-image"></div>
|
||||
<div class="effect-name">Name</div>
|
||||
<div class="effect-controls">
|
||||
<a class="effect-control effect-create" title="Create Effect"><i
|
||||
class="fas fa-plus"></i> Add effect</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each item.effects as |effect id|}}
|
||||
<li class="effect flexrow" data-effect-id="{{effect._id}}">
|
||||
<h4 class="effect-name">{{effect.label}}</h4>
|
||||
<div class="effect-controls">
|
||||
<a class="effect-control effect-edit" title="Edit Effect"><i class="fas fa-edit"></i></a>
|
||||
<a class="effect-control effect-delete" title="Delete Effect"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
{{!-- Details Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/details.hbs}}
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/effects.hbs}}
|
||||
|
||||
</section>
|
||||
</form>
|
|
@ -32,6 +32,7 @@
|
|||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">{{localize "DS4.Description"}}</a>
|
||||
<a class="item" data-tab="effects">{{localize "DS4.Effects"}}</a>
|
||||
<a class="item" data-tab="details">{{localize "DS4.Details"}}</a>
|
||||
</nav>
|
||||
|
||||
|
@ -41,9 +42,11 @@
|
|||
{{!-- Description Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/description.hbs}}
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
{{!-- As you add new fields, add them in here! --}}
|
||||
</div>
|
||||
{{!-- Details Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/details.hbs}}
|
||||
|
||||
{{!-- Effects Tab --}}
|
||||
{{> systems/ds4/templates/item/partials/effects.hbs}}
|
||||
|
||||
</section>
|
||||
</form>
|
Loading…
Reference in a new issue