Difference between revisions of "Template:Participant"

From cm2.liecourt.com
(Undo revision 3252 by Merel (talk))
(Tag: Undo)
(Undo revision 3251 by Merel (talk))
(Tag: Undo)
Line 180: Line 180:
 
}}<!--
 
}}<!--
  
-->{{#arraymap:{{#ask:[[Class::Verdict]][[Case ID::{{{Case ID|}}}]][[User::!{{{User|}}}]][[Locked::True]]|?Role|link=none|format=array}}|,|@@@|  
+
-->{{#arraymap:{{#ask:[[Class::Verdict]][[Case ID::{{{Case ID|}}}]][[User::!{{{User|}}}]]|?Role|link=none|format=array}}|,|@@@|  
 
{{#tag:html|<details>
 
{{#tag:html|<details>
 
<summary>{{#explode:@@@|<PROP>|1}} verdict</summary>
 
<summary>{{#explode:@@@|<PROP>|1}} verdict</summary>
Line 205: Line 205:
 
{{Item responsive |Cols={{#var:@cols|2-10}}
 
{{Item responsive |Cols={{#var:@cols|2-10}}
 
|1=<b>Jurors:</b>
 
|1=<b>Jurors:</b>
|2=<!--
+
|2={{#vardefine:zz|{{#ask:[[{{{Workflow|}}}]]|?Random juror|?Declined juror|?Judge|?Filed by|?Jurors|format=array|link=none}} }}
-->{{#vardefine:zz|{{#ask:[[{{{Workflow|}}}]]|?Random juror|?Declined juror|?Judge|?Filed by|?Jurors|format=array|link=none}} }}<!--
+
{{#vardefine:@countjur|0}}{{#arraymap:{{#ask:[[Class::Participant]][[Workflow::{{{Workflow|}}}]][[Role::Juror]]|?Role|?Name|?User|format=array|link=none}}|,|@@@|{{#if:{{#explode:@@@|<PROP>|2}}|<div class="btn btn-green btn-square">{{#explode:@@@|<PROP>|2}}<br><small>Accepted</small>{{#tag:wsform|{{#arraydefine:@random juror|{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Random juror|format=array|link=none}}|<PROP>|1}}|<MANY>}}{{#arraydefine:@user|{{#explode:@@@|<PROP>|3}} }}{{#arraydiff:new_key|@random juror|@user}}{{#arraydefine:@Jurorsarr|{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Jurors|format=array|link=none}}|<PROP>|1}}|<MANY>}}
-->{{#vardefine:@countjur|0}}<!--
+
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Random juror|value={{#if:{{#arrayprint:new_key}}| {{#arrayprint:new_key}}, }}{{#ask:[[Online since::>{{#time: r | now - 1 hour}}]][[User group::icol-user]][[Class::Member]][[!{{#explode:@@@|<PROP>|3}}]][[Role::Juror]][[!{{#explode:{{#var:zz}}|<PROP>|4}}]][[!{{#explode:{{#var:zz}}|<PROP>|3}}]]{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|1}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|5}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|[[!###]]|}}|Limit=1|format=array|order=random
-->{{#arraymap:{{#ask:[[Class::Participant]][[Workflow::{{{Workflow|}}}]][[Role::Juror]]|?Role|?Name|?User|format=array|link=none}}|,|@@@|<!--
+
|default={{#ask:[[User group::icol-user]][[Class::Member]][[!{{#explode:@@@|<PROP>|3}}]][[Role::Juror]][[!{{#explode:{{#var:zz}}|<PROP>|4}}]][[!{{#explode:{{#var:zz}}|<PROP>|3}}]]{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|1}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|5}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|[[!###]]|}}|Limit=1|format=array|order=random}} }} }}
    -->{{#if:{{#explode:@@@|<PROP>|2}}|<!--
+
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Declined juror|value={{#if:{{#explode:{{#var:zz}}|<PROP>|2}}|{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|###|,}}, {{#explode:@@@|<PROP>|3}}| {{#explode:@@@|<PROP>|3}} }} }}
        --><div class="btn btn-green btn-square"><!--
+
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Jurors|value={{#arraydiff:jrs|@Jurorsarr|@user}}{{#arrayprint:jrs}} }}
            -->{{#explode:@@@|<PROP>|2}}<!--
+
{{#tag:wsfield||type=submit|value=x|class=remove-juror}}
            --><br><small>Accepted</small><!--
+
|action=addToWiki}}</div>|<div class="btn btn-green btn-square">{{#explode:@@@|<PROP>|1}}<br><small>Accepted</small></div>}}{{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}|}}<!--  
              --></div><!--
+
-->{{#arraymap:{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Random juror|format=array|link=none}}|<PROP>|1}}|<MANY>|@@@|{{#ifeq:@@@|done||<div class="btn btn-gray btn-square"> Juror {{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}{{#var:@countjur}}<br><small>Invited<!-- 1 day ago --></small><br><!--
          -->|<div class="btn btn-green btn-square"><!--
+
 
                -->{{#explode:@@@|<PROP>|1}}<br><small>Accepted</small></div>}}{{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}|}}<!--  
+
 
                -->{{#arraymap:{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Random juror|format=array|link=none}}|<PROP>|1}}|<MANY>|@@@|<!--
+
-->{{#tag:wsform|{{#arraydefine:@random juror|{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Random juror|format=array|link=none}}|<PROP>|1}}|<MANY>}}{{#arraydefine:@user|@@@ }}{{#arraydiff:new_key|@random juror|@user}}
                      -->{{#ifeq:@@@|done||<div class="btn btn-gray btn-square"> Juror {{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}{{#var:@countjur}}<br><small>Invited<!-- 1 day ago --></small><br><!--
+
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Random juror|value={{#if:{{#arrayprint:new_key}}| {{#arrayprint:new_key}}, }}{{#ask:[[Online since::>{{#time: r | now - 1 hour}}]][[User group::icol-user]][[Class::Member]][[!{{#explode:@@@|<PROP>|3}}]][[Role::Juror]][[!{{#explode:{{#var:zz}}|<PROP>|4}}]][[!{{#explode:{{#var:zz}}|<PROP>|3}}]]{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|1}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|5}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|[[!###]]|}}|Limit=1|format=array|order=random
--></div>}} |}}
+
|default={{#ask:[[User group::icol-user]][[Class::Member]][[!{{#explode:@@@|<PROP>|3}}]][[Role::Juror]][[!{{#explode:{{#var:zz}}|<PROP>|4}}]][[!{{#explode:{{#var:zz}}|<PROP>|3}}]]{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|1}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|5}}|<MANY>|###|[[!###]]|}}{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|[[!###]]|}}|Limit=1|format=array|order=random}} }} }}
 +
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Declined juror|value={{#if:{{#explode:{{#var:zz}}|<PROP>|2}}|{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|###|,}}, @@@| @@@ }} }}
 +
<!--{{#tag:wsfield||type=submit|value=x|class=remove-juror}}-->
 +
|action=addToWiki}}</div>}} |}}
 
}}<!--  
 
}}<!--  
 
  -->{{#vardefine:@tokenstats|<nowiki>{{subst:#ttaward:</nowiki>{{PAGENAME:{{#show:{{{Workflow}}}|?Filed by|link=none}} }}<nowiki>}}</nowiki>}}
 
  -->{{#vardefine:@tokenstats|<nowiki>{{subst:#ttaward:</nowiki>{{PAGENAME:{{#show:{{{Workflow}}}|?Filed by|link=none}} }}<nowiki>}}</nowiki>}}
Line 255: Line 258:
 
<div class="clear-both"></div><!--  
 
<div class="clear-both"></div><!--  
 
--><wsfield type="button" onclick="changeJurors()" class="btn btn-green mb-4 mt-4 float-left d-none " >Change suit</wsfield>
 
--><wsfield type="button" onclick="changeJurors()" class="btn btn-green mb-4 mt-4 float-left d-none " >Change suit</wsfield>
<wsfield type="submit" value="Change suit" id="change-suit" class="btn btn-green mb-4 d-none"/>
+
<wsfield type="submit" value="Change suit" id="change-suit" class="btn btn-green mb-4 "/>
 
{{#tag:html|<script>
 
{{#tag:html|<script>
 
       var oldjurrors = document.getElementById('jurors').querySelector('input').value;
 
       var oldjurrors = document.getElementById('jurors').querySelector('input').value;
Line 295: Line 298:
  
  
--><div class="box"><h2>Your verdict :</h2><!--
+
--><div class="box"><h2>Your verdict :</h2>{{#vardefine:@verdict|{{#ask:[[Class::Verdict]][[Case ID::{{{Case ID|}}}]][[User::{{{User|}}}]]|link=none}} }}{{#if:{{#var:@verdict}}|{{verdict results|Verdict={{#var:@verdict}} }}<br><!--
-->{{#vardefine:@verdict|{{#ask:[[Class::Verdict]][[Case ID::{{{Case ID|}}}]][[User::{{{User|}}}]]|link=none}} }}<!--
+
-->{{#ifeq:{{#show:{{{Workflow|}}}|?Stage}}|Settled| |{{#widget:link|type=a|href={{fullurl:{{#var:@verdict}}|Participant={{#var:@fullpagename}} }}|text=Edit verdict|class=btn btn-green }} }}|<!--
-->{{#if:{{#var:@verdict}}<!--
 
  -->|<!--
 
      -->{{verdict results|Verdict={{#var:@verdict}} }}<br><!--
 
      -->{{#ifeq:{{#show:{{{Workflow|}}}|?Stage}}|Settled| |<!--
 
        -->{{#ifeq:{{#show:{{#var:@verdict}}|?Locked|link=none}}|True| |<!--
 
        -->{{#widget:link|type=a|href={{fullurl:{{#var:@verdict}}|Participant={{#var:@fullpagename}} }}|text=Edit verdict|class=btn btn-green }}<!--
 
        -->}}<!--
 
      -->}}<!--
 
  -->|<!--
 
 
--><wsform action="addToWiki">{{#ifeq:{{{Role|}}}|Juror|{{#vardefine:@verdictdate|{{#show:{{{Workflow}}}|?Suit date|link=none}} }} {{#if:{{#var:@verdictdate}}|Create your Verdict before {{#var:@verdictdate}} }}<br>  }}  
 
--><wsform action="addToWiki">{{#ifeq:{{{Role|}}}|Juror|{{#vardefine:@verdictdate|{{#show:{{{Workflow}}}|?Suit date|link=none}} }} {{#if:{{#var:@verdictdate}}|Create your Verdict before {{#var:@verdictdate}} }}<br>  }}  
 
<wscreate mwwrite="Verdict:{{{Case ID|}}}/" mwtemplate="Verdict" mwoption="range:00001-99999"  mwfollow/>
 
<wscreate mwwrite="Verdict:{{{Case ID|}}}/" mwtemplate="Verdict" mwoption="range:00001-99999"  mwfollow/>

Revision as of 09:53, 29 March 2022


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

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