Difference between revisions of "Template:GroupTableSlot"

From QWiki
m
m
Line 1: Line 1:
<includeonly>|-{{#if: {{{bg|}}}|style="background-color:{{#switch: {{{bg}}}
+
<includeonly>|-{{#if: {{{bg|}}}|style="background-color:{{Color|{{{bg}}}}};"|}}
                                  |proceed
+
!style="width: 16px;{{#if: {{{pbg|}}}| background-color:{{Color|{{{pbg}}}}};|}}"|{{{place|X}}}. <!-- show place number in header cell -->
                                  |up = rgb(204,255,204)
+
|colspan="{{#expr:4-{{#if:{{{go|}}}|1|0}}-{{#if:{{{win_g|}}}{{{lose_g|}}}|1|0}}-{{#if:{{{diff|}}}|1|0}}}}" style="text-align:{{{align|left}}};{{#if: {{{bg|}}}|background-color:{{Color|{{{bg}}}}};|}}" class="grouptableslot"| {{{1}}} <!-- show the player name with the correct colspan -->
                                  |stayup = rgb(238,255,170)
 
                                  |stay = rgb(255,255,153)
 
                                  |staydown = rgb(255,221,170)
 
                                  |drop
 
                                  |down = rgb(255,204,204)
 
                                  |{{{bg}}}
 
                            }};"|}}
 
!style="width: 1em;{{#if: {{{pbg|}}}| background-color:{{#switch: {{{pbg}}}
 
                                  |u
 
                                  |up
 
                                  |proceed = rgb(187,238,187)
 
                                  |su
 
                                  |stayup = rgb(221,238,187)
 
                                  |s
 
                                  |stay = rgb(238,238,136)
 
                                  |sd
 
                                  |staydown = rgb(238,204,153)
 
                                  |d
 
                                  |down
 
                                  |drop = rgb(238,187,187)
 
                                  |{{{pbg}}}
 
                            }};|}}"|{{{place|X}}}. <!-- show place number in header cell -->
 
