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

From blackwiki
Jump to navigation Jump to search
(Wikitable)
(Align all row titles *the same*, to the left.)
Line 1: Line 1:
{| border="1" class="wikitable" style="width:25em; margin:0"
+
{| border="1" class="wikitable" style="text-align:right; width:25em; margin:0"
|- style="text-align: center; background-color:#E9E9E9"
+
|- style="background-color:#E9E9E9"
 
! colspan="3" | Results
 
! colspan="3" | Results
 
{{!}}- style="background-color:#EEEEEE"
 
{{!}}- style="background-color:#EEEEEE"
 
{{#if: {{{yes|}}} |
 
{{#if: {{{yes|}}} |
! style="width: 17em" {{!}} Yes or no
+
! style="width: 17em"                       {{!}}
! style="width: 5em" {{!}} Votes
+
! style="width: 5em"                         {{!}} Votes
! style="width: 7em" {{!}} Percentage
+
! style="width: 7em"                         {{!}} Of total
 
{{!}}-
 
{{!}}-
 
{{#ifexpr: {{formatnum:{{{yes}}}|R}} > {{formatnum:{{{no}}}|R}} |
 
{{#ifexpr: {{formatnum:{{{yes}}}|R}} > {{formatnum:{{{no}}}|R}} |
{{!}} style="text-align: left;"                     {{!}} [[Image:Yes_check.svg|14px|link=]] '''Yes'''
+
{{!}} style="text-align: left;"             {{!}} [[Image:Yes_check.svg|14px|link=]] '''Yes'''
{{!}} style="text-align: right; margin-right: 0.5em" {{!}} '''{{formatnum: {{formatnum:{{{yes}}}|R}} }}'''
+
{{!}} style="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}} }} | 2 }}'''
+
{{!}} style="margin-right: 0.5em"           {{!}} '''{{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}'''
 
{{!}}-
 
{{!}}-
{{!}} style="text-align: left;"                     {{!}} [[Image:X_mark.svg|14px|link=]] No
+
{{!}} style="text-align: left;"             {{!}} [[Image:X_mark.svg|14px|link=]] No
{{!}} align="right"                                  {{!}} {{formatnum: {{formatnum:{{{no}}}|R}} }}
+
{{!}}                                       {{!}} {{formatnum: {{formatnum:{{{no}}}|R}} }}
{{!}} align="right"                                  {{!}} {{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
+
{{!}}                                       {{!}} {{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
 
{{!}}-
 
{{!}}-
 
{{#if:{{{other|}}}|
 
{{#if:{{{other|}}}|
{{!}} style="text-align: left;"                     {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
+
{{!}} style="text-align: left;"             {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
{{!}} align="right"                                  {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
+
{{!}}                                       {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
{{!}} align="right"                                  {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
+
{{!}}                                       {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
 
}}
 
}}
 
|
 
|
{{!}} style="text-align: left;"                       {{!}} [[Image:Yes_check.svg|14px|link=]] Yes
+
{{!}} style="text-align: left;"             {{!}} [[Image:Yes_check.svg|14px|link=]] Yes
{{!}} style="text-align: right; margin-right: 0.5em" {{!}} {{formatnum: {{formatnum:{{{yes}}}|R}} }}
+
{{!}} style="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}} }} | 2 }}
+
{{!}} style="margin-right: 0.5em"           {{!}} {{percentage| {{formatnum:{{{yes}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
 
{{!}}-
 
{{!}}-
{{!}} style="text-align: left;"                     {{!}} [[Image:X_mark.svg|14px|link=]] '''No'''
+
{{!}} style="text-align: left;"             {{!}} [[Image:X_mark.svg|14px|link=]] '''No'''
{{!}} style="text-align: right; margin-right: 0.5em" {{!}} '''{{formatnum: {{formatnum:{{{no}}}|R}} }}'''
+
{{!}} style="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}} }} | 2 }}'''
+
{{!}} style="margin-right: 0.5em"           {{!}} '''{{percentage| {{formatnum:{{{no}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}'''
 
{{!}}-
 
{{!}}-
 
{{#if:{{{other|}}}|
 
{{#if:{{{other|}}}|
{{!}} style="text-align: left;"                     {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
+
{{!}} style="text-align: left;"             {{!}} {{#if:{{{othertype|}}}|{{{othertype}}}|Other}}
{{!}} align="right"                                  {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
+
{{!}}                                       {{!}} {{formatnum: {{formatnum:{{{other}}}|R}} }}
{{!}} align="right"                                  {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
+
{{!}}                                       {{!}} {{percentage| {{formatnum:{{{other}}}|R}} | {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} | 2 }}
 
}}
 
}}
 
}}
 
}}
Line 40: Line 40:
 
{{#if: {{{total|}}}{{{invalid|}}} |
 
{{#if: {{{total|}}}{{{invalid|}}} |
 
{{#if:{{{invalid|Ø}}}|
 
{{#if:{{{invalid|Ø}}}|
{{!}} style="text-align: right"                     {{!}} Valid votes
+
{{!}} style="text-align: left"               {{!}} Valid votes
{{!}} align="right"                                  {{!}} {{formatnum: {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}
+
{{!}}                                       {{!}} {{formatnum: {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}
{{!}} 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}} | 2 }}
+
{{!}}                                       {{!}} {{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}} | 2 }}
 
{{!}}- style="background-color:#EEEEEE"
 
{{!}}- style="background-color:#EEEEEE"
{{!}} style="text-align: right"                     {{!}} Invalid or blank votes
+
{{!}} style="text-align: left"               {{!}} Invalid or blank votes
{{!}} align="right"                                  {{!}} {{formatnum: {{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}} }}
+
{{!}}                                       {{!}} {{formatnum: {{{invalid|{{#expr: {{formatnum:{{{total}}}|R}} - {{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} }} }}}}} }}
{{!}} 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 }}
+
{{!}}                                       {{!}} {{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="background-color:#EEEEEE"
 
{{!}}- style="background-color:#EEEEEE"
{{!}} style="text-align: right; margin-right: 0.5em" {{!}} '''Total votes'''{{{totalref|}}}
+
{{!}} style="text-align: left"               {{!}} '''Total votes'''{{{totalref|}}}
{{!}} align="right"                                  {{!}} '''{{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}} }}'''
+
{{!}}                                       {{!}} '''{{formatnum:{{#if:{{{total|}}}|{{{total}}}|{{#expr: {{formatnum:{{{yes}}}|R}} + {{formatnum:{{{no}}}|R}} + {{formatnum:{{#if:{{{other|}}}|{{{other}}}|0}}|R}} + {{formatnum:{{{invalid}}}|R}} }}}} }}'''
{{!}} align="right"                                  {{!}} '''100.00%'''
+
{{!}}                                       {{!}} '''100.00%'''
 
}}|
 
}}|
 
{{!}}-
 
{{!}}-
{{!}} colspan="3" align="center"                     {{!}} '''Result not yet known'''
+
{{!}} colspan="3" style="text-align: center" {{!}} '''Result not yet known'''
 
}}
 
}}
 
|- style="background-color:#EEEEEE"
 
|- style="background-color:#EEEEEE"
 
{{#if: {{both|{{{electorate|}}}|{{{total|}}}{{{invalid|}}}}}{{{turnoutpct|}}} |
 
{{#if: {{both|{{{electorate|}}}|{{{total|}}}{{{invalid|}}}}}{{{turnoutpct|}}} |
{{!}} style="text-align: right"                     {{!}} Voter turnout
+
{{!}} style="text-align: left"               {{!}} Voter turnout
{{!}} colspan="2" 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 }}}}
+
{{!}} colspan="2"                           {{!}} {{#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="background-color:#EEEEEE"
 
|- style="background-color:#EEEEEE"
 
{{#if: {{{electorate|}}} |
 
{{#if: {{{electorate|}}} |
{{!}} style="text-align: right"                     {{!}} Electorate
+
{{!}} style="text-align:left"               {{!}} Electorate
{{!}} colspan="2" align="right"                      {{!}} {{formatnum: {{{electorate}}} }}
+
{{!}} colspan="2"                           {{!}} {{formatnum: {{{electorate}}} }}
 
}}
 
}}
 
|}<noinclude>
 
|}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 22:32, 23 May 2015

Results
Result not yet known
50px Template documentation[view] [edit] [history] [purge]

Usage

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

Examples

{{Infobox referendum/results|yes=218,000|no=217,000}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px No 217,000 Template:Percentage
{{Infobox referendum/results|yes=218,000|no=217,000|total=450,000}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px 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}}
Results
Votes Of total
File:Yes check.svg Yes 217,000 Template:Percentage
14px 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}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px No 217,000 Template:Percentage
Blank votes 5,000 Template:Percentage
Valid votes 440,000 Template:Percentage
Invalid or blank 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}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px 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=218,000|no=217,000|electorate=800,000}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px No 217,000 Template:Percentage
Electorate 800,000
{{Infobox referendum/results|yes=218,000|no=217,000|total=450,000|electorate=800,000}}
Results
Votes Of total
File:Yes check.svg Yes 218,000 Template:Percentage
14px 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%
Voter turnout Template:Percentage
Electorate 800,000
{{Infobox referendum/results|yes=217,000|no=218,000|total=450,000|electorate=800,000}}
Results
Votes Of total
File:Yes check.svg Yes 217,000 Template:Percentage
14px 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%
Voter turnout Template:Percentage
Electorate 800,000
{{Infobox referendum/results|yes=217,000|no=218,000|invalid=15,000|electorate=800,000}}
Results
Votes Of total
File:Yes check.svg Yes 217,000 Template:Percentage
14px 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%
Voter turnout Template:Percentage
Electorate 800,000
{{Infobox referendum/results|yes=217,000|no=218,000|invalid=|total=450,000|electorate=800,000}}
Results
Votes Of total
File:Yes check.svg Yes 217,000 Template:Percentage
14px No 218,000 Template:Percentage
Total votes 450,000 100.00%
Voter turnout Template:Percentage
Electorate 800,000
{{Infobox referendum/results|electorate=800,000}}
Results
Result not yet known
Electorate 800,000
{{Infobox referendum/results|invalid=15,000}}
Results
Result not yet known
{{Infobox referendum/results|turnoutpct=95.1}}
Results
Result not yet known
Voter turnout 95.1%
{{Infobox referendum/results}}
Results
Result not yet known