~hokiegeek/tw5-location-crafts

dc754c7960599f54a4238bf6597acbc562f76406 — HokieGeek 4 months ago 2ce0d34 0.3.1
Got help on how to make filters not override my titles
2 files changed, 12 insertions(+), 24 deletions(-)

M macros.tid
M plugin.info
M macros.tid => macros.tid +11 -23
@@ 19,7 19,7 @@ and how to mark them off?
\define category-list(type)
<div class="category-list">
    <$let special-elements="expected random special none complete"
          categoryState={{{ [{!!title}encodeuricomponent[]addprefix[$:/state/location-crafts/]] }}}>
          categoryState={{{ [{!!title}slugify[]addprefix[$:/state/location-crafts/]] }}}>
    <div class="header-button">
        <h1 style="text-transform: capitalize;">$type$</h1>
        <$button setTitle=<<categoryState>> setField=$type$ setTo="visible" tooltip="Add $type$" aria-label="Add $type$" class="tc-btn-invisible tc-btn-mini">


@@ 32,25 32,25 @@ and how to mark them off?
        </div>
        <div style="grid-column-start: 2">
            <$reveal type="gt" stateTitle=<<currentTiddler>> stateField="crafted-$type$-points" text="0">
            <$let next-points={{{ [is[current]get[crafted-$type$-points]subtract[1]] }}}>
            <$let next-points={{{ [<currentTiddler>get[crafted-$type$-points]subtract[1]] }}}>
            <$button setTitle=<<currentTiddler>> setField=crafted-$type$-points setTo=<<next-points>> tooltip="remove progress points" aria-label="remove progress points" class="tc-btn-invisible tc-btn-mini">
                {{$:/core/images/minus-button}}
            </$button>
            </$let>
            </$reveal>
            <$list filter="[is[current]get[crafted-$type$-points]else[0]compare:integer:lteq[0]]">
            <$list filter="[<currentTiddler>get[crafted-$type$-points]else[0]compare:integer:lteq[0]]">
            <span class="btn-disabled">
                {{$:/core/images/minus-button}}
            </span>
            </$list>
        </div>
        <div style="grid-column-start: 3; padding-left: 0.5rem; padding-right: 0.5rem;">
        <$list filter="[is[current]get[crafted-$type$-points]else[0]]">
        <$list filter="[<currentTiddler>get[crafted-$type$-points]else[0]]">
        <<currentTiddler>>
        </$list>
        </div>
        <div style="grid-column-start: 4">
            <$let next-points={{{ [is[current]get[crafted-$type$-points]else[0]add[1]] }}}>
            <$let next-points={{{ [<currentTiddler>get[crafted-$type$-points]else[0]add[1]] }}}>
            <$button setTitle=<<currentTiddler>> setField=crafted-$type$-points setTo=<<next-points>> tooltip="add progress points" aria-label="add progress points" class="tc-btn-invisible tc-btn-mini">
                {{$:/core/images/plus-button}}
            </$button>


@@ 58,21 58,18 @@ and how to mark them off?
        </div>
    </div>
    <ol>
        <$let me={{!!title}}>
        <$list filter="[is[current]get[crafted-$type$]enlist-input:raw[]]" counter="counter" emptyMessage="no $type$ setup">
        <$list filter="[<currentTiddler>get[crafted-$type$]enlist-input:raw[]]" variable="element" counter="counter" emptyMessage="no $type$ setup">
        <li>
            <$let element=<<currentTiddler>>>
            <$list filter="[<special-elements>enlist-input:raw[]match<currentTiddler>]">
            <$list filter="[<special-elements>enlist-input:raw[]match<element>]">
            <<element>>
            </$list>
            <$list filter="[<special-elements>enlist-input:raw[]match<currentTiddler>then[found]else[]remove[found]]">
            <$list filter="[<special-elements>enlist-input:raw[]match<element>then[found]else[]remove[found]]">
            <$link to=<<element>>><<element>></$link>
            </$list>
            </$let>
            <!--
            <$let prev={{{ [<counter>subtract[1]] }}}
                  last={{{ [<me>get[crafted-$type$]enlist-input:raw[]rest<counter>join[ ]] }}}
                  newlist={{{ [<me>get[crafted-$type$]enlist-input:raw[]first<prev>append<last>join[ ]] }}}>
                  last={{{ [<currentTiddler>get[crafted-$type$]enlist-input:raw[]rest<counter>join[ ]] }}}
                  newlist={{{ [<currentTiddler>get[crafted-$type$]enlist-input:raw[]first<prev>append<last>join[ ]] }}}>
            <$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="use unique" aria-label="use unique" class="tc-btn-invisible tc-btn-mini btn-close">
                <$action-setfield $tiddler=<<me>> $field="crafted-$type$" $value=<<newlist>> />
                {{$:/core/images/erase}}


@@ 81,7 78,6 @@ and how to mark them off?
            -->
        </li>
        </$list>
        </$let>
        <$reveal type="match" stateTitle=<<categoryState>> stateField=$type$ text="visible">
        <li>
        <div style="display: grid; width: fit-content;">


@@ 90,13 86,7 @@ and how to mark them off?
            </div>
            <div style="grid-row-start: 1; grid-column-start: 2; padding-right: .2rem;">
            <$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="submit" aria-label="submit" class="tc-btn-invisible tc-btn-mini">
                <$let custom-element={{{ [<categoryState>get[custom-$type$]] }}}
                      updated-list={{{ [all[current]get[crafted-$type$]enlist-input:raw[]] [<categoryState>get[custom-$type$]] }}}>
                <$action-listops $field="crafted-$type$" $filter="[all[current]get[crafted-$type$]enlist-input:raw[]] [<categoryState>get[custom-$type$]]" />
                <!--
                <$action-setfield $field="crafted-$type$" $value=<<updated-list>> />
                -->
                </$let>
                <$action-listops $field="crafted-$type$" $filter="[<currentTiddler>get[crafted-$type$]enlist-input:raw[]] =[<categoryState>get[custom-$type$]]" />
                <$action-setfield $tiddler=<<categoryState>> $field="custom-$type$" $value="" />
                {{$:/core/images/done-button}}
            </$button>


@@ 115,8 105,6 @@ and how to mark them off?
                <br />
                </$list>
            </div>
            <!--
            -->
        </div>
        </li>
        </$reveal>

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/location-crafts",
    "description": "Some templates and stuff for recording information created with the RPG tool The Location Crafter",
    "author": "hokiegeek",
    "version": "0.3.0",
    "version": "0.3.1",
    "core-version": ">=5.2.1",
    "source": "https://git.sr.ht/~hokiegeek/tw5-location-crafts",
    "plugin-type": "plugin",