Difference between revisions of "Template:Participant"

From cm2.liecourt.com
(Fill database)
(Fill database)
Line 17: Line 17:
  
 
</noinclude><includeonly>
 
</noinclude><includeonly>
<div class="d-none">__NOTOC__ __NOTITLE__{{#if:{{{User|}}}|{{#set:Class=Participant|Role={{{Role|}}}|Workflow={{{Workflow|}}}|User={{{User|}}}|Case ID={{{Case ID|}}} }} }}</div><!--
+
<div class="d-none">__NOTOC__ __NOTITLE__{{#if:{{{User|}}}|{{#set:Class=Participant|Role={{{Role|}}}|Workflow={{{Workflow|}}}|User={{{User|}}}|Case ID={{{Case ID|}}}|Name={{{Name|}}} }} }}</div><!--
 
-->{{#vardefine:@allowed|{{#ifeq:User:{{CURRENTLOGGEDUSER}}|{{{User|}}}|Yes|{{#ifsysop:Yes|No}}}}}}
 
-->{{#vardefine:@allowed|{{#ifeq:User:{{CURRENTLOGGEDUSER}}|{{{User|}}}|Yes|{{#ifsysop:Yes|No}}}}}}
 
{{#vardefine:@judge|{{#show:{{{Workflow|}}}|?Judge}} }}
 
{{#vardefine:@judge|{{#show:{{{Workflow|}}}|?Judge}} }}
 
{{#ifeq:{{#var:@allowed}}|Yes|<!--
 
{{#ifeq:{{#var:@allowed}}|Yes|<!--
 
--><div class="row mt-4">
 
--><div class="row mt-4">
<div class="col-12 col-lg-8 mt-4">
+
<div class="col-12 col-lg-8 mt-4"><h1>{{#switch:{{{Role|}}}|Judge={{fa|gavel}}|Plaintiff={{fa|book}}|Juror={{fa|balance-scale}} }}&nbsp;{{#if:{{{Name|}}}|{{{Name|}}}|{{{Role|}}} }}</h1>
 
<!--
 
<!--
 
-->{{#if:{{#var:@judge}}|<!--
 
-->{{#if:{{#var:@judge}}|<!--
Line 226: Line 226:
 
<wsfield type="hidden" name="User" value="{{{User|}}}" />
 
<wsfield type="hidden" name="User" value="{{{User|}}}" />
 
<wsfield type="hidden" name="Role" value="{{{Role|}}}" />
 
<wsfield type="hidden" name="Role" value="{{{Role|}}}" />
 +
<wsfield type="hidden" name="Name" value="{{{Name|}}}" />
 
<wsfield type="hidden" name="Participant" value="{{FULLPAGENAME}}" />
 
<wsfield type="hidden" name="Participant" value="{{FULLPAGENAME}}" />
 
<wsfield type="submit" value="Create verdict" class="btn btn-green"/>
 
<wsfield type="submit" value="Create verdict" class="btn btn-green"/>
Line 232: Line 233:
 
--><div class="info-box">
 
--><div class="info-box">
 
<h2>Chat</h2><!--  
 
<h2>Chat</h2><!--  
  -->{{#arraydefine:@chat|{{#ask:[[Class::Chat]][[Workflow::{{{Workflow|}}}]]|?Message|?Role|?User|?Modification date|format=array|limit=10|sort=Modification date|order=desc}} }}{{#arraysort:@chat|reverse}}<!--  
+
  -->{{#arraydefine:@chat|{{#ask:[[Class::Chat]][[Workflow::{{{Workflow|}}}]]|?Message|?Role|?User|?Modification date|?Name|format=array|limit=10|sort=Modification date|order=desc}} }}{{#arraysort:@chat|reverse}}<!--  
 
  -->{{#ifexpr:{{#arraysize:@chat}} > 9 |<span class="btn btn-green pt-1 pb-1 pr-4 pl-4">{{fa|history}} Load older</span><hr>}}<!--  
 
  -->{{#ifexpr:{{#arraysize:@chat}} > 9 |<span class="btn btn-green pt-1 pb-1 pr-4 pl-4">{{fa|history}} Load older</span><hr>}}<!--  
 
  -->{{#arraymap:{{#arrayprint:@chat}}|,|@@@|  
 
  -->{{#arraymap:{{#arrayprint:@chat}}|,|@@@|  
<div class="chat {{#ifeq:{{#explode:@@@|<PROP>|3}}|{{{User|}}}|me}} "><div class="d-flex"><h3>{{#explode:@@@|<PROP>|2}}</h3><h4 class="pl-2">{{#explode:@@@|<PROP>|4}}</h4></div>{{#explode:@@@|<PROP>|1}}</div>
+
<div class="chat {{#ifeq:{{#explode:@@@|<PROP>|3}}|{{{User|}}}|me}} "><div class="d-flex"><h3>{{#if:{{#explode:@@@|<PROP>|5}}|{{#explode:@@@|<PROP>|5}}|{{#explode:@@@|<PROP>|2}} }}</h3><h4 class="pl-2">{{#explode:@@@|<PROP>|4}}</h4></div>{{#explode:@@@|<PROP>|1}}</div>
 
|}}
 
|}}
  
Line 245: Line 246:
 
<wsfield type="hidden" name="User" value="{{{User|}}}" />
 
<wsfield type="hidden" name="User" value="{{{User|}}}" />
 
<wsfield type="hidden" name="Role" value="{{{Role|}}}" />
 
<wsfield type="hidden" name="Role" value="{{{Role|}}}" />
 +
<wsfield type="hidden" name="Name" value="{{{Name|}}}" />
 
<wsfield type="textarea" name="Message" class="form-control mt-2 mb-2" />
 
<wsfield type="textarea" name="Message" class="form-control mt-2 mb-2" />
 
<div class="d-flex justify-content-end"><wsfield type="submit" value="Send" class="btn btn-green"/></div>
 
<div class="d-flex justify-content-end"><wsfield type="submit" value="Send" class="btn btn-green"/></div>

Revision as of 09:19, 19 May 2020


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

{{Participant
|User=
|Workflow=
|Case ID=
|Role=
}}