Updating the compendium filter to make it more snappy
This commit is contained in:
52
system/templates/compendium/filter-bar.html
Normal file
52
system/templates/compendium/filter-bar.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<div class="l5r5e filter-bar">
|
||||
|
||||
{{#if filtersToShow.rank}}
|
||||
<div class="flexrow l5r5e rank-filter number-filter">
|
||||
<label>{{localize 'l5r5e.compendium.filter.rank'}}:</label>
|
||||
{{#each ranks}}
|
||||
<a data-rank="{{this}}"
|
||||
data-tooltip="{{localize 'l5r5e.compendium.filter.rank'}} {{this}}">{{this}}</a>
|
||||
{{/each}}
|
||||
<a data-clear style="display:none" data-tooltip="{{localize 'l5r5e.compendium.filter.clear'}}">×</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if filtersToShow.rarity}}
|
||||
<div class="flexrow l5r5e rarity-filter number-filter">
|
||||
<label>{{localize 'l5r5e.compendium.filter.rarity'}}:</label>
|
||||
{{#each rarities}}
|
||||
<a data-rarity="{{this}}"
|
||||
data-tooltip="{{localize 'l5r5e.compendium.filter.rarity'}} {{this}}">{{this}}</a>
|
||||
{{/each}}
|
||||
<a data-clear style="display:none" data-tooltip="{{localize 'l5r5e.compendium.filter.clear'}}">×</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if filtersToShow.ring}}
|
||||
<div class="flexrow l5r5e ring-filter">
|
||||
<label>{{localize 'l5r5e.rings.label'}}:</label>
|
||||
{{#each rings}}
|
||||
<i data-ring="{{this}}"
|
||||
data-tooltip="{{localize (concat 'l5r5e.rings.' this)}}"
|
||||
class="i_{{this}}"></i>
|
||||
{{/each}}
|
||||
<a data-clear style="display:none" data-tooltip="{{localize 'l5r5e.compendium.filter.clear'}}">×</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if filtersToShow.source}}
|
||||
<div class="flexrow l5r5e source-filter">
|
||||
<l5r5e-multi-select name="filter-sources" {{#if hideDisabledOptions}}hidedisabledoptions{{/if}}>
|
||||
{{selectOptions sources localize=true}}
|
||||
</l5r5e-multi-select>
|
||||
</div>
|
||||
{{#if showPlayerView}}
|
||||
<button type="button" class="gm applyPlayerFilter"
|
||||
data-action="applyPlayerView"
|
||||
data-tooltip="{{localize 'l5r5e.multiselect.player_filter_tooltip'}}">
|
||||
{{localize 'l5r5e.multiselect.player_filter_label'}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
30
system/templates/compendium/l5r5e-index-partial.html
Normal file
30
system/templates/compendium/l5r5e-index-partial.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{{!--
|
||||
L5R5e entry partial — mirrors Foundry's index-partial.hbs structure and adds
|
||||
ring/rarity/rank badges from entryFilterData injected by _prepareDirectoryContext.
|
||||
|
||||
NOTE: Foundry's index-partial.hbs renders a complete <li> element so it cannot
|
||||
be composed via {{> partial}} without nesting <li> inside <li>. We therefore
|
||||
duplicate its simple structure here and own it ourselves. If Foundry changes
|
||||
their index-partial.hbs, this file should be checked for parity.
|
||||
|
||||
Foundry original: templates/sidebar/apps/compendium/index-partial.hbs
|
||||
--}}
|
||||
<li class="directory-item entry document {{ @root.documentCls }} flexrow" data-entry-id="{{ _id }}">
|
||||
{{#if thumb}}
|
||||
<img class="thumbnail" src="{{ thumb }}" alt="{{ name }}" loading="lazy">
|
||||
{{else if img}}
|
||||
<img class="thumbnail" src="{{ img }}" alt="{{ name }}" loading="lazy">
|
||||
{{else}}
|
||||
<i class="{{ @root.sidebarIcon }}" inert></i>
|
||||
{{/if}}
|
||||
<a class="entry-name ellipsis" data-action="activateEntry">{{ name }}</a>
|
||||
{{#with (lookup @root.entryFilterData _id)}}
|
||||
{{#if (or ring rarity rank)}}
|
||||
<div class="l5r5e ring-rarity-rank" data-action="activateEntry">
|
||||
{{#if ring}} <i class="i_{{ring}}"></i>{{/if}}
|
||||
{{#if rarity}}<a>{{localize "l5r5e.sheets.rarity"}} {{rarity}}</a>{{/if}}
|
||||
{{#if rank}}<a>{{localize "l5r5e.sheets.rank"}} {{rank}}</a>{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
</li>
|
||||
@@ -1,6 +0,0 @@
|
||||
<div class="flexrow l5r5e {{type}}-filter number-filter">
|
||||
<label>{{localize (localize 'l5r5e.compendium.filter.{type}' type=type)}}:</label>
|
||||
{{#each number}}
|
||||
<a data-{{../type}}="{{.}}" data-tooltip="{{localize (localize 'l5r5e.compendium.filter.{type}' type=../type)}} {{.}}">{{.}}</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
@@ -1,8 +0,0 @@
|
||||
<div class="flexrow l5r5e ring-filter number-filter">
|
||||
<label>{{localize 'l5r5e.rings.label'}}:</label>
|
||||
<i data-ring="fire" data-ringId="1" data-tooltip="{{localize 'l5r5e.rings.fire'}}" class="i_fire"></i>
|
||||
<i data-ring="water" data-ringId="2" data-tooltip="{{localize 'l5r5e.rings.water'}}" class="i_water"></i>
|
||||
<i data-ring="earth" data-ringId="3" data-tooltip="{{localize 'l5r5e.rings.earth'}}" class="i_earth"></i>
|
||||
<i data-ring="air" data-ringId="4" data-tooltip="{{localize 'l5r5e.rings.air'}}" class="i_air"></i>
|
||||
<i data-ring="void" data-ringId="5" data-tooltip="{{localize 'l5r5e.rings.void'}}" class="i_void"></i>
|
||||
</div>
|
||||
@@ -1,6 +0,0 @@
|
||||
<div class="l5r5e ring-rarity-rank">
|
||||
<i {{#if ring}} class="i_{{ring}}" {{/if}}>
|
||||
{{#if rarity}} {{localize "l5r5e.sheets.rarity"}} {{rarity}} {{/if}}
|
||||
{{#if rank}} {{localize "l5r5e.sheets.rank"}} {{rank}} {{/if}}
|
||||
</i>
|
||||
</div>
|
||||
Reference in New Issue
Block a user