Difference between revisions of "Template:Schedule week row"
Line 7: | Line 7: | ||
This template generates a single row of the table, indicating one or more instances of a single event being run during the week, as well as an optional prefix column indicating a grouping of events. | This template generates a single row of the table, indicating one or more instances of a single event being run during the week, as well as an optional prefix column indicating a grouping of events. | ||
− | |||
− | |||
− | |||
− | |||
− | There are up to 8 | + | There are up to 8 positional parameters: |
− | * | + | * Positional parameter 1 is the full name of the event in the schedule. |
− | * | + | * Positional parameters 2 to 8 are each a comma-separated list of two values, each representing an instance of the event being run: |
** The first value is the first day of the week on which the event runs. | ** The first value is the first day of the week on which the event runs. | ||
** The second value is the number of days for which the event runs. | ** The second value is the number of days for which the event runs. | ||
− | There are | + | There are four optional named parameters: |
− | * details - Further optional details necessary to unabiguously specify the event. For example, for a HoD event, the details field might contain "Elspeth" to distinguish it from Bolas HoD. | + | * <code>pre:</code> Specify a group of rows. Use this parameter on the first row of the group. This parameter has a comma-separated pair of values: |
− | * cols - A comma-separated list of color strings, one for each event instance during the week. For example, for a set of Training Grounds events, the cols field might contain "W,U,B,R,G", to show which variation of the event runs on which day. | + | ** The type of the group (e.g. "pvp", "pve", or "duel"). |
− | * start - A start time in UTC for the event which will be displayed in the tooltip, e.g. "16:00". | + | ** The number of rows over which the group extends (e.g. "4"). |
+ | * <code>details</code> - Further optional details necessary to unabiguously specify the event. For example, for a HoD event, the details field might contain "Elspeth" to distinguish it from Bolas HoD. | ||
+ | * <code>cols</code> - A comma-separated list of color strings, one for each event instance during the week. For example, for a set of Training Grounds events, the cols field might contain "W,U,B,R,G", to show which variation of the event runs on which day. | ||
+ | * <code>start</code> - A start time in UTC for the event which will be displayed in the tooltip, e.g. "16:00". | ||
== Example == | == Example == | ||
Line 36: | Line 35: | ||
{{Schedule week row| Trial of the Planes |2,1|3,1|4,1|5,1|6,1|cols=W,U,B,R,G}} | {{Schedule week row| Trial of the Planes |2,1|3,1|4,1|5,1|6,1|cols=W,U,B,R,G}} | ||
{{Schedule week row| Hour of Revelation |1,2}} | {{Schedule week row| Hour of Revelation |1,2}} | ||
− | {{Schedule week row| Terrors in the Shadows |2, | + | {{Schedule week row| Terrors in the Shadows |1,2|4,2|7,1}} |
{{Schedule week row|pre=pve,4| Oath of the Gatewatch: Part 1 |3,3}} | {{Schedule week row|pre=pve,4| Oath of the Gatewatch: Part 1 |3,3}} | ||
{{Schedule week row| Oath of the Gatewatch: Part 2 |5,3}} | {{Schedule week row| Oath of the Gatewatch: Part 2 |5,3}} | ||
− | {{Schedule week row| Return of the God-Pharaoh | + | {{Schedule week row| Return of the God-Pharaoh }} |
{{Schedule week row| Tour de Ravnica |1,1|start=04:00}} | {{Schedule week row| Tour de Ravnica |1,1|start=04:00}} | ||
{{Schedule week row|pre=duel,1|Duel Decks: Zendikar vs Eldrazi|3,3}} | {{Schedule week row|pre=duel,1|Duel Decks: Zendikar vs Eldrazi|3,3}} | ||
Line 55: | Line 54: | ||
{{Schedule week row| Trial of the Planes |2,1|3,1|4,1|5,1|6,1|cols=W,U,B,R,G}} | {{Schedule week row| Trial of the Planes |2,1|3,1|4,1|5,1|6,1|cols=W,U,B,R,G}} | ||
{{Schedule week row| Hour of Revelation |1,2}} | {{Schedule week row| Hour of Revelation |1,2}} | ||
− | {{Schedule week row| Terrors in the Shadows |2, | + | {{Schedule week row| Terrors in the Shadows |1,2|4,2|7,1}} |
{{Schedule week row|pre=pve,4| Oath of the Gatewatch: Part 1 |3,3}} | {{Schedule week row|pre=pve,4| Oath of the Gatewatch: Part 1 |3,3}} | ||
{{Schedule week row| Oath of the Gatewatch: Part 2 |5,3}} | {{Schedule week row| Oath of the Gatewatch: Part 2 |5,3}} | ||
− | {{Schedule week row| Return of the God-Pharaoh | + | {{Schedule week row| Return of the God-Pharaoh }} |
{{Schedule week row| Tour de Ravnica |1,1|start=04:00}} | {{Schedule week row| Tour de Ravnica |1,1|start=04:00}} | ||
{{Schedule week row|pre=duel,1|Duel Decks: Zendikar vs Eldrazi|3,3}} | {{Schedule week row|pre=duel,1|Duel Decks: Zendikar vs Eldrazi|3,3}} | ||
Line 65: | Line 64: | ||
</noinclude><includeonly> | </noinclude><includeonly> | ||
|- | |- | ||
− | {{#if:{{{pre|}}}| | + | <!-- |
+ | |||
+ | # Produce event type column ("pre" field), if present. | ||
+ | -->{{#if:{{{pre|}}}| | ||
{{!}} rowspan={{#explode:{{{pre}}}|,|1}} style="padding:0px; width:42px; border:1px solid black; text-align:center; color:white; background: #22354b" {{!}} <!-- | {{!}} rowspan={{#explode:{{{pre}}}|,|1}} style="padding:0px; width:42px; border:1px solid black; text-align:center; color:white; background: #22354b" {{!}} <!-- | ||
-->{{#if:{{#pos:{{{pre}}}|pvp}} |{{#ifexpr:{{#explode:{{{pre}}}|,|1}} > 1|[[File:pvp-sta.png|x36px|PvP|link=PvP]]<br>}}<small>PvP</small>}}<!-- | -->{{#if:{{#pos:{{{pre}}}|pvp}} |{{#ifexpr:{{#explode:{{{pre}}}|,|1}} > 1|[[File:pvp-sta.png|x36px|PvP|link=PvP]]<br>}}<small>PvP</small>}}<!-- | ||
-->{{#if:{{#pos:{{{pre}}}|pve}} |{{#ifexpr:{{#explode:{{{pre}}}|,|1}} > 1|[[File:pve-sta.png|x36px|PvE|link=PvE]]<br>}}<small>PvE</small>}}<!-- | -->{{#if:{{#pos:{{{pre}}}|pve}} |{{#ifexpr:{{#explode:{{{pre}}}|,|1}} > 1|[[File:pve-sta.png|x36px|PvE|link=PvE]]<br>}}<small>PvE</small>}}<!-- | ||
-->{{#if:{{#pos:{{{pre}}}|duel}}|<small>Duel</small>}}<!-- | -->{{#if:{{#pos:{{{pre}}}|duel}}|<small>Duel</small>}}<!-- | ||
+ | |||
+ | # Produce event abbreviation (and Legacy banner for Legacy events). | ||
-->}} | -->}} | ||
| style="padding:0px; width:70px; text-align:right; border:1px solid black; background-color:#<!-- | | style="padding:0px; width:70px; text-align:right; border:1px solid black; background-color:#<!-- | ||
Line 79: | Line 83: | ||
| style="padding:0px; border:1px solid black; background: #22354b; text-align: center;" |<!-- | | style="padding:0px; border:1px solid black; background: #22354b; text-align: center;" |<!-- | ||
+ | # Produce rewards icons. | ||
--> {{#if: {{#pos:{{Event data: {{{1}}}|4}}|progression}}|[[File:reward-progression.png|x20px|Progression rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x20px]]}}<!-- | --> {{#if: {{#pos:{{Event data: {{{1}}}|4}}|progression}}|[[File:reward-progression.png|x20px|Progression rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x20px]]}}<!-- | ||
-->{{#if: {{#pos:{{Event data: {{{1}}}|4}}|placement}}|[[File:reward-placement.png|x20px|Placement rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x20px]]}}<!-- | -->{{#if: {{#pos:{{Event data: {{{1}}}|4}}|placement}}|[[File:reward-placement.png|x20px|Placement rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x20px]]}}<!-- | ||
Line 84: | Line 89: | ||
-->{{#if: {{#pos:{{Event data: {{{1}}}|4}}|winning-side}}|[[File:reward-winning-side.png|x24px|Winning side rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x24px]]}}}}<!-- | -->{{#if: {{#pos:{{Event data: {{{1}}}|4}}|winning-side}}|[[File:reward-winning-side.png|x24px|Winning side rewards|link=#Icon descriptions]]|[[File:reward-blank.png|x24px]]}}}}<!-- | ||
− | -->{{#ifexpr:{{#explode:{{{2}}}|,|0}} > 1|{{#invoke:String|rep|1=<br> | + | # Handle case where whole row is empty. |
− | {{!}} style="padding:0px; border: 0px;" {{!}}|2={{#expr:{{#explode:{{{2}}}|,|0}} - 1}} }} }} | + | -->{{#if:{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}|| |
− | + | {{!}} {{#invoke:String|rep|1=<br> | |
+ | {{!}} style="padding:0px; border: 0px;" {{!}}|2=7}} }}<!-- | ||
+ | |||
+ | # First non-empty cell(s). Can have blank cells before and/or after. | ||
+ | -->{{#if:{{{2|}}}|{{#ifexpr:{{#explode:{{{2}}}|,|0}} > 1|{{#invoke:String|rep|1=<br> | ||
+ | {{!}} style="padding:0px; border: 0px;" {{!}}|2={{#expr:{{#explode:{{{2}}}|,|0}} - 1}} }} }}<br> | ||
+ | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{2}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|0}}}}|{{{start|}}}}}<!-- | ||
-->{{#if:{{{3|}}}||{{#ifexpr:{{#replace:{{{2|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | -->{{#if:{{{3|}}}||{{#ifexpr:{{#replace:{{{2|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | ||
− | {{!}} style="padding:0px; border: 0px;" {{!}}|2={{#expr: 8 - {{#replace:{{{2}}}|,|-}} }} }} }} }}<!-- | + | {{!}} style="padding:0px; border: 0px;" {{!}}|2={{#expr: 8 - {{#replace:{{{2|1}}}|,|-}} }} }} }} }} }}<!-- |
− | -->{{#if:{{{3|}}}|{{#ifexpr:{{#explode:{{{3}}}|,|0}}>{{# | + | # Second non-empty cell(s). Can have blank cells before and/or after. |
− | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{3}}}|,|0}}-{{# | + | -->{{#if:{{{3|}}}|{{#ifexpr:{{#explode:{{{3}}}|,|0}}>{{#replace:{{{2}}}|,|+}}|{{#invoke:String|rep|1=<br> |
+ | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{3}}}|,|0}}-({{#replace:{{{2}}}|,|+}}) }} }} }}<br> | ||
{{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{3}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|1}}}}|{{{start|}}}}}<!-- | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{3}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|1}}}}|{{{start|}}}}}<!-- | ||
-->{{#if:{{{4|}}}||{{#ifexpr:{{#replace:{{{3|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | -->{{#if:{{{4|}}}||{{#ifexpr:{{#replace:{{{3|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{3|1}}}|,|-}} }} }} }} }} }}<!-- | {{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{3|1}}}|,|-}} }} }} }} }} }}<!-- | ||
− | -->{{#if:{{{4|}}}|{{#ifexpr:{{#explode:{{{4}}}|,|0}}>{{# | + | # Third non-empty cell(s). Can have blank cells before and/or after. |
− | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{4}}}|,|0}}-{{# | + | -->{{#if:{{{4|}}}|{{#ifexpr:{{#explode:{{{4}}}|,|0}}>{{#replace:{{{3}}}|,|+}}|{{#invoke:String|rep|1=<br> |
+ | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{4}}}|,|0}}-({{#replace:{{{3}}}|,|+}}) }} }} }}<br> | ||
{{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{4}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|2}}}}|{{{start|}}}}}<!-- | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{4}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|2}}}}|{{{start|}}}}}<!-- | ||
-->{{#if:{{{5|}}}||{{#ifexpr:{{#replace:{{{4|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | -->{{#if:{{{5|}}}||{{#ifexpr:{{#replace:{{{4|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{4|1}}}|,|-}} }} }} }} }} }}<!-- | {{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{4|1}}}|,|-}} }} }} }} }} }}<!-- | ||
− | -->{{#if:{{{5|}}}|{{#ifexpr:{{#explode:{{{5}}}|,|0}}>{{# | + | # Fourth non-empty cell(s). Can have blank cells before and/or after. |
− | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{5}}}|,|0}}-{{# | + | -->{{#if:{{{5|}}}|{{#ifexpr:{{#explode:{{{5}}}|,|0}}>{{#replace:{{{4}}}|,|+}}|{{#invoke:String|rep|1=<br> |
− | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{ | + | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{5}}}|,|0}}-({{#replace:{{{4}}}|,|+}}) }} }} }}<br> |
− | -->{{#if:{{{ | + | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{5}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|3}}}}|{{{start|}}}}}<!-- |
+ | -->{{#if:{{{6|}}}||{{#ifexpr:{{#replace:{{{5|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{5|1}}}|,|-}} }} }} }} }} }}<!-- | {{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{5|1}}}|,|-}} }} }} }} }} }}<!-- | ||
− | -->{{#if:{{{6|}}}|{{#ifexpr:{{#explode:{{{6}}}|,|0}}>{{# | + | # Fifth non-empty cell(s). Can have blank cells before and/or after. |
− | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{6}}}|,|0}}-{{# | + | -->{{#if:{{{6|}}}|{{#ifexpr:{{#explode:{{{6}}}|,|0}}>{{#replace:{{{5}}}|,|+}}|{{#invoke:String|rep|1=<br> |
+ | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{6}}}|,|0}}-({{#replace:{{{5}}}|,|+}}) }} }} }}<br> | ||
{{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{6}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|4}}}}|{{{start|}}}}}<!-- | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{6}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|4}}}}|{{{start|}}}}}<!-- | ||
-->{{#if:{{{7|}}}||{{#ifexpr:{{#replace:{{{6|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | -->{{#if:{{{7|}}}||{{#ifexpr:{{#replace:{{{6|1}}}|,|+}} <= 7|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{6|1}}}|,|-}} }} }} }} }} }}<!-- | {{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{6|1}}}|,|-}} }} }} }} }} }}<!-- | ||
+ | # Sixth non-empty cell(s). Can have blank cells before and/or after. | ||
-->{{#if:{{{7|}}}|{{#ifexpr:{{#explode:{{{7}}}|,|0}}>{{#explode:{{{6}}}|,|0}}+1|{{#invoke:String|rep|1=<br> | -->{{#if:{{{7|}}}|{{#ifexpr:{{#explode:{{{7}}}|,|0}}>{{#explode:{{{6}}}|,|0}}+1|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{7}}}|,|0}}-{{#explode:{{{6}}}|,|0}}-1}} }} }}<br> | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{7}}}|,|0}}-{{#explode:{{{6}}}|,|0}}-1}} }} }}<br> | ||
Line 120: | Line 136: | ||
{{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{7|1}}}|,|-}} }} }} }} }} }}<!-- | {{!}} style="padding:0px; border: 0px" {{!}} |2={{#expr: 8 - {{#replace:{{{7|1}}}|,|-}} }} }} }} }} }}<!-- | ||
+ | # Seventh non-empty cell(s). Can have blank cells before but not after. | ||
-->{{#if:{{{8|}}}|{{#ifexpr:{{#explode:{{{8}}}|,|0}}>{{#explode:{{{7}}}|,|0}}+1|{{#invoke:String|rep|1=<br> | -->{{#if:{{{8|}}}|{{#ifexpr:{{#explode:{{{8}}}|,|0}}>{{#explode:{{{7}}}|,|0}}+1|{{#invoke:String|rep|1=<br> | ||
{{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{8}}}|,|0}}-{{#explode:{{{7}}}|,|0}}-1}} }} }}<br> | {{!}} style="padding:0px; border: 0px" {{!}}|2={{#expr:{{#explode:{{{8}}}|,|0}}-{{#explode:{{{7}}}|,|0}}-1}} }} }}<br> | ||
{{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{8}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|6}}}}|{{{start|}}}}}}}<!-- | {{!}} {{Schedule week cell|{{{1}}}|{{#explode:{{{8}}}|,|1}}|{{{details|}}}|{{#if:{{{cols|}}}|{{#explode:{{{cols}}}|,|6}}}}|{{{start|}}}}}}}<!-- | ||
--></includeonly> | --></includeonly> |
Revision as of 10:03, 25 December 2019
Usage
Three templates work together to create a weekly event schedule, starting on a Sunday:
- Template:Schedule week header generates the header of the table.
- Template:Schedule week row generates a row in the table.
- Template:Schedule week cell is invoked by Template:Schedule week row to generates a cell in the table representing an event instance.
This template generates a single row of the table, indicating one or more instances of a single event being run during the week, as well as an optional prefix column indicating a grouping of events.
There are up to 8 positional parameters:
- Positional parameter 1 is the full name of the event in the schedule.
- Positional parameters 2 to 8 are each a comma-separated list of two values, each representing an instance of the event being run:
- The first value is the first day of the week on which the event runs.
- The second value is the number of days for which the event runs.
There are four optional named parameters:
pre:
Specify a group of rows. Use this parameter on the first row of the group. This parameter has a comma-separated pair of values:- The type of the group (e.g. "pvp", "pve", or "duel").
- The number of rows over which the group extends (e.g. "4").
details
- Further optional details necessary to unabiguously specify the event. For example, for a HoD event, the details field might contain "Elspeth" to distinguish it from Bolas HoD.cols
- A comma-separated list of color strings, one for each event instance during the week. For example, for a set of Training Grounds events, the cols field might contain "W,U,B,R,G", to show which variation of the event runs on which day.start
- A start time in UTC for the event which will be displayed in the tooltip, e.g. "16:00".
Example
The following shorthand:
{| {{Schedule week row|pre=pvp,5|Rising Tensions |2,1|3,1|4,1|5,1|6,1|start=04:00}} |} {{Schedule week header|February|24|2019}} {{Schedule week row|pre=pvp,5| Rising Tensions |2,1|3,1|4,1|5,1|6,1}} {{Schedule week row| Training Grounds |1,1|2,1|3,1|4,1|5,1|6,1|7,1}} {{Schedule week row| Trial of the Planes |2,1|3,1|4,1|5,1|6,1|cols=W,U,B,R,G}} {{Schedule week row| Hour of Revelation |1,2}} {{Schedule week row| Terrors in the Shadows |1,2|4,2|7,1}} {{Schedule week row|pre=pve,4| Oath of the Gatewatch: Part 1 |3,3}} {{Schedule week row| Oath of the Gatewatch: Part 2 |5,3}} {{Schedule week row| Return of the God-Pharaoh }} {{Schedule week row| Tour de Ravnica |1,1|start=04:00}} {{Schedule week row|pre=duel,1|Duel Decks: Zendikar vs Eldrazi|3,3}} |}
Produces:
PvP |
RT | |
|
|
|
|
|
Event schedule 24th February 2019 |
February | March | |||||||
---|---|---|---|---|---|---|---|---|---|
24 | 25 | 26 | 27 | 28 | 1 | 2 | |||
Sun | Mon | Tue | Wed | Thu | Fri | Sat | |||
PvP |
RT | |
|
|
|
|
|
||
TG | |
|
|
|
|
|
|
||
TotP | |
||||||||
HoR | |
Coalition |
|||||||
TiS | |
|
|
||||||
PvE |
OGW:1 | |
|
||||||
OGW:2 | |
||||||||
RGP | | |
||||||||
TdR | |
|
|||||||
Duel | ZvE | |
|