Difference between revisions of "Timelinerow"
From Sega Retro
m (Text replacement - "Category:Sega Retro templates" to "Category:Templates") |
|||
(21 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | {{#vardefine:k|0}} | + | <includeonly>{{#vardefine:k|0}}{{incvar|tlcolor}}{{#if:{{{header|}}}|{{addvar|tlcolor|-1}}}}{{#ifeq:{{#var:tlcolor}}|8|{{#vardefine:tlcolor|1}}}} |
+ | {{#vardefine:tlcolorx|{{#switch:{{#var:tlcolor}} | ||
+ | |1=colour-bg-red | ||
+ | |2=colour-bg-orange | ||
+ | |3=colour-bg-yellow | ||
+ | |4=colour-bg-green | ||
+ | |5=colour-bg-cyan | ||
+ | |6=colour-bg-blue | ||
+ | |7=colour-bg-magenta | ||
+ | }}}} | ||
{{#fornumargs: i | {{#fornumargs: i | ||
| j | | j | ||
− | | {{incvar|k}} | + | | {{incvar|k}}{{#vardefine:val_{{#var:i}}|{{#var:j}}}} |
}} | }} | ||
{{!}}{{#loop: i | {{!}}{{#loop: i | ||
| 0 | | 0 | ||
| {{#expr:{{#var:k}}/3}} | | {{#expr:{{#var:k}}/3}} | ||
− | | style="background- | + | | |
+ | {{#vardefine:vstart|{{#var:val_{{#expr: ({{#var:i}}*3)+2 }}}}}} | ||
+ | {{#vardefine:vend|{{#var:val_{{#expr: ({{#var:i}}*3)+3 }}}}}} | ||
+ | {{#vardefine:vprev|{{#var:val_{{#expr: {{#var:i}}*3 }}}}}} | ||
+ | {{#ifeq: {{#var:i}} | 0 | {{#ifexpr: {{#var:tlstart}} <> {{#var:vstart}} | colspan="{{#expr:{{#var:vstart}}-{{#var:tlstart}}}}" {{!}} {{!}}{{!}} }} | | ||
+ | {{#ifexpr: {{#var:vstart}}-{{#var:vprev}} > 1 | colspan="{{#expr:{{#var:vstart}}-{{#var:vprev}}-1}}" {{!}} {{!}}{{!}} }} | ||
+ | }} style="border:1px solid grey; text-align:{{#if:{{{header|}}}|center; background:gainsboro; font-weight:bold|left}};" class="{{#var:tlcolorx}}" colspan="{{#expr:{{#var:vend}}-{{#var:vstart}}+1}}" {{!}} {{#var:val_{{#expr: ({{#var:i}}*3)+1 }}}} {{#ifexpr: {{#var:i}} < {{#expr:({{#var:k}}/3)-1}} | {{!}}{{!}} }} | ||
}} | }} | ||
− | {{!}}- | + | {{!}}-style="font-size:12px;"</includeonly><noinclude> |
+ | See [[Template:Timeline]] for usage. | ||
+ | [[Category:Templates]] | ||
+ | </noinclude> |
Latest revision as of 17:09, 1 January 2022
See Template:Timeline for usage.