Template:Seats

From eRepublik Official Wiki
Revision as of 14:57, 3 June 2020 by Andycro (Talk | contribs) (examples added; minor corrections in the code)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


edit

Complex.png Complex template

The code of this template is really complex, please use your sandbox before editing this template


This template is used to visually show the Congress representation. Below you can see the usage, code samples and examples of this code samples.

If you are an editor and would like a breakdown of this template's complex code, please see Template talk:Seats

Usage

For optimal use, please arrange the parties in descending order by the number of votes, such that the party that gets 50% of the vote is Party 1, the party that gets 40% of the vote is Party 2, and so forth.

Following is the usage with information about each parameter. For clean usage, scroll down to #Clean usage.

{{Seats|
  key=1| <!-- OPTIONAL: Set "key" to 1 to display the key underneath the bar -->.
  width=| <!-- OPTIONAL: Set "width" to a custom value (numbers only, no % or px since the template automatically uses px) to set the graph to a custom width. If not used; 800 is predefined; -->

  p1=First party name| <!-- party name with largest number of Congress seats. OPTIONAL if you don't use key=1 -->
  p1percent=40| <!-- put percentage number for the party with largest number of Congress seats -->
  p1color=#5D8AA8| <!-- OPTIONAL: bar color code for the party with largest number of Congress seats --> 
  p2=Second party name| <!-- party name with second largest number of Congress seats. OPTIONAL if you don't use key=1 -->
  p2percent=30| <!-- put percentage number for the party with second largest number of Congress seats -->
  p2color=#F0F8FF| <!-- OPTIONAL: bar color code for the party with second largest number of Congress seats --> 
  p3=Third party name| <!-- party name with third largest number of Congress seats. OPTIONAL if you don't use key=1 --> 
  p3percent=20| <!-- put percentage number for the party with third largest number of Congress seats -->
  p3color=#E32636| <!-- OPTIONAL: bar color code for the party with third largest number of Congress seats --> 
  p4=Fourth party name| <!-- party name with fourth largest number of Congress seats. OPTIONAL if you don't use key=1 -->
  p4percent=12| <!-- put percentage number for the party with fourth largest number of Congress seats -->
  p4color=#EFDECD| <!-- OPTIONAL: bar color code for the party with fourth largest number of Congress seats --> 
  p5=Fifth party name| <!-- party name with fifth largest number of Congress seats. OPTIONAL if you don't use key=1 -->
  p5percent=8| <!-- put percentage number for the party with fifth largest number of Congress seats -->
  p5color=#E52B50| <!-- OPTIONAL: bar color code for the party with fifth largest number of Congress seats --> 
}}

Note regarding color: Color names, #000000, or rgb(255, 255, 255) may be used. If no color is specified, default colors are used:

Key:


Clean usage

{{Seats|
  key=1|
  width=|

  p1=|
  p1percent=|
  p1color=|
  p2=|
  p2percent=|
  p2color=|
  p3=|
  p3percent=|
  p3color=|
  p4=|
  p4percent=|
  p4color=|
  p5=|
  p5percent=|
  p5color=|
}}

Sample Code with examples

Sample 1

No party names, no specific codes. Only the percentages used and width decreased.

{{Seats|
  width=400|
  p1percent=40|
  p2percent=30|
  p3percent=12|
  p4percent=10|
  p5percent=8|
}}

40%

30%

12%

10%

8%


Sample 2

Full list with not-linkable fake parties. This is completely made-up example.

{{Seats|
  key=1|

  p1=Progressive Party|
  p1percent=40|
  p1color=#766|
  p2=Moderate Party|
  p2percent=30|
  p2color=#888|
  p3=Conservative Party|
  p3percent=20|
  p3color=#900|
  p4=Communist Party|
  p4percent=10|
  p4color=#877|
  p5=Fascist Party|
  p5percent=0|
  p5color=#999|
}}

40%

30%

20%

10%

Key:

Progressive Party

Moderate Party

Conservative Party

Communist Party

Fascist Party
Note: One or more parties received no seats in this elections.


Sample 3

Full list with linkable parties. This example is taken from Congress of the Netherlands article; September 2011 elections.

{{Seats|
  key=1|
  p1=[[Democratisch Nederland]]|
  p1percent=42.5|
  p1color=#3333cc|
  p2=[[Geuzen Partij Nederland]]|
  p2percent=25|
  p2color=#C9C5DE|
  p3=[[Iron & Wine]]|
  p3percent=22.5|
  p3color=#ffcc33|
  p4=[[Centre-Left Netherlands]]|
  p4percent=5|
  p4color=#d82000|
  p5=Rote Armee Fraktion|
  p5percent=5|
  p5color=#9d4e40|
}}

42.5%

25%

22.5%

5%

5%