|colspan="{{#expr:4-{{#if:{{{go|}}}|1|0}}-{{#if:{{{win_g|}}}{{{lose_g|}}}|1|0}}-{{#if:{{{diff|}}}|1|0}}}}" style="text-align:{{{align|left}}}; {{#if: {{{bg|}}}|background-color:{{#switch: {{{bg}}}
 
                                  |proceed
 
                                  |up = rgb(204,255,204)
 
                                  |stayup = rgb(238,255,170)
 
                                  |stay = rgb(255,255,153)
 
                                  |staydown = rgb(255,221,170)
 
                                  |drop
 
                                  |down = rgb(255,204,204)
 
                                  |{{{bg}}}
 
                            }};|}}" class="grouptableslot"| {{{1}}} <!-- show the player name with the correct colspan -->
 
 
{{#if: {{{go|}}} <!-- if go= is present, add a cell and show the arror -->
 
{{#if: {{{go|}}} <!-- if go= is present, add a cell and show the arror -->
 
     | {{!}}style="width: 1em;"{{!}}<!-- go= with values "up", "same" and "down"
 
     | {{!}}style="width: 1em;"{{!}}<!-- go= with values "up", "same" and "down"
 
     -->{{#switch: {{{go}}}
 
     -->{{#switch: {{{go}}}
 
         |up = {{PlaceUp}}
 
         |up = {{PlaceUp}}
 +
        |up1 = {{PlaceUp}}&nbsp;+1
 +
        |up2 = {{PlaceUp}}&nbsp;+2
 +
        |up3 = {{PlaceUp}}&nbsp;+3
 +
        |up4 = {{PlaceUp}}&nbsp;+4
 +
        |up5 = {{PlaceUp}}&nbsp;+5
 +
        |up6 = {{PlaceUp}}&nbsp;+6
 +
        |up7 = {{PlaceUp}}&nbsp;+7
 
         |same = {{PlaceSame}}
 
         |same = {{PlaceSame}}
 +
        |same0 = {{PlaceSame}}&nbsp;–
 
         |down = {{PlaceDown}}
 
         |down = {{PlaceDown}}
 +
        |down1 = {{PlaceDown}}&nbsp;-1
 +
        |down2 = {{PlaceDown}}&nbsp;-2
 +
        |down3 = {{PlaceDown}}&nbsp;-3
 +
        |down4 = {{PlaceDown}}&nbsp;-4
 +
        |down5 = {{PlaceDown}}&nbsp;-5
 +
        |down6 = {{PlaceDown}}&nbsp;-6
 +
        |down7 = {{PlaceDown}}&nbsp;-7
 
         |{{{go}}}
 
         |{{{go}}}
 
       }}
 
       }}
 
     |
 
     |
 
}}
 
}}
|style="width: 2em; white-space: pre; text-align:center;" class="grouptableslotscore"|'''{{{win_m|0}}}-{{{lose_m|0}}}''' <!-- always show match scores --><!--
+
|<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"|'''{{{win_m|0}}}-{{#if:{{{tie_m|}}}|{{{tie_m|}}}-}}{{{lose_m|0}}}''' <!-- always show match scores --><!--
-->{{#if: {{{win_g|}}}{{{lose_g|}}} <!-- show games scores if present with win_g= or lose_g=-->
+
-->{{#if: {{{win_g|}}}{{{lose_g|}}} <!-- show games scores if present with win_g= or lose_g=
| {{!}}{{!}}style="width: 2em; white-space: pre; text-align:center;"{{!}}{{{win_g|0}}}-{{{lose_g|0}}}}}<!--
+
-->| {{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align:center;"{{!}}{{{win_g|0}}}-{{{lose_g|0}}}}}<!--
-->{{#if: {{{diff|}}} <!-- if diff= is present, show it as well -->
+
-->{{#if: {{{diff|}}} <!-- if diff= is present, show it as well  
| {{!}}{{!}}style="width: 3em; white-space: pre; text-align: center;"{{!}}''{{{diff|}}}''
+
-->| {{!}}{{!}}<!--class="grouptable-games" -->style="width: 35px; white-space: pre; text-align: center;"{{!}}''{{{diff|}}}''
}}</includeonly><noinclude>{{documentation}}[[Category:Templates]]</noinclude>
+
}}{{#ifeq:{{lc:{{#var:show_points|}}}}|true<!-- if show_p present, show points 
 +
-->| {{!}}{{!}}<!--class="grouptable-points"-->style="width: 32px; white-space: pre; text-align:center;"{{!}}<!--
 +
-->{{#if: {{{win_m|}}}{{{lose_m|}}}<!-- if win_m or lose_m is present, calculate points
 +
  -->|  {{#if: {{{tie_m|}}}<!-- if tie_m is present, include tie matches in calculation 
 +
  -->| '''<i>{{#expr: ({{{win_m}}}*{{#var:win_points|3}}) + ({{#if:{{{tie_m|}}}|{{{tie_m}}}|0}}*{{#var:tie_points|1}}) + {{#if:{{{temp_p|}}}|{{{temp_p}}}|0}}}}p</i><!--
 +
  -->}}<!--
 +
  -->| '''<i>0p</i>'''<!--
 +
  -->}}<!--
 +
-->}}
 +
</includeonly><noinclude>{{documentation}}[[Category:Templates]]</noinclude>

Revision as of 18:15, 29 April 2017

Documentation (view - edit)

Table row showing #, TBD team/player, Games, Maps, Diff. All is crude, no math behind. It is used together with the templates {{GroupTableStart}} and {{GroupTableEnd}}

The code:

{{GroupTableSlot| {{TeamAbbr|Finland|flag=fi|Milton, HENU, Creature, fix, mazer}} |place=1 |win_m=10 |lose_m=0 |win_g=20 |lose_g=0 |diff=+20 |bg=up}}

Gives us:

Global Standings
# Nation Games Maps Diff
1. Finland FinlandMilton, HENU, Creature, fix, mazer 10-0 20-0 +20

Parameters

The following parameters can be used in this template

first parameter
The first parameter in this template (technically the {{{1}}} field) is used as the player name. This can be even a template call like {{player}}.
|place=...
(optional) The place number to shown. If this parameter is not set the value X is used.
|bg=...
(optional) The background color for the slot. This can be every CSS color values, but the following color names has been added to the template for easy use:
|bg=proceed
|bg=up
Use a light green background to indicate that this position is a proceeding place inside the group.
|bg=staydown
Use a light yellow background to indicate that this player will stay at the same stage in the tournament or advance through a longer bracket or group stage.
|bg=drop
|bg=down
Use a light red background to indicate that this position will drop the player from the group.
|pbg=...
(optional) The background color for the place column. This can be every CSS color, but the following color names has been added to the template for easy use:
|pbg=proceed
|pbg=up
Use a light green background to indicate that this position is a proceeding place inside the group.
|pbg=drop
|pbg=down
Use a light red background to indicate that this position will drop the player from the group.
|go=...
(optional) If present an arrow indicating the movement inside the group will shown. The following values can be used:
|go=up
Shows the arrow.
|go=same
Shows the arrow.
|go=down
Shows the arrow.
|go=...
Show the given content instead.
|win_m=...
|lose_m=...
(optional) Specify the number of matches the player has won/lost. If not present the default value 0 is used.
|win_g=...
|lose_g=...
(optional) Specify the number of games the player has won/lost (like in a Bo3 match). If not present no games score is shown.

Example

{{GroupTableStart| Group B }}
{{GroupTableSlot| No arguments at all}}
{{GroupTableSlot| With place |place=3}}
{{GroupTableSlot| With matches |win_m=3|lose_m=1}}
{{GroupTableSlot| With games |win_g=2|lose_g=1}}
{{GroupTableSlot| With arrow |go=up}}
{{GroupTableSlot| With difference |diff=-8}}
{{GroupTableSlot| With proceed background|bg=proceed}}
{{GroupTableSlot| With drop background|bg=drop}}
{{GroupTableSlot| With pbg background|pbg=proceed}}
{{GroupTableSlot| With everything |place=10|go=same|win_m=5|lose_m=1|win_g=10|lose_g=4|diff=+4}}
{{GroupTableEnd}}

This will result in the following group table (showing all possibilities, only one scheme should be used through the whole group table).

Group B
X. No arguments at all 0-0
3. With place 0-0
X. With matches 3-1
X. With games 0-0 2-1
X. With arrow 0-0
X. With difference 0-0 -8
X. With proceed background 0-0
X. With drop background 0-0
X. With pbg background 0-0
10. With everything 5-1 10-4 +4

Adapted from Liquipedia