Difference between revisions of "Template:Infobox referendum/results/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>L.tak
(registered voters)
imported>Elliot321
(update sandbox)
Line 1: Line 1:
{| border="1" class="wikitable" style="text-align:right; width:25em; margin:0"
+
{| class="wikitable" style="text-align:right; width:27em; margin:0"
|- style="background-color:#E9E9E9"
+
|- style="background-color:#EEEEEE"
! colspan="3" | Results
 
{{!}}- style="background-color:#EEEEEE"
 
 
{{#if: {{{yes|}}} |
 
{{#if: {{{yes|}}} |
! style="width: 17em"                        {{!}}
+
! style="width: 50%;              {{!}} {{left|Response}}
! style="width: 5em"                         {{!}} Votes
+
! scope="col" style="width: 25%"   {{!}} Votes
! style="width: 7em"                         {{!}} %
+
! scope="col" style="width: 25%"   {{!}} %
 
{{!}}-
 
{{!}}-
 
{{#ifexpr: {{formatnum:{{{yes}}}|R}} > {{formatnum:{{{no}}}|R}} |
 
{{#ifexpr: {{formatnum:{{{yes}}}|R}} > {{formatnum:{{{no}}}|R}} |
{{!}} style="text-align: left;"              {{!}} [[Image:Yes_check.svg|14px|link=]] '''{{#if:{{{yes_text|}}}|{{{yes_text}}}|Yes}}'''
+
{{!}} style="text-align: left;"              {{!}} {{#if:{{{yes_text|}}}|'''{{{yes_text}}}'''|[[Image:Yes_check.svg|14px|link=|alt=]] '''Yes'''}}
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{formatnum: {{formatnum:{{{yes}}}|R}} }}'''
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{formatnum: {{formatnum:{{{yes}}}|R}} }}'''
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}'''
+
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}'''
 
{{!}}-
 
{{!}}-
{{!}} style="text-align: left;"              {{!}} [[Image:X_mark.svg|14px|link=]] {{#if:{{{no_text|}}}|{{{no_text}}}|No}}
+
{{!}} style="text-align: left;"              {{!}} {{#if:{{{no_text|}}}|'''{{{no_text}}}'''|[[Image:X_mark.svg|14px|link=|alt=]] '''No'''}}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{no}}}|R}} }}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{no}}}|R}} }}
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
+
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 +
{{!}}-
 +
{{#if:{{{blank|}}}|
 +
{{!}} style="text-align: left;"              {{!}} {{#if:{{{blanktype|}}}|{{{blanktype}}}|Blank votes}}
 +
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{blank}}}|R}} }}
 +
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{blank}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 +
}}
 
{{!}}-
 
{{!}}-
 
{{#if:{{{other|}}}|
 
{{#if:{{{other|}}}|
 
{{!}} style="text-align: left;"              {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
 
{{!}} style="text-align: left;"              {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
+
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 
}}
 
}}
 
|
 
|
{{!}} style="text-align: left;"              {{!}} [[Image:Yes_check.svg|14px|link=]] {{#if:{{{yes_text|}}}|{{{yes_text}}}|Yes}}
+
{{!}} style="text-align: left;"              {{!}} {{#if:{{{yes_text|}}}|{{{yes_text}}}|[[Image:Yes_check.svg|14px|link=|alt=]] Yes}}
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} {{formatnum: {{formatnum:{{{yes}}}|R}} }}
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} {{formatnum: {{formatnum:{{{yes}}}|R}} }}
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} {{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
+
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} {{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 
{{!}}-
 
{{!}}-
{{!}} style="text-align: left;"              {{!}} [[Image:X_mark.svg|14px|link=]] '''{{#if:{{{no_text|}}}|{{{no_text}}}|No}}'''
+
{{!}} style="text-align: left;"              {{!}} {{#if:{{{no_text|}}}|{{{no_text}}}|[[Image:X_mark.svg|14px|link=|alt=]] No}}
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{formatnum: {{formatnum:{{{no}}}|R}} }}'''
 
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{formatnum: {{formatnum:{{{no}}}|R}} }}'''
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}'''
+
{{!}} style="text-align: right;margin-right: 0.5em"            {{!}} '''{{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}'''
 +
{{!}}-
 +
{{#if:{{{blank|}}}|
 +
{{!}} style="text-align: left;"              {{!}} {{#if:{{{blanktype|}}}|{{{blanktype}}}|Blank votes}}
 +
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{blank}}}|R}} }}
 +
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{blank}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 +
}}
 
{{!}}-
 
{{!}}-
 
{{#if:{{{other|}}}|
 
{{#if:{{{other|}}}|
 
{{!}} style="text-align: left;"              {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
 
{{!}} style="text-align: left;"              {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
+
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | pad = {{{pct_prec|2}}} }}
 
}}
 
}}
 
}}
 
}}
Line 41: Line 51:
 
{{#if:{{{invalid|Ø}}}|
 
{{#if:{{{invalid|Ø}}}|
 
{{!}} style="text-align: left"              {{!}} Valid votes
 
{{!}} style="text-align: left"              {{!}} Valid votes
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}
+
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}
{{!}} style="text-align: right;"            {{!}} {{percentage| {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}}|R}} | pad = {{{pct_prec|2}}} }}
+
{{!}} style="text-align: right;"            {{!}} {{percentage| {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}} + {{{invalid}}}|R}} }}}}|R}} | pad = {{{pct_prec|2}}} }}
 
{{!}}- style="background-color:#EEEEEE"
 
{{!}}- style="background-color:#EEEEEE"
{{!}} style="text-align: left"      {{!}} Invalid {{#ifeq:{{{othertype|}}}|Blank votes| |or blank }} votes  
+
{{!}} style="text-align: left"      {{!}} Invalid {{#ifeq:{{{othertype|}}}|Blank votes| |{{#if:{{{blank|}}}| |or blank}} }} votes  
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}} }}
+
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}} }}
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}}|R}} | {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}}|R}} | 2 }}
+
{{!}} style="text-align: right;"            {{!}} {{percentage| {{formatnum:{{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}}|R}} | {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}} + {{{invalid}}}|R}} }}}}|R}} | {{{pct_prec|2}}} | pad = {{{pct_prec|2}}} }}
 
}}
 
}}
 
{{!}}- style="background-color:#EEEEEE"
 
{{!}}- style="background-color:#EEEEEE"
 
{{!}} style="text-align: left"              {{!}} '''Total votes'''{{{totalref|}}}
 
{{!}} style="text-align: left"              {{!}} '''Total votes'''{{{totalref|}}}
{{!}} style="text-align: right;"            {{!}} '''{{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}} }}'''
+
{{!}} style="text-align: right;"            {{!}} '''{{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}} + {{{invalid}}}|R}} }}}} }}'''
 
{{!}} style="text-align: right;"            {{!}} '''100.00%'''
 
{{!}} style="text-align: right;"            {{!}} '''100.00%'''
 
}}|
 
}}|
Line 58: Line 68:
 
|- style="background-color:#EEEEEE"
 
|- style="background-color:#EEEEEE"
 
{{#if: {{both|{{{electorate|}}}|{{{total|}}}{{{invalid|}}}}}{{{turnoutpct|}}} |
 
{{#if: {{both|{{{electorate|}}}|{{{total|}}}{{{invalid|}}}}}{{{turnoutpct|}}} |
{{!}} style="text-align: left"              {{!}} {{#ifeq:{{{voter_registration|}}}|no|Eligible to vote|Registered voters}}/turnout
+
{{!}} style="text-align: left"              {{!}} {{nowrap|{{#ifeq:{{{voter_registration|}}}|no|Eligible to vote|Registered voters}}/turnout}}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{{electorate}}} }}
 
{{!}} style="text-align: right;"            {{!}} {{formatnum: {{{electorate}}} }}
{{!}} style="text-align: right;"            {{!}} {{#if:{{{turnoutpct|}}}|{{{turnoutpct}}}%|{{percentage| {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}}|R}} | {{formatnum:{{{electorate}}}|R}} | 2 }}}}
+
{{!}} style="text-align: right;"            {{!}} {{#if:{{{turnoutpct|}}}|{{{turnoutpct}}}%|{{percentage| {{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}} + {{{no}}} + {{#if:{{{blank|}}}|{{{blank}}}|0}} + {{#if:{{{other|}}}|{{{other}}}|0}} + {{{invalid}}}|R}} }}}}|R}} | {{formatnum:{{{electorate}}}|R}} | 2 }}}}
 
}}
 
}}
 
|}<noinclude>
 
|}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 07:32, 10 November 2020

colspan="3" Template:Unk
Template documentation[view] [edit] [history] [purge]

Usage

This subtemplate of {{Infobox referendum/results}} is used to generate the referendum results, it should not be used directly.

Examples

{{Infobox referendum/results|yes=218,000|no=217,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
{{Infobox referendum/results|yes=218,000|no=217,000|total=450,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
Valid votes 435,000 Template:Percentage
Invalid or blank votes 15,000 Template:Percentage
Total votes 450,000 100.00%
{{Infobox referendum/results|yes=217,000|no=218,000|total=450,000}}
Response
Votes %
Yes 217,000 Template:Percentage
No 218,000 Template:Percentage
Valid votes 435,000 Template:Percentage
Invalid or blank votes 15,000 Template:Percentage
Total votes 450,000 100.00%
{{Infobox referendum/results|yes=218,000|no=217,000|other=5,000|othertype=Blank votes|total=450,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
Blank votes 5,000 Template:Percentage
Valid votes 440,000 Template:Percentage
Invalid votes 10,000 Template:Percentage
Total votes 450,000 100.00%
{{Infobox referendum/results|yes=218,000|no=217,000|blank=5,000|total=450,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
Blank votes 5,000 Template:Percentage
Valid votes 440,000 Template:Percentage
Invalid votes 10,000 Template:Percentage
Total votes 450,000 100.00%
{{Infobox referendum/results|yes=218,000|no=217,000|electorate=800,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
{{Infobox referendum/results|yes=218,000|no=217,000|total=450,000|electorate=800,000}}
Response
Votes %
Yes 218,000 Template:Percentage
No 217,000 Template:Percentage
Valid votes 435,000 Template:Percentage
Invalid or blank votes 15,000 Template:Percentage
Total votes 450,000 100.00%
Registered voters/turnout 800,000 Template:Percentage
{{Infobox referendum/results|yes=217,000|no=218,000|total=450,000|electorate=800,000}}
Response
Votes %
Yes 217,000 Template:Percentage
No 218,000 Template:Percentage
Valid votes 435,000 Template:Percentage
Invalid or blank votes 15,000 Template:Percentage
Total votes 450,000 100.00%
Registered voters/turnout 800,000 Template:Percentage
{{Infobox referendum/results|yes=217,000|no=218,000|invalid=15,000|electorate=800,000}}
Response
Votes %
Yes 217,000 Template:Percentage
No 218,000 Template:Percentage
Valid votes 435,000 Template:Percentage
Invalid or blank votes 15,000 Template:Percentage
Total votes 450,000 100.00%
Registered voters/turnout 800,000 Template:Percentage
{{Infobox referendum/results|yes=217,000|no=218,000|invalid=|total=450,000|electorate=800,000}}
Response
Votes %
Yes 217,000 Template:Percentage
No 218,000 Template:Percentage
Total votes 450,000 100.00%
Registered voters/turnout 800,000 Template:Percentage
{{Infobox referendum/results|electorate=800,000}}
colspan="3" Template:Unk
{{Infobox referendum/results|invalid=15,000}}
colspan="3" Template:Unk
{{Infobox referendum/results|turnoutpct=95.1}}
colspan="3" Template:Unk
Registered voters/turnout 95.1%
{{Infobox referendum/results}}
colspan="3" Template:Unk