Difference between revisions of "Template:Infobox election/row"

From blackwiki
Jump to navigation Jump to search
imported>Frietjes
(add col3 to suppress third column when there is no third party)
imported>Koavf
(Adding alt text)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<includeonly>|-
 
<includeonly>|-
 
{{#if:{{{divider|}}}|{{#if:{{{party1|}}}{{{color1|}}}{{{leader1|}}}{{{party2|}}}{{{color2|}}}{{{leader2|}}}{{{party3|}}}{{{color3|}}}{{{leader3|}}}|{{!}} colspan=4 {{!}} {{{divider}}} }} }}
 
{{#if:{{{divider|}}}|{{#if:{{{party1|}}}{{{color1|}}}{{{leader1|}}}{{{party2|}}}{{{color2|}}}{{{leader2|}}}{{{party3|}}}{{{color3|}}}{{{leader3|}}}|{{!}} colspan=4 {{!}} {{{divider}}} }} }}
|-
+
|- style="display:none"
 
{{#ifeq:{{{ongoing|}}}|yes||{{#switch:{{{type|}}}
 
{{#ifeq:{{{ongoing|}}}|yes||{{#switch:{{{type|}}}
 
| parliamentary
 
| parliamentary
Line 17: Line 17:
 
{{#if:{{{party1|}}}{{{color1|}}}{{{image1|}}}{{{party2|}}}{{{color2|}}}{{{image2|}}}{{{party3|}}}{{{color3|}}}{{{image3|}}}|<!-- Images  -->
 
{{#if:{{{party1|}}}{{{color1|}}}{{{image1|}}}{{{party2|}}}{{{color2|}}}{{{image2|}}}{{{party3|}}}{{{color3|}}}{{{image3|}}}|<!-- Images  -->
 
{{!}} &nbsp;
 
{{!}} &nbsp;
{{!}} style="text-align:center;{{#if:{{{party1|}}}{{{color1|}}}||width:0;}}{{#if:{{{color1|}}}|border-bottom: 6px solid #{{{color1}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party1|}}}|{{#ifexist:Template:{{{party1}}}/meta/color|border-bottom: 6px solid {{Template:{{{party1}}}/meta/color}} }}}}}}}}" {{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image1|}}}|suppressplaceholder=yes}}
+
{{!}} style="text-align:center;{{#if:{{{party1|}}}{{{color1|}}}||width:0;}}{{#if:{{{color1|}}}|border-bottom: 6px solid #{{{color1}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party1|}}}|{{#ifexist:Template:{{{party1}}}/meta/color|border-bottom: 6px solid {{Template:{{{party1}}}/meta/color}} }}}}}}}}" {{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image1|}}}|size={{if empty|{{{image1_size|}}}|{{{image_size|}}}}}|alt={{{alt1|}}}|upright={{if empty|{{{image1_upright|}}}|{{{image_upright|}}}|{{#if:{{both|{{{col3|}}}|{{{image3|}}}}}|0.5|0.75}}}}|suppressplaceholder=yes}}
{{!}} style="text-align:center;{{#if:{{{party2|}}}{{{color2|}}}||width:0;}}{{#if:{{{color2|}}}|border-bottom: 6px solid #{{{color2}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party2|}}}|{{#ifexist: Template:{{{party2}}}/meta/color|border-bottom: 6px solid {{Template:{{{party2}}}/meta/color}} }}}}}}}}"{{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image2|}}}|suppressplaceholder=yes}}
+
{{!}} style="text-align:center;{{#if:{{{party2|}}}{{{color2|}}}||width:0;}}{{#if:{{{color2|}}}|border-bottom: 6px solid #{{{color2}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party2|}}}|{{#ifexist: Template:{{{party2}}}/meta/color|border-bottom: 6px solid {{Template:{{{party2}}}/meta/color}} }}}}}}}}"{{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image2|}}}|size={{if empty|{{{image2_size|}}}|alt={{{alt2|}}}|{{{image_size|}}}}}|upright={{if empty|{{{image2_upright|}}}|{{{image_upright|}}}|{{#if:{{both|{{{col3|}}}|{{{image3|}}}}}|0.5|0.75}}}}|suppressplaceholder=yes}}
{{#if:{{{col3|}}}|{{!}} style="text-align:center;{{#if:{{{party3|}}}{{{color3|}}}||width:0;}}{{#if:{{{color3|}}}|border-bottom: 6px solid #{{{color3}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party3|}}}|{{#ifexist: Template:{{{party3}}}/meta/color|border-bottom: 6px solid {{Template:{{{party3}}}/meta/color}} }}}}}}}}"{{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image3|}}}|suppressplaceholder=yes}}}}
+
{{#if:{{{col3|}}}|{{!}} style="text-align:center;{{#if:{{{party3|}}}{{{color3|}}}||width:0;}}{{#if:{{{color3|}}}|border-bottom: 6px solid #{{{color3}}}|{{#ifeq: {{{party_color}}}|no||{{#if:{{{party3|}}}|{{#ifexist: Template:{{{party3}}}/meta/color|border-bottom: 6px solid {{Template:{{{party3}}}/meta/color}} }}}}}}}}"{{!}} {{#invoke:InfoboxImage|InfoboxImage|image={{{image3|}}}|alt={{{alt3|}}}|size={{if empty|{{{image3_size|}}}|{{{image_size|}}}}}|upright={{if empty|{{{image3_upright|}}}|{{{image_upright|}}}|0.5}}|suppressplaceholder=yes}}}}
 
}}
 
}}
 
|-
 
|-
 
{{#if:{{{nominee1|}}}{{{nominee2|}}}{{{nominee3|}}}|<!-- Presidential & by-election nominee  -->
 
{{#if:{{{nominee1|}}}{{{nominee2|}}}{{{nominee3|}}}|<!-- Presidential & by-election nominee  -->
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary
 
| presidential
 
| presidential
 
| Presidential  
 
| Presidential  
Line 71: Line 73:
 
{{#if:{{{home_state1|}}}{{{home_state2|}}}{{{home_state3|}}}|
 
{{#if:{{{home_state1|}}}{{{home_state2|}}}{{{home_state3|}}}|
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary
 
| presidential
 
| presidential
 
| Presidential =  
 
| Presidential =  
Line 98: Line 102:
 
{{#ifeq:{{{ongoing|}}}|yes||
 
{{#ifeq:{{{ongoing|}}}|yes||
 
{{#if:{{{electoral_vote1|}}}{{{electoral_vote2|}}}{{{electoral_vote3|}}}|
 
{{#if:{{{electoral_vote1|}}}{{{electoral_vote2|}}}{{{electoral_vote3|}}}|
! style="text-align:left" {{!}} Electoral&nbsp;vote
+
! style="text-align:left" {{!}} {{#ifeq:{{{college_voted|}}}|no|Projected e|E}}lectoral&nbsp;vote
 
{{!}} style="{{#if:{{{electoral_vote1|}}}|width:75px;}}text-align:center" {{!}} {{{electoral_vote1|}}}
 
{{!}} style="{{#if:{{{electoral_vote1|}}}|width:75px;}}text-align:center" {{!}} {{{electoral_vote1|}}}
 
{{!}} style="{{#if:{{{electoral_vote2|}}}|width:75px;}}text-align:center" {{!}} {{{electoral_vote2|}}}
 
{{!}} style="{{#if:{{{electoral_vote2|}}}|width:75px;}}text-align:center" {{!}} {{{electoral_vote2|}}}
Line 108: Line 112:
 
|-<!-- Delegate count  -->
 
|-<!-- Delegate count  -->
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary
 
| presidential
 
| presidential
 
| Presidential =  
 
| Presidential =  
 
{{#if:{{{delegate_count1|}}}{{{delegate_count2|}}}{{{delegate_count3|}}}|
 
{{#if:{{{delegate_count1|}}}{{{delegate_count2|}}}{{{delegate_count3|}}}|
! style="text-align:left" {{!}} Delegate&nbsp;count
+
! style="text-align:left" {{!}} {{#ifeq:{{{ongoing|}}}|yes|Estimated delegate|Delegate}}&nbsp;count
 
{{!}} style="{{#if:{{{delegate_count2|}}}|width:75px;}}text-align:center" {{!}} {{{delegate_count1|}}}
 
{{!}} style="{{#if:{{{delegate_count2|}}}|width:75px;}}text-align:center" {{!}} {{{delegate_count1|}}}
 
{{!}} style="{{#if:{{{delegate_count2|}}}|width:75px;}}text-align:center" {{!}} {{{delegate_count2|}}}
 
{{!}} style="{{#if:{{{delegate_count2|}}}|width:75px;}}text-align:center" {{!}} {{{delegate_count2|}}}
Line 120: Line 126:
 
|-<!-- States carried  -->
 
|-<!-- States carried  -->
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary =
 +
{{#if:{{{states_carried1|}}}{{{states_carried2|}}}{{{states_carried3|}}}|
 +
! style="text-align:left" {{!}} Contests&nbsp;won
 +
{{!}} style="{{#if:{{{states_carried2|}}}|width:75px;}}text-align:center" {{!}} {{{states_carried1|}}}
 +
{{!}} style="{{#if:{{{states_carried2|}}}|width:75px;}}text-align:center" {{!}} {{{states_carried2|}}}
 +
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{states_carried2|}}}|width:75px;}}text-align:center" {{!}} {{{states_carried3|}}}}}
 +
}}
 
| presidential
 
| presidential
 
| Presidential =  
 
| Presidential =  
Line 253: Line 267:
 
}}
 
}}
 
|-<!-- popular vote  -->
 
|-<!-- popular vote  -->
{{#ifeq:{{{ongoing|}}}|yes||
+
{{#ifexpr:not {{#ifeq:{{{ongoing|}}}|yes|1|0}} or {{#ifeq:{{{type|}}}|primary|1|0}}|
 
{{#if:{{{popular_vote1|}}}{{{popular_vote2|}}}{{{popular_vote3|}}}|
 
{{#if:{{{popular_vote1|}}}{{{popular_vote2|}}}{{{popular_vote3|}}}|
 
! style="text-align:left" {{!}} {{{vote_type|Popular}}}&nbsp;vote
 
! style="text-align:left" {{!}} {{{vote_type|Popular}}}&nbsp;vote
Line 262: Line 276:
 
}}
 
}}
 
|-<!-- percentage  -->
 
|-<!-- percentage  -->
{{#ifeq:{{{ongoing|}}}|yes||
+
{{#ifexpr:not {{#ifeq:{{{ongoing|}}}|yes|1|0}} or {{#ifeq:{{{type|}}}|primary|1|0}}|
 
{{#if:{{{percentage1|}}}{{{percentage2|}}}{{{percentage3|}}}|
 
{{#if:{{{percentage1|}}}{{{percentage2|}}}{{{percentage3|}}}|
 
! style="text-align:left" {{!}} Percentage
 
! style="text-align:left" {{!}} Percentage
Line 272: Line 286:
 
|-<!-- Counties won -->
 
|-<!-- Counties won -->
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary
 
| presidential
 
| presidential
 
| Presidential =  
 
| Presidential =  
{{#ifeq:{{{ongoing|}}}|yes||
+
{{#ifexpr:not {{#ifeq:{{{ongoing|}}}|yes|1|0}} or {{#ifeq:{{{type|}}}|primary|1|0}}|
 
{{#if:{{{counties_won1|}}}{{{counties_won2|}}}{{{counties_won3|}}}|
 
{{#if:{{{counties_won1|}}}{{{counties_won2|}}}{{{counties_won3|}}}|
 
! style="text-align:left" {{!}} Counties&nbsp;won
 
! style="text-align:left" {{!}} Counties&nbsp;won
Line 286: Line 302:
 
|-<!-- Counties 25% threshold -->
 
|-<!-- Counties 25% threshold -->
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| primary
 +
| Primary
 
| presidential
 
| presidential
 
| Presidential =  
 
| Presidential =  
{{#ifeq:{{{ongoing|}}}|yes||
+
{{#ifexpr:not {{#ifeq:{{{ongoing|}}}|yes|1|0}} or {{#ifeq:{{{type|}}}|primary|1|0}}|
 
{{#if:{{{counties_threshold1|}}}{{{counties_threshold2|}}}{{{counties_threshold3|}}}|
 
{{#if:{{{counties_threshold1|}}}{{{counties_threshold2|}}}{{{counties_threshold3|}}}|
 
! style="text-align:left" {{!}} Counties&nbsp;with&nbsp;25%&nbsp;vote
 
! style="text-align:left" {{!}} Counties&nbsp;with&nbsp;25%&nbsp;vote
Line 485: Line 503:
 
}}}}
 
}}}}
 
|-<!-- Blank field  -->
 
|-<!-- Blank field  -->
{{#if:{{{show_blank_fields|}}}|
 
{{!-}}
 
 
{{#if:{{#if:{{{1blank|}}}|{{{1data1|}}}{{{1data2|}}}{{{1data3|}}}}}|
 
{{#if:{{#if:{{{1blank|}}}|{{{1data1|}}}{{{1data2|}}}{{{1data3|}}}}}|
 
! style="text-align:left" {{!}} {{{1blank}}}
 
! style="text-align:left" {{!}} {{{1blank}}}
Line 493: Line 509:
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{1data3|}}}|width:75px;}}text-align:center" {{!}} {{{1data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{1data3|}}}|width:75px;}}text-align:center" {{!}} {{{1data3|}}}}}
 
}}
 
}}
{{!-}}
+
|-
 
{{#if:{{#if:{{{2blank|}}}|{{{2data1|}}}{{{2data2|}}}{{{2data3|}}}}}|
 
{{#if:{{#if:{{{2blank|}}}|{{{2data1|}}}{{{2data2|}}}{{{2data3|}}}}}|
 
! style="text-align:left" {{!}} {{{2blank}}}
 
! style="text-align:left" {{!}} {{{2blank}}}
Line 500: Line 516:
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{2data3|}}}|width:75px;}}text-align:center" {{!}} {{{2data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{2data3|}}}|width:75px;}}text-align:center" {{!}} {{{2data3|}}}}}
 
}}
 
}}
{{!-}}
+
|-
 
{{#if:{{#if:{{{3blank|}}}|{{{3data1|}}}{{{3data2|}}}{{{3data3|}}}}}|
 
{{#if:{{#if:{{{3blank|}}}|{{{3data1|}}}{{{3data2|}}}{{{3data3|}}}}}|
 
! style="text-align:left" {{!}} {{{3blank}}}
 
! style="text-align:left" {{!}} {{{3blank}}}
Line 507: Line 523:
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{3data3|}}}|width:75px;}}text-align:center" {{!}} {{{3data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{3data3|}}}|width:75px;}}text-align:center" {{!}} {{{3data3|}}}}}
 
}}
 
}}
{{!-}}
+
|-
 
{{#if:{{#if:{{{4blank|}}}|{{{4data1|}}}{{{4data2|}}}{{{4data3|}}}}}|
 
{{#if:{{#if:{{{4blank|}}}|{{{4data1|}}}{{{4data2|}}}{{{4data3|}}}}}|
 
! style="text-align:left" {{!}} {{{4blank}}}
 
! style="text-align:left" {{!}} {{{4blank}}}
Line 514: Line 530:
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{4data3|}}}|width:75px;}}text-align:center" {{!}} {{{4data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{4data3|}}}|width:75px;}}text-align:center" {{!}} {{{4data3|}}}}}
 
}}
 
}}
{{!-}}
+
|-
 
{{#if:{{#if:{{{5blank|}}}|{{{5data1|}}}{{{5data2|}}}{{{5data3|}}}}}|
 
{{#if:{{#if:{{{5blank|}}}|{{{5data1|}}}{{{5data2|}}}{{{5data3|}}}}}|
 
! style="text-align:left" {{!}} {{{5blank}}}
 
! style="text-align:left" {{!}} {{{5blank}}}
Line 521: Line 537:
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{5data3|}}}|width:75px;}}text-align:center" {{!}} {{{5data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{5data3|}}}|width:75px;}}text-align:center" {{!}} {{{5data3|}}}}}
 
}}
 
}}
{{!-}}
+
|-
 
{{#if:{{#if:{{{6blank|}}}|{{{6data1|}}}{{{6data2|}}}{{{6data3|}}}}}|
 
{{#if:{{#if:{{{6blank|}}}|{{{6data1|}}}{{{6data2|}}}{{{6data3|}}}}}|
 
! style="text-align:left" {{!}} {{{6blank}}}
 
! style="text-align:left" {{!}} {{{6blank}}}
Line 527: Line 543:
 
{{!}} style="{{#if:{{{6data2|}}}|width:75px;}}text-align:center" {{!}} {{{6data2|}}}
 
{{!}} style="{{#if:{{{6data2|}}}|width:75px;}}text-align:center" {{!}} {{{6data2|}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{6data3|}}}|width:75px;}}text-align:center" {{!}} {{{6data3|}}}}}
 
{{#if:{{{col3|}}}|{{!}} style="{{#if:{{{6data3|}}}|width:75px;}}text-align:center" {{!}} {{{6data3|}}}}}
}}}}</includeonly><noinclude>
+
}}</includeonly><noinclude>
 
{{documentation|content=
 
{{documentation|content=
 
This is a subtemplate of [[template:infobox election]] used to generate the candidate block rows.  It should not be used directly.
 
This is a subtemplate of [[template:infobox election]] used to generate the candidate block rows.  It should not be used directly.
 
}}</noinclude>
 
}}</noinclude>

Latest revision as of 19:09, 7 November 2020

Template documentation

This is a subtemplate of template:infobox election used to generate the candidate block rows. It should not be used directly.