Difference between revisions of "Template:User"
From cm2.liecourt.com
Line 81: | Line 81: | ||
<h2>TruthTokens</h2><div id="balance"> | <h2>TruthTokens</h2><div id="balance"> | ||
<!-- | <!-- | ||
− | + | -->{{#vardefine:@spent|{{#ask:[[Class::Workflow]][[Filed by::{{FULLPAGENAME}}]]|link=none|format=count}} }}<!-- | |
− | -->{{#vardefine:@ | + | -->{{#vardefine:@bought|{{#arraymap:{{#ask:[[Class::Order]][[User::{{FULLPAGENAME}}]][[Transaction::+]]|?Tokens|format=array|link=none}}|,|@@@|{{#explode:@@@|<PROP>|1}}|+}} }}<!-- |
+ | -->{{#vardefine:@sent|{{#arraymap:{{#ask:[[Class::Transaction]][[User::{{FULLPAGENAME}}]][[To::!None]]|?Tokens|link=none|format=array}}|,|@@@|{{#explode:@@@|<PROP>|1}}|+}} }}<!-- | ||
+ | -->{{#vardefine:@recieved|{{#arraymap:{{#ask:[[Class::Transaction]][[To::{{FULLPAGENAME}}]]|?Tokens|link=none|format=array}}|,|@@@|{{#explode:@@@|<PROP>|1}}|+}} }}<!-- | ||
+ | -->{{#vardefine:@balance|{{#expr:{{#if:{{#var:@bought}}|{{#var:@bought}}|0}} + {{#if:{{#var:@recieved}}|{{#var:@recieved}}|0}} - {{#expr:{{#if:{{#var:@spent}}|{{#var:@spent}}|0}} + {{#if:{{#var:@sent}}|{{#var:@sent}}|0}} }} }} }} | ||
<span class="truth-token">{{fa|gavel}}</span>× <span class="nr">{{#var:@balance}}</span> {{#tag:wsfield|Buy more|type=button|onclick=buyMore()|class=btn ml-4 btn-green|id=buy-more-button}}</div> | <span class="truth-token">{{fa|gavel}}</span>× <span class="nr">{{#var:@balance}}</span> {{#tag:wsfield|Buy more|type=button|onclick=buyMore()|class=btn ml-4 btn-green|id=buy-more-button}}</div> | ||
{{#tag:wsfield|Send to a friend|type=button|onclick=sendTokens()|class=btn |id=send-tokens}} | {{#tag:wsfield|Send to a friend|type=button|onclick=sendTokens()|class=btn |id=send-tokens}} | ||
<div id="buy-more" class="d-none"> | <div id="buy-more" class="d-none"> | ||
− | |||
{{#tag:wscreate||mwwrite=Order/|mwtemplate=Order|mwoption=range:00001-99999|mwfollow=true}} | {{#tag:wscreate||mwwrite=Order/|mwtemplate=Order|mwoption=range:00001-99999|mwfollow=true}} | ||
<div><span class="truth-token">{{fa|gavel}}</span>× <wsfield type="number" min="1" class="form-control form-number" name="Tokens" value="1" /></div> | <div><span class="truth-token">{{fa|gavel}}</span>× <wsfield type="number" min="1" class="form-control form-number" name="Tokens" value="1" /></div> |
Revision as of 12:33, 22 May 2020
This is the User template. It should be called in the following format:
{{User |User= |Roles= |Name= |Filed by= }}