Difference between revisions of "Template:Participant"

From cm2.liecourt.com
(Undo revision 3251 by Merel (talk))
(Tag: Undo)
 
(6 intermediate revisions by 2 users not shown)
Line 107: Line 107:
 
<div class="row ">
 
<div class="row ">
 
<div class="col-12 col-lg-8 ">
 
<div class="col-12 col-lg-8 ">
<div class="box"><div class="d-flex justify-content-between"><h2>Case information</h2> {{#ifeq:{{{Role|}}}|Plaintiff|{{#widget:link|type=a|text=Edit|class=btn-green|href={{fullurl:edit case|id={{#replace:{{{Workflow|}}}|Workflow/| }} }} }} }}</div><!--
+
<div class="box"><div class="d-flex justify-content-between"><h2>Case information</h2> {{#ifeq:{{{Role|}}}|Plaintiff|{{#widget:link|type=a|text=Edit|class=btn-green|onclick=this.classList.add('pending') |href={{fullurl:edit case|id={{#replace:{{{Workflow|}}}|Workflow/| }} }} }} }}</div><!--
 
-->{{#ifeq:{{#show:{{{Workflow}}}|?Stage }}|Settled|| {{#if:{{#var:@judge}}|<!--
 
-->{{#ifeq:{{#show:{{{Workflow}}}|?Stage }}|Settled|| {{#if:{{#var:@judge}}|<!--
  
Line 198: Line 198:
 
   {{#tag:wsedit||target={{PAGEID:{{{Workflow|}}} }}|template=Workflow|formfield=Stage|value=Needs judge}}
 
   {{#tag:wsedit||target={{PAGEID:{{{Workflow|}}} }}|template=Workflow|formfield=Stage|value=Needs judge}}
 
  {{#tag:wsedit||target={{PAGEID:{{{Workflow|}}} }}|template=Workflow|formfield=Random judge|value={{#var:@randomjudge}} }}
 
  {{#tag:wsedit||target={{PAGEID:{{{Workflow|}}} }}|template=Workflow|formfield=Random judge|value={{#var:@randomjudge}} }}
   {{#tag:wsfield||type=submit|class=btn btn-green|value=Invite Judge}}
+
   {{#tag:wsfield||type=submit|class=btn btn-green|value=Invite Judge |onclick=this.classList.add('pending') }}
 
   |action=addToWiki|mwreturn={{fullurl:{{FULLPAGENAME}} }} }}
 
   |action=addToWiki|mwreturn={{fullurl:{{FULLPAGENAME}} }} }}
 
}} }}<!--
 
}} }}<!--
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={{#vardefine:zz|{{#ask:[[{{{Workflow|}}}]]|?Random juror|?Declined juror|?Judge|?Filed by|?Jurors|format=array|link=none}} }}
+
|2=<!--
{{#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:zz|{{#ask:[[{{{Workflow|}}}]]|?Random juror|?Declined juror|?Judge|?Filed by|?Jurors|format=array|link=none}} }}<!--
{{#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
+
-->{{#vardefine:@countjur|0}}<!--
|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}} }} }}
+
-->{{#arraymap:{{#ask:[[Class::Participant]][[Workflow::{{{Workflow|}}}]][[Role::Juror]]|?Role|?Name|?User|format=array|link=none}}|,|@@@|<!--
{{#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}} }} }}
+
    -->{{#vardefine:@hasVerdict|{{#ask:[[Class::Verdict]][[Workflow::{{{Workflow|}}}]][[User::{{#explode:@@@|<PROP>|3}}]]|?Truth|format=plainlist|mainlabel=-|headers=hide|link=none}} }}<!--
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Jurors|value={{#arraydiff:jrs|@Jurorsarr|@user}}{{#arrayprint:jrs}} }}
+
    -->{{#if:{{#explode:@@@|<PROP>|2}}|<!--
{{#tag:wsfield||type=submit|value=x|class=remove-juror}}
+
        --><div class="btn {{#if:{{#var:@hasVerdict}}|btn-yellow|btn-green}} btn-square"><!--
|action=addToWiki}}</div>|<div class="btn btn-green btn-square">{{#explode:@@@|<PROP>|1}}<br><small>Accepted</small></div>}}{{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}|}}<!--  
+
            -->{{#explode:@@@|<PROP>|2}}<!--
-->{{#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><!--
+
            --><br><small>{{#if:{{#var:@hasVerdict}}|Saved verdict|Accepted}}</small><!--
 
+
              --></div><!--
 
+
          -->|<div class="btn {{#if:{{#var:@hasVerdict}}|btn-yellow|btn-green}} btn-square"><!--
-->{{#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}}
+
                -->{{#explode:@@@|<PROP>|1}}<br><small>Accepted</small></div>}}{{#vardefine:@countjur|{{#expr:{{#var:@countjur}} + 1}} }}|}}<!--  
{{#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:{{#explode:{{#ask:[[{{{Workflow|}}}]]|?Random juror|format=array|link=none}}|<PROP>|1}}|<MANY>|@@@|<!--
|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}} }} }}
+
                      -->{{#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=Declined juror|value={{#if:{{#explode:{{#var:zz}}|<PROP>|2}}|{{#arraymap:{{#explode:{{#var:zz}}|<PROP>|2}}|<MANY>|###|###|,}}, @@@| @@@ }} }}
+
--></div>}} |}}
<!--{{#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 237: Line 235:
  
 
  -->{{#ifeq:{{PAGENAME:{{#show:{{{Workflow}}}|?Filed by|link=none}} }}|{{#var:@currentuser}}|<wsfield type="button" disabled="disabled" class="btn btn-green mb-4" >Cannot create docket. You're the plaintiff.</wsfield>|
 
  -->{{#ifeq:{{PAGENAME:{{#show:{{{Workflow}}}|?Filed by|link=none}} }}|{{#var:@currentuser}}|<wsfield type="button" disabled="disabled" class="btn btn-green mb-4" >Cannot create docket. You're the plaintiff.</wsfield>|
<wsfield type="submit" value="Create docket" id="submit-docket" class="btn btn-green mb-4  "/>}}<!--
+
<wsfield type="submit" value="Create docket" onclick="this.classList.add('pending');" id="submit-docket" class="btn btn-green mb-4  "/>}}<!--
 
--><!--
 
--><!--
  
Line 258: Line 256:
 
<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 "/>
+
<wsfield type="submit" value="Change suit" id="change-suit" class="btn btn-green mb-4 d-none"/>
 
{{#tag:html|<script>
 
{{#tag:html|<script>
 
       var oldjurrors = document.getElementById('jurors').querySelector('input').value;
 
       var oldjurrors = document.getElementById('jurors').querySelector('input').value;
Line 292: Line 290:
 
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Stage|value=Settled}}
 
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Stage|value=Settled}}
 
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Random juror|value=done}}
 
{{#tag:wsedit||target={{PAGEID:{{{Workflow}}} }}|template=Workflow|formfield=Random juror|value=done}}
<wsfield type="submit" value="Mark case settled" class="btn btn-red mb-4 float-right mt-4"/><div class="clear-both"></div>
+
<wsfield type="submit" id="realSettleButton" value="Mark case settled" onclick="this.classList.add('pending');"  class="btn btn-red mb-4 float-right mt-4 d-none"/><div class="clear-both"></div>
 
</wsform>
 
</wsform>
 
}}</div>}} }}<!--
 
}}</div>}} }}<!--
Line 298: Line 296:
  
  
--><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><!--
+
--><div class="box"><h2>Your verdict :</h2><!--
-->{{#ifeq:{{#show:{{{Workflow|}}}|?Stage}}|Settled| |{{#widget:link|type=a|href={{fullurl:{{#var:@verdict}}|Participant={{#var:@fullpagename}} }}|text=Edit verdict|class=btn btn-green }} }}|<!--
+
-->{{#vardefine:@verdict|{{#ask:[[Class::Verdict]][[Case ID::{{{Case ID|}}}]][[User::{{{User|}}}]]|link=none}} }}<!--
 +
-->{{#if:{{#var:@verdict}}<!--
 +
  -->|<!--
 +
      -->{{verdict results|Verdict={{#var:@verdict}} }}<br><!--
 +
      -->{{#ifeq:{{#show:{{{Workflow|}}}|?Stage}}|Settled| |<!--
 +
        -->{{#widget:link|type=a|href={{fullurl:{{#var:@verdict}}|Participant={{#var:@fullpagename}} }}|text=Edit verdict |onclick=this.classList.add('pending') |class=btn btn-green }} {{#ifeq:{{#show:{{{Workflow}}}|?Stage }}|Settled|| {{#ifeq:{{{Role|}}}|Judge|<wsfield type="button" onclick="$('#realSettleButton').click(); this.classList.add('pending')" class="btn btn-red">Mark case settled</wsfield> }}  }}<!--
 +
      -->}}<!--
 +
  -->|<!--
 
--><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/>
Line 308: Line 313:
 
<wsfield type="hidden" name="Name" value="{{{Name|}}}" />
 
<wsfield type="hidden" name="Name" value="{{{Name|}}}" />
 
<wsfield type="hidden" name="Participant" value="{{#var:@fullpagename}}" />
 
<wsfield type="hidden" name="Participant" value="{{#var:@fullpagename}}" />
<wsfield type="submit" value="Create verdict" class="btn btn-green"/>
+
<wsfield type="submit" value="Create verdict" onclick="this.classList.add('pending');" class="btn btn-green"/>
 
</wsform>}}</div></div><div class="col-12 col-lg-4"><!--
 
</wsform>}}</div></div><div class="col-12 col-lg-4"><!--
 
-->{{#vardefine:@meetingdate|{{#show:{{{Workflow}}}|?Meeting date}} }}{{#if:{{#var:@meetingdate}}|<div class="info-box"><h2>Online meeting</h2>A online meeting with all the participants on this case is planned on <h2>{{#time:d-M-Y|{{#var:@meetingdate}} }}</h2> [[file:zoom.png|150px|link=]]</div>}}
 
-->{{#vardefine:@meetingdate|{{#show:{{{Workflow}}}|?Meeting date}} }}{{#if:{{#var:@meetingdate}}|<div class="info-box"><h2>Online meeting</h2>A online meeting with all the participants on this case is planned on <h2>{{#time:d-M-Y|{{#var:@meetingdate}} }}</h2> [[file:zoom.png|150px|link=]]</div>}}

Latest revision as of 07:49, 8 April 2022


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

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