Difference between revisions of "Template:User"

From cm2.liecourt.com
(Fill database)
Line 13: Line 13:
 
|Name=
 
|Name=
 
|Filed by=
 
|Filed by=
 +
|be candidate=
 
}}
 
}}
 
</pre>
 
</pre>
 
<!--{{User }}-->
 
<!--{{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, Judge}}|+sep=,|User={{{User|}}}|Name={{{Name|}}}|Email={{{Email|}}}|Volunteer={{{Volunteer|}}}|Tokens spent={{{Tokens spent|}}}|Pagename={{FULLPAGENAME}} }} }}
+
<div class="d-none">__NOTITLE__ __NOTOC__{{#if:{{{Name|}}}|{{#set:Class=Member|Role={{#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}}}}}}  
Line 48: Line 49:
 
{{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={{{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>

Revision as of 14:37, 22 May 2020


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

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