Difference between revisions of "Template:User"

From cm2.liecourt.com
(Fill database)
 
(Fill database)
(40 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
}}
 
}}
  
This is the '''Member''' template. It should be called in the following format:
+
This is the '''User''' template. It should be called in the following format:
  
 
<pre>
 
<pre>
{{Member
+
{{User
 
|User=
 
|User=
 
|Roles=
 
|Roles=
 
|Name=
 
|Name=
 
|Filed by=
 
|Filed by=
 +
|be candidate=
 
}}
 
}}
 
</pre>
 
</pre>
{{Member }}
+
<!--{{User }}-->
  
</noinclude><includeonly>
+
</noinclude><includeonly>{{#vardefine:@roles|{{#ifeq:{{{Be candidate|Yes}}}|Yes|{{#if:{{{Roles|}}}|{{{Roles|}}}|Juror, Judge}} }} }}
<div class="d-none">__NOTITLE__ __NOTOC__{{#if:{{{Name|}}}|{{#set:Class=Member|Role={{#if:{{{Roles|}}}|{{{Roles|}}}|Juror}}|+sep=,|User={{{User|}}}|Name={{{Name|}}}|Email={{{Email|}}}|Volunteer={{{Volunteer|}}} }}
+
<div class="d-none">__NOTITLE__ __NOTOC__{{#if:{{{Name|}}}|{{#set:Class=Member|Role={{#if:{{#ask:[[{{FULLPAGENAME}}]][[User group::sysop]]|?User group}}| |{{#var:@roles}} }}|+sep=,|User={{{User|}}}|Name={{{Name|}}}|Email={{{Email|}}}|Volunteer={{{Volunteer|}}}|Tokens spent={{{Tokens spent|}}}|Pagename={{FULLPAGENAME}} }} }}
 
</div>
 
</div>
 
{{#vardefine:@allowed|{{#ifeq:User:{{CURRENTLOGGEDUSER}}|{{FULLPAGENAME}}|Yes|{{#ifsysop:Yes|No}}}}}}  
 
{{#vardefine:@allowed|{{#ifeq:User:{{CURRENTLOGGEDUSER}}|{{FULLPAGENAME}}|Yes|{{#ifsysop:Yes|No}}}}}}  
 
{{#ifeq:{{#var:@allowed}}|Yes|<div class="row mt-4">
 
{{#ifeq:{{#var:@allowed}}|Yes|<div class="row mt-4">
<div class="col-12 col-lg-8 mt-4">
+
<div class="col-12 col-lg-8">
<div class="row">
+
{{#ifeq:{{#urlget:msg}}|casestarted|<div class="alert alert-success">Case started! Please check your messages for the required actions.</div>}}
<div class="profile-img  col-2 d-lg-block d-none">
+
<div class="tab-content box"><h2>Member information</h2>
{{fa|user}}
 
</div>
 
<div class="col-12 col-lg-10">
 
<div class="ml-lg-4 tab-content">
 
 
<div id="info-tab" class="tab-pane fade show active"  role="tabpanel" aria-labelledby="info-tab">
 
<div id="info-tab" class="tab-pane fade show active"  role="tabpanel" aria-labelledby="info-tab">
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
{{Item responsive |Cols={{#var:@cols|4-8}}
Line 37: Line 34:
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Email</b>
 
|1=<b>Email</b>
|2={{{Email|}}}
+
|2={{#vardefineecho:@email|{{#show:{{FULLPAGENAME}}|?User right}} }}
 
}}
 
}}
  
Line 47: Line 44:
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Roles</b>
 
|1=<b>Roles</b>
|2={{#show:{{FULLPAGENAME}}|?Role}} {{#ifeq:{{{Volunteer|}}}|Yes|(Volunteer)}}
+
|2={{#ifeq:{{{Be candidate|}}}|No|Not a candidate|{{#arraymap:{{#var:@roles}}|,|@@|@@}} {{#ifeq:{{{Volunteer|Yes}}}|(volunteer)}} }}
 
}}
 
}}
 
{{#widget:link|text=Edit|type=a|class=btn btn-blue|id=profile-tab|datatoggle=tab|href=#info-tab-form|role=tab|aria-controls=info-tab-form|ariaselected=false}}
 
{{#widget:link|text=Edit|type=a|class=btn btn-blue|id=profile-tab|datatoggle=tab|href=#info-tab-form|role=tab|aria-controls=info-tab-form|ariaselected=false}}
 
</div>
 
</div>
 
<div id="info-tab-form" class="tab-pane fade"  role="tabpanel" aria-labelledby="info-tab-form">
 
<div id="info-tab-form" class="tab-pane fade"  role="tabpanel" aria-labelledby="info-tab-form">
 
+
{{User form
<wsform action="addToWiki">
+
|Name={{{Name|}}}
{{#tag:wsedit||target={{PAGEID}}|template=User|formfield=Name}}
+
|Email={{#var:@email}}
{{#tag:wsedit||target={{PAGEID}}|template=User|formfield=Roles}}
+
|Volunteer={{{Volunteer|}}}
{{#tag:wsedit||target={{PAGEID}}|template=User|formfield=Email}}
+
|Roles={{#var:@roles}}
{{#tag:wsedit||target={{PAGEID}}|template=User|formfield=Volunteer}}
+
|Be candidate={{{Be candidate|}}}
 
 
 
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Name</b>
 
|2={{#tag:wsfield||name=Name|type=text|value={{{Name|}}}|class=form-control }}
 
}}
 
 
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Email</b>
 
|2={{#tag:wsfield||name=Email|type=text|value={{{Email|}}}|class=form-control }}
 
}}
 
 
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Roles</b>
 
|2={{#arraydefine:@roles|{{#show:{{FULLPAGENAME}}|?Role}} }}
 
<wslabel>Juror<wsfield type="checkbox" name="Roles[]" value="Juror" checked="{{#if:{{#arraysearch:@roles|Juror}}|checked}}" /></wslabel><br>
 
{{#ifsysop:<wslabel>Judge<wsfield type="checkbox" name="Roles[]" value="Judge" checked="{{#if:{{#arraysearch:@roles|Judge}}|checked}}" /></wslabel>|{{#if:{{#arraysearch:@roles|Judge}}|email the court to give up Judge role}} }}
 
}}
 
 
 
{{Item responsive |Cols={{#var:@cols|4-8}}
 
|1=<b>Volunteer</b>
 
|2=<div class="d-flex">
 
{{#widget:Check input |type=radio |name=Volunteer  |text=yes |id=volunteeryes |value=Yes|checked={{#ifeq:{{{Volunteer|}}}|Yes|checked}}}}
 
{{#widget:Check input |type=radio |name=Volunteer |text=no |id=volunteerno |value=No|checked={{#ifeq:{{{Volunteer|}}}|Yes| |checked}} }}
 
</div>
 
 
}}
 
}}
 
{{#widget:link|text=Cancel|type=a|class=btn-red btn btn-half|id=profile-tab|datatoggle=tab|href=#info-tab|role=tab|aria-controls=info-tab|ariaselected=true}}{{#tag:wsfield||type=submit|value=Save|class=btn btn-green btn-half}}
 
</wsform>
 
</div>
 
</div>
 
</div>
 
 
</div>
 
</div>
<h2>Active in cases:</h2>
+
</div><div class="box">
 +
<h2>Active in {{#vardefine:@nrcases|{{#ask:[[Class::Participant]][[User::{{FULLPAGENAME}}]]|format=count}} }}{{#var:@nrcases}} {{#ifeq:{{#var:@nrcases}}|1|case|cases}}</h2>
  
 
{{Item responsive |Cols={{#var:@cols|8-4}}
 
{{Item responsive |Cols={{#var:@cols|8-4}}
Line 103: Line 70:
 
}}
 
}}
  
|}}
+
|}}</div>
 
</div>
 
</div>
 
<div class="col-12 col-lg-4">
 
<div class="col-12 col-lg-4">
 
<div class="info-box">
 
<div class="info-box">
 
<h2>TruthTokens</h2><div id="balance">
 
<h2>TruthTokens</h2><div id="balance">
<span class="truth-token">{{fa|gavel}}</span>× <span class="nr">3</span>  {{#tag:wsfield|Buy more|type=button|onclick=buyMore()|class=btn ml-4 btn-green|id=buy-more-button}}</div>
+
<!--
<div id="buy-more" class="d-none">
+
-->{{#vardefine:@balance|{{#ttcount:}} }}
<!--{{#tag:wscreate||mwwrite=Order/|mwtemplate=Order|mwoption=range:00001-99999|mwfollow=true}}-->
+
<span class="truth-token">{{fa|gavel}}</span>× <span class="nr">{{#var:@balance}}</span>
<div><span class="truth-token">{{fa|gavel}}</span>× <wsfield type="number" min="1" class="form-control form-number" name="Tokens" value="1"  /></div>
 
<wsfield type="hidden" name="Email" value="{{{Email|}}}"  />
 
<wsfield type="hidden" name="Name" value="{{{Name|}}}"  />
 
<wsfield type="hidden" name="User" value="{{FULLPAGENAME}}"  />
 
<div class="total-token-price">Total $ <span id="total-price" >200</span>,-</div>
 
{{#widget:Pay}}
 
<!--<wsfield type="submit" value="buy" class="btn btn-green " />-->
 
</div>
 
<div id="result"></div>
 
 
 
<!--{{Payment form|
 
|Billing name={{{Name|}}}
 
|Billing email={{{Email|}}}
 
|Price=200
 
}}-->
 
 
 
 
</div>
 
</div>
 +
</div> 
 
<div class="info-box">
 
<div class="info-box">
 
<h2>Messages</h2>
 
<h2>Messages</h2>
 
{{#arraymap:{{#ask:[[Class::Workflow]][[Filed by::{{FULLPAGENAME}}]][[Stage::Settled]]|?Settled seen by|format=array}}|,|@@@|
 
{{#arraymap:{{#ask:[[Class::Workflow]][[Filed by::{{FULLPAGENAME}}]][[Stage::Settled]]|?Settled seen by|format=array}}|,|@@@|
{{#arraydefine:@seen|{{#explode:@@@|<PROP>|1}} }}
+
{{#arraydefine:@seen|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|###|###|,}} }}
{{#if:{{#arraysearch:@seen|{{FULLPAGENAME}} }}||{{#tag:html|<details>
+
{{#if:{{#arraysearch:@seen|{{FULLPAGENAME}} }}| |
 +
{{#tag:html|<details>
 
<summary>A case you filed is settled</summary>}}
 
<summary>A case you filed is settled</summary>}}
 +
<div class="info-row"><b>Case ID:</b>{{#show:{{#explode:@@@|<PROP>|0}}|?Case ID|link=none}}</div>
 
<div class="info-row"><b>Suit:</b>{{#ask:[[Class::Suit]][[Workflow::{{#explode:@@@|<PROP>|0}}]]}}
 
<div class="info-row"><b>Suit:</b>{{#ask:[[Class::Suit]][[Workflow::{{#explode:@@@|<PROP>|0}}]]}}
</div>
+
</div>{{#tag:wsform|{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Settled seen by|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|###|###|,}}, {{FULLPAGENAME}}|{{FULLPAGENAME}} }} }}
{{#tag:wsform|  
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Settled seen by|value={{FULLPAGENAME}}}}
 
 
{{#tag:wsfield||type=submit|value=Remove message|class=btn btn-green mt-4 mb-4}}
 
{{#tag:wsfield||type=submit|value=Remove message|class=btn btn-green mt-4 mb-4}}
 
|action=addToWiki}}
 
|action=addToWiki}}
 
{{#tag:html|</details>}} }}
 
{{#tag:html|</details>}} }}
 
|}}<!--
 
|}}<!--
 +
 +
-->{{#arraymap:{{#ask:[[Class::Workflow]][[Jurors::{{FULLPAGENAME}}]][[Change::!none]]|?Change seen by|?Suit date|link=none|format=array}}|,|@@@|<!--
 +
 +
-->{{#arraydefine:@change|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|###|###|,}} }}
 +
{{#if:{{#arraysearch:@change|{{FULLPAGENAME}} }}| |<div class="info-item">{{#tag:html|<details>
 +
<summary>A case you are jurying is changed</summary>}}
 +
<div class="info-row"><b>Case ID:</b>{{#show:{{#explode:@@@|<PROP>|0}}|?Case ID|link=none}}</div>
 +
<div class="info-row"><b>Suit:</b>{{#ask:[[Class::Suit]][[Workflow::{{#explode:@@@|<PROP>|0}}]]}}</div>
 +
<div class="info-row"><b>Suit date:</b>{{#explode:@@@|<PROP>|2}}</div>
 +
{{#tag:wsform|{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Change seen by|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|###|###|,}}, {{FULLPAGENAME}}|{{FULLPAGENAME}} }} }}
 +
{{#tag:wsfield||type=submit|value=Remove message|class=btn btn-green mt-4 mb-4}}
 +
|action=addToWiki}} {{#tag:html|</details>}}
 +
</div>}} |}}<!--
  
  
Line 149: Line 114:
 
<summary>A case you are judging requested to join a class</summary>}}
 
<summary>A case you are judging requested to join a class</summary>}}
 
<h2>Case information</h2>
 
<h2>Case information</h2>
 +
<div class="info-row"><b>Case ID</b>{{#explode:@@@|<PROP>|3}}</div>
 
<div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
 
<div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:@@@|<PROP>|7}}</div></div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:@@@|<PROP>|7}}</div></div>
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|@@@|}}</div>
+
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|{{#widget:link|href=@@@|text={{#regex:@@@|/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)(.+)/|$1}}|type=a}}|<br>}}</div>
 
<div class="info-row"><b>Link</b>{{#ask:[[Class::Suit]][[Case ID::{{#explode:@@@|<PROP>|3}}]]|format=plainlist}}</div>
 
<div class="info-row"><b>Link</b>{{#ask:[[Class::Suit]][[Case ID::{{#explode:@@@|<PROP>|3}}]]|format=plainlist}}</div>
 
<h2>Class information</h2>
 
<h2>Class information</h2>
Line 168: Line 134:
 
<div class="info-row"><b>Description</b>{{#explode:{{#var:@classinfo}}|<PROP>|6}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:{{#var:@classinfo}}|<PROP>|6}}</div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:{{#var:@classinfo}}|<PROP>|7}}</div></div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:{{#var:@classinfo}}|<PROP>|7}}</div></div>
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:{{#var:@classinfo}}|<PROP>|9}}|,|@@@|@@@|}}</div>
+
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:{{#var:@classinfo}}|<PROP>|9}}|,|@@@|{{#widget:link|href=@@@|text={{#regex:@@@|/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)(.+)/|$1}}|type=a}}|<br>}}</div>
 
<div class="info-row"><b>Link</b>{{#ask:[[Class::Suit]][[Case ID::{{#explode:{{#var:@classinfo}}|<PROP>|3}}]]|format=plainlist}}</div>
 
<div class="info-row"><b>Link</b>{{#ask:[[Class::Suit]][[Case ID::{{#explode:{{#var:@classinfo}}|<PROP>|3}}]]|format=plainlist}}</div>
 
}}<!-- if new -->
 
}}<!-- if new -->
Line 184: Line 150:
 
{{#tag:wsfield||type=hidden|name=Type|value=Class }}
 
{{#tag:wsfield||type=hidden|name=Type|value=Class }}
 
{{#tag:wsfield||type=hidden|name=Filed by|value={{#explode:@@@|<PROP>|2}} }}
 
{{#tag:wsfield||type=hidden|name=Filed by|value={{#explode:@@@|<PROP>|2}} }}
{{#tag:wsfield||type=hidden|name=Random judge|value={{#ask:[[Class::Member]][[Role::Judge]][[!{{FULLPAGENAME}}]]|Limit=1|format=array|order=random}} }}
+
{{#tag:wsfield||type=hidden|name=Random judge|value={{#ask:[[User group::icol-user]][[Class::Member]][[Role::Judge]][[!{{FULLPAGENAME}}]]|Limit=1|format=array|order=random}} }}
 
{{#tag:wsfield||type=hidden|name=Case ID|value=1234-{{#time: U | now}}-{{#time: U | now}} }}
 
{{#tag:wsfield||type=hidden|name=Case ID|value=1234-{{#time: U | now}}-{{#time: U | now}} }}
 
{{#tag:wsfield||type=hidden|name=Class case IDs|value={{{Workflow|}}} }}
 
{{#tag:wsfield||type=hidden|name=Class case IDs|value={{{Workflow|}}} }}
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Class request|value=Approved}}
+
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Class request|value=Approved}}<!--
 +
-->{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Stage|value=Settled}}
 
{{#tag:wsfield||type=submit|value=Approve request|class=btn btn-green btn-half }}
 
{{#tag:wsfield||type=submit|value=Approve request|class=btn btn-green btn-half }}
 
|action=addToWiki}}
 
|action=addToWiki}}
 
|{{#tag:wsform|
 
|{{#tag:wsform|
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Class request|value=Approved}}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Class request|value=Approved}}
 +
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Stage|value=Settled}}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:{{#var:@classinfo}}|<PROP>|0}}}}|template=Workflow|formfield=Class case IDs|value={{#if:{{#explode:{{#var:@classinfo}}|<PROP>|11}}| {{#arraymap:{{#explode:{{#var:@classinfo}}|<PROP>|11}}|<MANY>|###|###|,}} , {{#explode:@@@|<PROP>|0}}  |{{#explode:@@@|<PROP>|0}} }} }}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:{{#var:@classinfo}}|<PROP>|0}}}}|template=Workflow|formfield=Class case IDs|value={{#if:{{#explode:{{#var:@classinfo}}|<PROP>|11}}| {{#arraymap:{{#explode:{{#var:@classinfo}}|<PROP>|11}}|<MANY>|###|###|,}} , {{#explode:@@@|<PROP>|0}}  |{{#explode:@@@|<PROP>|0}} }} }}
 
{{#tag:wsfield||type=submit|value=Approve request|class=btn btn-green btn-half }}
 
{{#tag:wsfield||type=submit|value=Approve request|class=btn btn-green btn-half }}
Line 226: Line 194:
 
|}}
 
|}}
  
{{#arraymap:{{#ask:[[Class::Workflow]][[Random judge::{{FULLPAGENAME}}]]|?Declined judge|?Filed by|?Case ID|?Lie|?Topic|?Description|?Markup|?Facts|?Locations|?Type|?Class case IDs|link=none|format=array|sep=$$$}}|$$$|@@@|
+
{{#arraymap:{{#ask:[[Class::Workflow]][[Random judge::{{FULLPAGENAME}}]]|?Declined judge|?Filed by|?Case ID|?Lie|?Topic|?Description|?Markup|?Facts|?Locations|?Type|?Class case IDs|?Reason for judge decline|link=none|format=array|sep=$$$}}|$$$|@@@|
 
<div class="info-item">
 
<div class="info-item">
 
{{#tag:html|<details>
 
{{#tag:html|<details>
 
<summary>You have been selected as a {{#ifeq:{{#explode:@@@|<PROP>|10}}|Class|Class&nbsp;}}Judge</summary>}}
 
<summary>You have been selected as a {{#ifeq:{{#explode:@@@|<PROP>|10}}|Class|Class&nbsp;}}Judge</summary>}}
 
+
<div class="d-none suit-ace">
 
{{#ifeq:{{#explode:@@@|<PROP>|10}}|Class|<h2>Class cases information</h2>{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|###|<div class="info-row">Case: ###</div>|}}|<h2>Case information</h2><div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
 
{{#ifeq:{{#explode:@@@|<PROP>|10}}|Class|<h2>Class cases information</h2>{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|###|<div class="info-row">Case: ###</div>|}}|<h2>Case information</h2><div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:@@@|<PROP>|7}}</div></div>
 
<div class="info-row"><b>Marked truth and lies </b><div class="lie-input">{{#explode:@@@|<PROP>|7}}</div></div>
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|@@@|}}</div>
+
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|{{#widget:link|href=@@@|text={{#regex:@@@|/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)(.+)/|$1}}|type=a}}|<br>}}</div>
 +
<div class="info-row"><b>Screenshot</b>{{#vardefine:@counter|0}}{{#arraymap:{{#ask:[[Class::Case file]][[Case file::{{#explode:@@@|<PROP>|3}}]]|?=|?Modification date|Format=array|link=none}}|,|@@@|{{#widget:link |type=a|href=#image-modal-{{#var:@counter}} |datatoggle=modal |class=attachment  |text={{fa|image}} }}<!--
 +
 
 +
-->{{Modal
 +
|Targetid=image-modal-{{#var:@counter}}
 +
|Dialog class=image-modal
 +
|ModalHeading=Image
 +
|BodyText=[[{{#explode:@@@|<PROP>|0}}]]Uploaded on: {{#explode:@@@|<PROP>|1}}
 +
|FooterText={{#widget:link |type=a|href=#image-modal-{{#var:@counter}} |datatoggle=modal |class=btn btn-submit  |text=close}}
 +
|Hide link=Yes
 +
}}<!--
 +
-->|}} </div>
 
<h2>Plaintiff verdict</h2>
 
<h2>Plaintiff verdict</h2>
 
{{#vardefine:@plver|{{#ask:[[Class::Verdict]][[Context::None]][[Case ID::{{#explode:@@@|<PROP>|3}}]][[Role::Plaintiff]]
 
{{#vardefine:@plver|{{#ask:[[Class::Verdict]][[Context::None]][[Case ID::{{#explode:@@@|<PROP>|3}}]][[Role::Plaintiff]]
Line 280: Line 259:
 
<div class="info-row"><b>What is the Motivation behind the Lie?</b>{{#vardefine:@mv|0}}{{#arraymap:{{#explode:{{#var:@plver}}|<PROP>|19}}|,|%%%|%%% <span class="percnt">{{#explode:{{#explode:{{#var:@plver}}|<PROP>|20}}|,|{{#var:@mv}}}}%</span><br>{{#explode:{{#explode:{{#var:@plver}}|<PROP>|21}}|,|{{#var:@mv}}}}{{#vardefine:@mv|{{#expr:{{#var:@mv}} + 1}} }} |<br>}}</div>
 
<div class="info-row"><b>What is the Motivation behind the Lie?</b>{{#vardefine:@mv|0}}{{#arraymap:{{#explode:{{#var:@plver}}|<PROP>|19}}|,|%%%|%%% <span class="percnt">{{#explode:{{#explode:{{#var:@plver}}|<PROP>|20}}|,|{{#var:@mv}}}}%</span><br>{{#explode:{{#explode:{{#var:@plver}}|<PROP>|21}}|,|{{#var:@mv}}}}{{#vardefine:@mv|{{#expr:{{#var:@mv}} + 1}} }} |<br>}}</div>
 
<div class="info-row"><b>What is the Social Acceptability for the lie?</b>{{#explode:{{#var:@plver}}|<PROP>|22}} <span class="percnt">{{#explode:{{#var:@plver}}|<PROP>|23}}%</span><br>{{#explode:{{#var:@plver}}|<PROP>|24}}</div>
 
<div class="info-row"><b>What is the Social Acceptability for the lie?</b>{{#explode:{{#var:@plver}}|<PROP>|22}} <span class="percnt">{{#explode:{{#var:@plver}}|<PROP>|23}}%</span><br>{{#explode:{{#var:@plver}}|<PROP>|24}}</div>
<div class="info-row"><b>What is the label for the lie needed to Improve the Social Acceptability?</b>{{#explode:{{#var:@plver}}|<PROP>|25}} <span class="percnt">{{#explode:{{#var:@plver}}|<PROP>|26}}%</span><br>{{#explode:{{#var:@plver}}|<PROP>|27}}</div>}}
+
<div class="info-row"><b>What is the label for the lie needed to Improve the Social Acceptability?</b>{{#explode:{{#var:@plver}}|<PROP>|25}} <span class="percnt">{{#explode:{{#var:@plver}}|<PROP>|26}}%</span><br>{{#explode:{{#var:@plver}}|<PROP>|27}}</div>}}</div>
 +
{{#if:{{#explode:@@@|<PROP>|12}}|<h2>Former selected judge declined</h2>
 +
<div class="info-row"><b>Reason</b>{{#explode:@@@|<PROP>|12}}</div>}}
 
{{#tag:wsform|<h2>Reason for decline</h2>  
 
{{#tag:wsform|<h2>Reason for decline</h2>  
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Random judge|value={{#ask:[[Class::Member]]{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}[[!{{#explode:@@@|<PROP>|2}}]][[!{{FULLPAGENAME}}]][[Role::Judge]]|Limit=1|format=array|order=random}}}}
+
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Random judge|value={{#ask:[[User group::icol-user]][[Class::Member]]{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}[[!{{#explode:@@@|<PROP>|2}}]][[!{{FULLPAGENAME}}]][[Role::Judge]]|Limit=1|format=array|order=random}}}}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Declined judge|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|@@@|,}}, {{FULLPAGENAME}}| {{FULLPAGENAME}} }} }}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Declined judge|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|@@@|,}}, {{FULLPAGENAME}}| {{FULLPAGENAME}} }} }}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Reason for judge decline}}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}} }}|template=Workflow|formfield=Reason for judge decline}}
Line 288: Line 269:
 
{{#tag:wsfield||type=submit|value=Save|class=btn btn-green}}
 
{{#tag:wsfield||type=submit|value=Save|class=btn btn-green}}
 
|action=addToWiki|class=d-none pb-4|id=dec-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}} }}
 
|action=addToWiki|class=d-none pb-4|id=dec-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}} }}
<div class="d-flex justify-content-center pb-4" id="{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}">{{#tag:wsfield|Decline judge role|type=button|onclick=openInput('dec','{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}')|class=btn btn-half btn-red}}{{#tag:wsfield|Accept judge role|type=button|onclick=submitInput('{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}')|class=btn btn-half btn-green}}</div>
+
<div class="d-flex justify-content-center pb-4" id="{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}">{{#tag:wsfield|Decline judge role|type=button|onclick=openInput('dec','{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}')|class=btn btn-half btn-red}}{{#tag:wsfield|Accept judge role|type=button|onclick=this.closest('.info-item').querySelector('.suit-ace').classList.remove('d-none');this.setAttribute('onclick', 'submitInput(\'{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}\')' );this.innerText ='Approve case';this.closest('.d-flex').querySelector('.btn-red').innerText = 'Disapprove case'|class=btn btn-half btn-green}}</div><!--submitInput('{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}'-->
 
{{#tag:wsform|
 
{{#tag:wsform|
 
{{#tag:wscreate||mwwrite=Participant/|mwtemplate=Participant|mwoption=range:00001-99999|mwfollow=true}}
 
{{#tag:wscreate||mwwrite=Participant/|mwtemplate=Participant|mwoption=range:00001-99999|mwfollow=true}}
Line 299: Line 280:
 
{{#tag:wsfield||type=hidden|name=Workflow|value={{#explode:@@@|<PROP>|0}} }}
 
{{#tag:wsfield||type=hidden|name=Workflow|value={{#explode:@@@|<PROP>|0}} }}
 
{{#tag:wsfield||type=submit|value=Save|class=btn btn-green mt-4|id=submit-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}}}
 
{{#tag:wsfield||type=submit|value=Save|class=btn btn-green mt-4|id=submit-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}}}}
|action=addToWiki|class=d-none pb-4|id=acp-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}} }}
+
|action=addToWiki|class=d-none pb-4|id=acp-{{#explode:{{#explode:@@@|<PROP>|0}}|/|1}} }}</div>
 
{{#tag:html|</details>}}
 
{{#tag:html|</details>}}
</div>
 
 
|}}
 
|}}
{{#arraymap:{{#ask:[[Class::Workflow]][[Random juror::{{FULLPAGENAME}}]]|?Declined juror|?Filed by|?Case ID|?Lie|?Topic|?Description|?Lies|?Facts|?Locations|?Juror amount|?Jurors|?Judge|?Random Juror|link=none|format=array|sep=$$$}}|$$$|@@@|
+
{{#arraymap:{{#ask:[[Class::Workflow]][[Random juror::{{FULLPAGENAME}}]]|?Declined juror|?Filed by|?Case ID|?Lie|?Topic|?Description|?Markup|?Facts|?Locations|?Juror amount|?Jurors|?Judge|?Random juror|?Suit date|link=none|format=array|sep=$$$}}|$$$|@@@|
 
<div class="info-item">
 
<div class="info-item">
 
{{#tag:html|<details>
 
{{#tag:html|<details>
 
<summary>You have been selected as a Juror</summary>}}
 
<summary>You have been selected as a Juror</summary>}}
 
<h2>Case information</h2>
 
<h2>Case information</h2>
<div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
+
<div class="info-row"><b>Suit date</b>{{#time:d M Y|{{#explode:@@@|<PROP>|14}} }}</div>
 +
<!--<div class="info-row"><b>Lie</b>{{#explode:@@@|<PROP>|4}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Topic</b>{{#explode:@@@|<PROP>|5}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
 
<div class="info-row"><b>Description</b>{{#explode:@@@|<PROP>|6}}</div>
<div class="info-row"><b>Lies</b>{{#arraymap:{{#explode:@@@|<PROP>|7}}|,|@@@|@@@|}}</div>
+
<div class="info-row"><b>Marked-up Truth and Lies</b><div class="lie-input">{{#explode:@@@|<PROP>|7}}</div></div>
<div class="info-row"><b>Facts</b>{{#arraymap:{{#explode:@@@|<PROP>|8}}|,|@@@|@@@|}}</div>
+
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|{{#widget:link|href=@@@|text={{#regex:@@@|/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)(.+)/|$1}}|type=a}}|<br>}}</div>-->
<div class="info-row"><b>Locations</b>{{#arraymap:{{#explode:@@@|<PROP>|9}}|,|@@@|@@@|}}</div>
+
{{#arraydefine:@jurrors|{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|@@@|@@@|,}} }}
{{#arraydefine:@jurrors|{{#explode:@@@|<PROP>|11}} }}
 
 
<div class="d-flex justify-content-center pb-4">
 
<div class="d-flex justify-content-center pb-4">
{{#tag:wsform|  
+
{{#tag:wsform| {{#arraydefine:@random juror|{{#explode:@@@|<PROP>|13}}|<MANY>}}{{#arraydefine:@user|{{FULLPAGENAME}} }}{{#arraydiff:new_key|@random juror|@user}}
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value={{#ask:[[Class::Member]][[!{{{Filed by|}}}]][[Role::Juror]][[!{{#explode:@@@|<PROP>|12}}]][[!{{#explode:@@@|<PROP>|13}}]]{{#arraymap:{{#explode:@@@|<PROP>|11}}|,|@@@|[[!@@@]]|}}{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}|Limit=1|format=array|order=random}} }}
+
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value={{#if:{{#arrayprint:new_key}}| {{#arrayprint:new_key}}, }}{{#ask:[[User group::icol-user]][[Class::Member]][[!{{FULLPAGENAME}}]][[Role::Juror]][[!{{#explode:@@@|<PROP>|12}}]]{{#arraymap:{{#explode:@@@|<PROP>|13}}|<MANY>|@@@|[[!@@@]]|}}{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|@@@|[[!@@@]]|}}{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}|Limit={{#expr:{{#explode:@@@|<PROP>|10}} {{#if:{{#arrayprint:new_key}}|- {{#arraysize:new_key}}| - 0 }} }}|format=array|order=random}} }}
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Declined juror|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|@@@|,}}, {{#explode:@@@|<PROP>|13}}| {{#explode:@@@|<PROP>|13}} }} }}
+
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Declined juror|value={{#if:{{#explode:@@@|<PROP>|1}}|{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|@@@|,}}, {{FULLPAGENAME}}| {{FULLPAGENAME}} }} }}
 
{{#ifexpr:{{#arraysize:@jurrors}} < {{#explode:@@@|<PROP>|10}}|
 
{{#ifexpr:{{#arraysize:@jurrors}} < {{#explode:@@@|<PROP>|10}}|
 
{{#tag:wsfield||type=submit|value=Decline juror role|class=btn btn-red btn-half}}
 
{{#tag:wsfield||type=submit|value=Decline juror role|class=btn btn-red btn-half}}
Line 327: Line 307:
 
{{#tag:wsfield||type=hidden|name=User|value={{FULLPAGENAME}} }}
 
{{#tag:wsfield||type=hidden|name=User|value={{FULLPAGENAME}} }}
 
{{#tag:wsfield||type=hidden|name=Role|value=Juror }}
 
{{#tag:wsfield||type=hidden|name=Role|value=Juror }}
 +
{{#arraydefine:@countjurors|{{#explode:@@@|<PROP>|11}}|<MANY>}}
 +
{{#tag:wsfield||type=hidden|name=Name|value=Juror {{#expr:{{#if:{{#arraysize:@countjurors}}|{{#arraysize:@countjurors}}|0}} + 1}} }}
 +
{{#tag:wsfield||type=hidden|name=Workflow|value={{#explode:@@@|<PROP>|0}} }}
 
{{#tag:wsfield||type=hidden|name=Case ID|value={{#explode:@@@|<PROP>|3}} }}
 
{{#tag:wsfield||type=hidden|name=Case ID|value={{#explode:@@@|<PROP>|3}} }}
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Jurors|value={{#if:{{#explode:@@@|<PROP>|11}}|{{#explode:@@@|<PROP>|11}}, {{#explode:@@@|<PROP>|13}}| {{#explode:@@@|<PROP>|13}} }} }}
+
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Jurors|value={{#if:{{#explode:@@@|<PROP>|11}}|{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|@@@|@@@|,}}, {{FULLPAGENAME}}| {{FULLPAGENAME}} }} }}
 
{{#ifeq:{{#arraysize:@jurrors}}|{{#expr:{{#explode:@@@|<PROP>|10}} - 1 }}|
 
{{#ifeq:{{#arraysize:@jurrors}}|{{#expr:{{#explode:@@@|<PROP>|10}} - 1 }}|
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value=done}}
 
{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value=done}}
  {{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Stage|value=In progress}}|{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value={{#ask:[[Class::Member]][[!{{{Filed by|}}}]][[Role::Juror]][[!{{#explode:@@@|<PROP>|12}}]][[!{{#explode:@@@|<PROP>|13}}]]{{#arraymap:{{#explode:@@@|<PROP>|11}}|,|@@@|[[!@@@]]|}}{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}|Limit=1|format=array|order=random}} }}
+
  {{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Stage|value=In progress}}|<!--
}}
+
-->{{#arraydefine:@random juror|{{#explode:@@@|<PROP>|13}}|<MANY>}}{{#arraydefine:@user|{{FULLPAGENAME}} }}{{#arraydiff:new_key|@random juror|@user}}{{#tag:wsedit||target={{PAGEID:{{#explode:@@@|<PROP>|0}}}}|template=Workflow|formfield=Random juror|value={{#if:{{#arrayprint:new_key}}| {{#arrayprint:new_key}}, }}{{#vardefine:@limit|{{#expr:{{#explode:@@@|<PROP>|10}} {{#if:{{#arrayprint:new_key}}|- {{#arraysize:new_key}}| - 0 }}{{#if:{{#arraysize:@countjurors}}|- {{#arraysize:@countjurors}}|- 0}} }} }}{{#ifexpr:{{#var:@limit}} > 0|{{#ask:[[User group::icol-user]][[Class::Member]][[!{{FULLPAGENAME}}]][[!{{{Filed by|}}}]][[Role::Juror]][[!{{#explode:@@@|<PROP>|12}}]][[!{{#explode:@@@|<PROP>|13}}]]{{#arraymap:{{#explode:@@@|<PROP>|11}}|<MANY>|@@@|[[!@@@]]|}}{{#arraymap:{{#explode:@@@|<PROP>|1}}|<MANY>|@@@|[[!@@@]]|}}|Limit={{#var:@limit}}|format=array|order=random}} }}
 +
}} }}
 
{{#ifexpr:{{#arraysize:@jurrors}} < {{#explode:@@@|<PROP>|10}}|
 
{{#ifexpr:{{#arraysize:@jurrors}} < {{#explode:@@@|<PROP>|10}}|
 
{{#tag:wsfield||type=submit|value=Accept juror role|class=btn btn-green btn-half }}
 
{{#tag:wsfield||type=submit|value=Accept juror role|class=btn btn-green btn-half }}
Line 345: Line 329:
 
</div>
 
</div>
 
</div>
 
</div>
 
<div class="row" >
 
<div class="col-6">{{#ask:[[Class::Participant]][[User::{{FULLPAGENAME}}]][[Role::+]]
 
|?Role
 
|mainlabel=-
 
|format=jqplotchart
 
|charttype=pie
 
|chartlegend=e
 
|distribution=yes
 
|distributionsort=desc
 
|background=none
 
|colorscheme=blues}}</div>
 
<div class="col-6">{{#arraydefine:@cases|{{#ask:[[Class::Participant]][[User::{{FULLPAGENAME}}]][[Workflow.Lie::+]]}} }} Participant in {{#arraysize:@cases}} case{{#ifexpr:{{#arraysize:@cases}} > 1|s}}{{#ask:[[Class::Participant]][[User::{{FULLPAGENAME}}]][[Workflow.Lie::+]]
 
|?Workflow.Lie
 
|mainlabel=-
 
|format=jqplotchart
 
|charttype=pie
 
|chartlegend=e
 
|distribution=yes
 
|distributionsort=desc
 
|background=none
 
|colorscheme=purples}}</div>
 
</div>
 
 
 
 
{{#tag:html|<script>
 
{{#tag:html|<script>
 
function openInput(name, elem){
 
function openInput(name, elem){
Line 377: Line 336:
 
document.getElementById(elem).classList.remove('d-flex');
 
document.getElementById(elem).classList.remove('d-flex');
  
 +
}
 +
 +
function sendTokens(){
 +
    document.getElementById('send-tokens-form').classList.remove('d-none');
 +
    document.getElementById('balance').classList.add('buy');
 +
    document.getElementById('balance').querySelector('button').classList.add('d-none');
 
}
 
}
  
 
function buyMore(){
 
function buyMore(){
 +
    document.getElementById('send-tokens').classList.add('d-none');
 
     document.getElementById('buy-more').classList.remove('d-none');
 
     document.getElementById('buy-more').classList.remove('d-none');
 
     document.getElementById('balance').classList.add('buy');
 
     document.getElementById('balance').classList.add('buy');
Line 396: Line 362:
  
 
if(formnumber.value > 0){
 
if(formnumber.value > 0){
document.querySelector('#buyButton').removeAttribute('disabled');
+
//document.querySelector('#buyButton').removeAttribute('disabled');
  
 
if(formnumber.value > -1){
 
if(formnumber.value > -1){
Line 403: Line 369:
 
}
 
}
 
}else{
 
}else{
document.querySelector('#buyButton').setAttribute('disabled','disabled');
+
//document.querySelector('#buyButton').setAttribute('disabled','disabled');
 
}
 
}
  

Revision as of 13:29, 7 December 2020


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

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