Difference between revisions of "Template:Constituency changes"

From blackwiki
Jump to navigation Jump to search
imported>Frietjes
m (Frietjes moved page Template:Election changes to Template:Constituency changes: better name)
imported>Frietjes
(allow con to be omitted)
Line 1: Line 1:
 
<includeonly>|-  
 
<includeonly>|-  
{{!}} <!-- begin hidden code to make date column sortable
+
| <!-- begin hidden code to make date column sortable
 
--><span class="sortkey" style="display:none">{{{year}}}-{{#if:{{{month|}}}|{{0expr|{{MONTHNUMBER|{{{month}}}}}}}|00}}-{{#iferror: {{#expr: {{{date}}} < 0}} | 00 | {{0expr|{{{date}}}}} }}</span> <!-- end hidden code
 
--><span class="sortkey" style="display:none">{{{year}}}-{{#if:{{{month|}}}|{{0expr|{{MONTHNUMBER|{{{month}}}}}}}|00}}-{{#iferror: {{#expr: {{{date}}} < 0}} | 00 | {{0expr|{{{date}}}}} }}</span> <!-- end hidden code
 
  -->{{#if: {{{date|}}} |  
 
  -->{{#if: {{{date|}}} |  
Line 7: Line 7:
 
{{nowrap|{{{month}}} {{{year}}}}}
 
{{nowrap|{{{month}}} {{{year}}}}}
 
}}
 
}}
| {{#if: {{{con|}}} | {{{con}}} | &nbsp; }}
+
{{#ifeq:{{{con|a}}}|{{{con|b}}}|{{!}} {{#if: {{{con|}}} | {{{con}}} | &nbsp; }}
 
<!-- Note that empty table cells do not sort properly, so if the cells below
 
<!-- Note that empty table cells do not sort properly, so if the cells below
 
     would be empty, a non-breaking space (&nbsp;) is added.
 
     would be empty, a non-breaking space (&nbsp;) is added.
     Apart from making cells sort properly, it's also needed for standards-compliant HTML -->
+
     Apart from making cells sort properly, it's also needed for standards-compliant HTML -->}}
 
{{#if: {{{gain|}}} |  
 
{{#if: {{{gain|}}} |  
 
! style="background-color: {{Template:{{{gain}}}/meta/color}}" {{!}}  
 
! style="background-color: {{Template:{{{gain}}}/meta/color}}" {{!}}  

Revision as of 22:17, 17 March 2015

Template documentation[view] [edit] [history] [purge]

The {{constituency changes start}}, {{constituency changes}}, and {{end}} templates may be used to create a sortable table showing party/constituency changes over time.

Usage

{{constituency changes start}}
{{constituency changes
|date  = 
|month = 
|year  = 
|con   = 
|gain  = 
|loss  = 
|note  = 
}}
{{end}}

or

{{constituency changes start|con=Panel}}
{{constituency changes
|date  = 
|month = 
|year  = 
|con   = 
|gain  = 
|loss  = 
|note  = 
}}
{{end}}

or

{{constituency changes start|nocon=true}}
{{constituency changes
|date  = 
|month = 
|year  = 
|gain  = 
|loss  = 
|note  = 
}}
{{end}}

Example

{{constituency changes start}}
{{constituency changes
|date  = 22
|month = December
|year  = 2011
|con   = 6th district
|gain  = Croatian Democratic Union
|loss  = Democratic Centre (Croatia)
|note  = [[Vesna Škare-Ožbolt]] of DC was replaced by Ivana Roksandić of HDZ
}}
{{constituency changes
|date  = 30
|month = May
|year  = 2012
|con   = 4th district
|gain  = Croatian Democratic Alliance of Slavonia and Baranja
|loss  = Croatian Democratic Union
|note  = [[Josip Salapić]] left HDZ and joined HDSSB
}}
{{end}}
Date Script error: No such module "If empty". Gain Loss Note
22 December 2011 6th district HDZ DC Vesna Škare-Ožbolt of DC was replaced by Ivana Roksandić of HDZ
30 May 2012 4th district HDSSB HDZ Josip Salapić left HDZ and joined HDSSB