Difference between revisions of "Template:User"

From cm2.liecourt.com
Line 83: Line 83:
 
<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:@balance|{{#arraydefine:$tokensavailable|{{#arraymap:{{#ttList:,}}|,|@@|@@}} }}{{#arraysize:$tokensavailable}} }}
+
-->{{#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}}

Revision as of 12:54, 22 May 2020


This is the User template. It should be called in the following format:

{{User
|User=
|Roles=
|Name=
|Filed by=
|be candidate=
}}