Difference between revisions of "Template:Side event row"

From QBWiki
Jump to navigation Jump to search
m
 
(10 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
|{{#vardefine:categories|{{{cats|{{{3}}}}}}}}{{#vardefine:colors|
 
|{{#vardefine:categories|{{{cats|{{{3}}}}}}}}{{#vardefine:colors|
 
<!---->{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:
 
<!---->{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:
<!----><!---->{{#vardefine:categories}}|Arts|lavender
+
<!----><!---->{{#var:categories}}|Arts|lavender
<!----><!---->}}|History|#fcc
+
<!----><!---->}}|History|&#35;fcc
<!----><!---->}}|Literature|#fc9
+
<!----><!---->}}|Literature|&#35;fc9
 
<!----><!---->}}|Science|mediumspringgreen
 
<!----><!---->}}|Science|mediumspringgreen
 
<!----><!---->}}|Trash|bisque
 
<!----><!---->}}|Trash|bisque
}}}}{{#ifeq:{{#var:colors}}|{{#vardefine:categories}}||
+
}}}}{{#ifeq:{{#var:colors}}|{{#var:categories}}||
<!---->{{#if:{{#explode:{{#vardefine:categories}}|, |4}}
+
<!---->{{#if:{{#explode:{{#var:categories}}|, |4}}
 
<!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 20%, {{#explode:{{#var:colors}}|, |1}} 20% 40%, {{#explode:{{#var:colors}}|, |2}} 40% 60%, {{#explode:{{#var:colors}}|, |3}} 60% 80%, {{#explode:{{#var:colors}}|, |4}} 80%)"{{!}}
 
<!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 20%, {{#explode:{{#var:colors}}|, |1}} 20% 40%, {{#explode:{{#var:colors}}|, |2}} 40% 60%, {{#explode:{{#var:colors}}|, |3}} 60% 80%, {{#explode:{{#var:colors}}|, |4}} 80%)"{{!}}
<!----><!---->|{{#if:{{#explode:{{#vardefine:categories}}|, |3}}
+
<!----><!---->|{{#if:{{#explode:{{#var:categories}}|, |3}}
 
<!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 25%, {{#explode:{{#var:colors}}|, |1}} 25% 50%, {{#explode:{{#var:colors}}|, |2}} 50% 75%, {{#explode:{{#var:colors}}|, |3}} 75%)"{{!}}
 
<!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 25%, {{#explode:{{#var:colors}}|, |1}} 25% 50%, {{#explode:{{#var:colors}}|, |2}} 50% 75%, {{#explode:{{#var:colors}}|, |3}} 75%)"{{!}}
<!----><!----><!---->|{{#if:{{#explode:{{#vardefine:categories}}|, |2}}
+
<!----><!----><!---->|{{#if:{{#explode:{{#var:categories}}|, |2}}
 
<!----><!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 33%, {{#explode:{{#var:colors}}|, |1}} 33% 67%, {{#explode:{{#var:colors}}|, |2}} 67%)"{{!}}
 
<!----><!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 33%, {{#explode:{{#var:colors}}|, |1}} 33% 67%, {{#explode:{{#var:colors}}|, |2}} 67%)"{{!}}
<!----><!----><!----><!---->|{{#if:{{#explode:{{#vardefine:categories}}|, |1}}
+
<!----><!----><!----><!---->|{{#if:{{#explode:{{#var:categories}}|, |1}}
 
<!----><!----><!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 50%, {{#explode:{{#var:colors}}|, |1}} 50%)"{{!}}
 
<!----><!----><!----><!----><!---->|style="background: linear-gradient(100deg, {{#explode:{{#var:colors}}|, |0}} 50%, {{#explode:{{#var:colors}}|, |1}} 50%)"{{!}}
 
<!----><!----><!----><!----><!---->|style="background: {{#var:colors}}"{{!}}
 
<!----><!----><!----><!----><!---->|style="background: {{#var:colors}}"{{!}}
Line 23: Line 23:
 
<!----><!---->}}
 
<!----><!---->}}
 
<!---->}}
 
<!---->}}
}}{{#vardefine:categories}}
+
}}{{#var:categories}}
 
| {{{subject|{{{4|}}}}}}
 
| {{{subject|{{{4|}}}}}}
| {{#ifeq:{{{audiovisual|}}}|audio|style="background: azure" {{!}}}}<!--
+
| {{#if:{{{tossups|}}}|data-sort-value="{{{tossups}}}"}} {{#ifeq:{{{audiovisual|}}}|audio|style="background: azure"}}<!--
-->{{#ifeq:{{{audiovisual|}}}|visual|style="background: ivory" {{!}}}}{{{format|{{{5|}}}}}}
+
-->{{#ifeq:{{{audiovisual|}}}|visual|style="background: ivory"}}| {{{format|{{{5|}}}}}}
| {{#if:{{{numpackets|}}}|data-sort-value={{{numpackets}}}{{!}}}} {{{packets|{{{6|{{{numpackets|}}}}}}}}}
+
| data-sort-value="{{#replace:{{{packets|{{{6|}}}}}}|≈|}}"| {{{packets|{{{6|}}}}}}
 
| {{#if:{{{packetsub|}}}|style="background: linen"{{!}}}} {{{writers|{{{7|}}}}}}
 
| {{#if:{{{packetsub|}}}|style="background: linen"{{!}}}} {{{writers|{{{7|}}}}}}
 
| {{#if:{{{notes|{{{8|}}}}}}|{{{notes|{{{8}}}}}}{{#if:{{{cancelled|}}}|<br/>Cancelled}}|{{#if:{{{cancelled|}}}|Cancelled}}}}
 
| {{#if:{{{notes|{{{8|}}}}}}|{{{notes|{{{8}}}}}}{{#if:{{{cancelled|}}}|<br/>Cancelled}}|{{#if:{{{cancelled|}}}|Cancelled}}}}
Line 37: Line 37:
 
*{{{3}}}/cats - The category or categories of the side event. Multiple categories can be specified and should be separated by a comma and a space (", "). Any properly formatted combination of Arts, History, Literature, Science, and Trash will be colored - any other options will not be.
 
*{{{3}}}/cats - The category or categories of the side event. Multiple categories can be specified and should be separated by a comma and a space (", "). Any properly formatted combination of Arts, History, Literature, Science, and Trash will be colored - any other options will not be.
 
*{{{4}}}/subject (optional) - The specific subject/gimmick of the side event.
 
*{{{4}}}/subject (optional) - The specific subject/gimmick of the side event.
*{{{5}}}/format (optional) - The format of the side event.
+
*{{{5}}}/format (optional) - The format of the packets. Should lead with a number and optionally whether the questions are audio or visual.
 +
*tossups - The number of tossups per packet for sorting purposes. Should be used when the format leads with "≈" or there is some other kind of obfuscating text.
 
*audiovisual - Whether the set was an [[audio set]] ("audio"), a [[visual set]] ("visual"), or neither (empty).
 
*audiovisual - Whether the set was an [[audio set]] ("audio"), a [[visual set]] ("visual"), or neither (empty).
 
*{{{6}}}/packets (optional) - Link to the packets, with the number of packets.
 
*{{{6}}}/packets (optional) - Link to the packets, with the number of packets.
*numpackets - The number of packets, for sorting purposes.
 
 
*{{{7}}}/writers (optional) - The writers or organizers, as well as the means by which the set was organized (e.g. was it [[guerilla]]?)
 
*{{{7}}}/writers (optional) - The writers or organizers, as well as the means by which the set was organized (e.g. was it [[guerilla]]?)
 
*packetsub - Whether the set is a [[packet sub]] set. Any non-whitespace value will indicate that it is, while not using this will indicate that it isn't.
 
*packetsub - Whether the set is a [[packet sub]] set. Any non-whitespace value will indicate that it is, while not using this will indicate that it isn't.
Line 47: Line 47:
 
This template makes extensive use of [https://www.mediawiki.org/wiki/Help:Templates#Anonymous_parameters anonymous parameters]. A known problem when using anonymous parameters is that outside links will not work properly - to use links, use a named parameter. This means that the simplest case (i.e. a row with only anonymous parameters) can only be used if there are no links to announcements.
 
This template makes extensive use of [https://www.mediawiki.org/wiki/Help:Templates#Anonymous_parameters anonymous parameters]. A known problem when using anonymous parameters is that outside links will not work properly - to use links, use a named parameter. This means that the simplest case (i.e. a row with only anonymous parameters) can only be used if there are no links to announcements.
  
Note: providing multiple categories, of which some have valid colors, will result in no color in the cell and a malformed style in the HTML - this does not have any serious consequences but is worth noting. This can be resolved when switch statements work better, which they currently do not.
+
Note: providing multiple categories, of which only a subset have valid colors, will result in no color in the cell and a malformed style in the HTML - this does not have any serious consequences but is worth noting. This can be resolved when switch statements work better, which they currently do not.
  
 
To view the column names for this table, see [[Template:Side events table start]] or the example below.
 
To view the column names for this table, see [[Template:Side events table start]] or the example below.
Line 100: Line 100:
 
Example table:
 
Example table:
 
{{Side events table start}}
 
{{Side events table start}}
{{Side event row|January 1, 2000|Y2K|Science|The new millenium|2000 audio tossups|audiovisual=audio||Packet sub|packetsub=true|cancelled=true}}
+
{{Side event row|January 1, 2000|Y2K|Science|The new millenium|≈21 audio tossups|audiovisual=audio|Packet sub|packetsub=true|cancelled=true}}
{{Side event row|The year 3000|Art History|Arts, History|History, art, and art history|3000 visual tossups|audiovisual=visual|numpackets=150}}
+
{{Side event row|The year 3000|Art History|Arts, History|History, art, and art history|20 visual tossups|audiovisual=visual|6 packets|7}}
{{Side event row|February 29, 2019|FAKE|Arts, History, Literature, Science, Trash|Most subject tournament on fake things}}
+
{{Side event row|February 29, 2019|FAKE|Arts, History, Literature, Science, Trash}}
{{Side event row|February 30, 2020|FAKE II|General|All subject fake things|packets=Packets|notes=Notes}}
+
{{Side event row|February 30, 2020|FAKE II|General|packets=Packets|notes=Notes}}
{{Side event row|February 31, 2021|FAKE III|Arts, General|All subject fake things + all art is twice as fake|writers=Writers}}
+
{{Side event row|February 31, 2021|FAKE III|Arts, General|subject=Subject|writers=Writers}}
 +
{{Side event row|February 32, 2022|FAKE IV|Literature|packets=≈12}}
 +
{{Side event row|February 33, 2022|FAKE IV II|History, Literature|packets=13}}
 
{{Side events table end}}
 
{{Side events table end}}
  
 
<pre>
 
<pre>
{{Side event row|January 1, 2000|Y2K|Science|The new millenium|Audio tournament|audiovisual=audio||Packet sub|packetsub=true|cancelled=true}}
+
{{Side event row|January 1, 2000|Y2K|Science|The new millenium|≈21 audio tossups|tossups=21|audiovisual=audio|Packet sub|packetsub=true|cancelled=true}}
{{Side event row|The year 3000|Art History|Arts, History|History, art, and art history|Visual packet|audiovisual=visual|6 packets|numpackets=6|7}}
+
{{Side event row|The year 3000|Art History|Arts, History|History, art, and art history|20 visual tossups|audiovisual=visual|6 packets|7}}
 
{{Side event row|February 29, 2019|FAKE|Arts, History, Literature, Science, Trash}}
 
{{Side event row|February 29, 2019|FAKE|Arts, History, Literature, Science, Trash}}
 
{{Side event row|February 30, 2020|FAKE II|General|packets=Packets|notes=Notes}}
 
{{Side event row|February 30, 2020|FAKE II|General|packets=Packets|notes=Notes}}
 
{{Side event row|February 31, 2021|FAKE III|Arts, General|subject=Subject|writers=Writers}}
 
{{Side event row|February 31, 2021|FAKE III|Arts, General|subject=Subject|writers=Writers}}
{{Side event row|February 32, 2022|FAKE IV|misc|numpackets=12}}
+
{{Side event row|February 32, 2022|FAKE IV|Literature|packets=≈12}}
 +
{{Side event row|February 32, 2022|FAKE IV II|History, Literature|packets=13}}
 
</pre>
 
</pre>
  
 
</noinclude>
 
</noinclude>

Latest revision as of 10:31, 1 July 2021

A row of the table listing side events for a given year. For use in the List of side events page.

  • {{{1}}}/date - The date of the side event (assuming it has a singular date). Should include a link to the announcement.
  • {{{2}}}/name - The name of the side event. Should attempt to link to the page.
  • {{{3}}}/cats - The category or categories of the side event. Multiple categories can be specified and should be separated by a comma and a space (", "). Any properly formatted combination of Arts, History, Literature, Science, and Trash will be colored - any other options will not be.
  • {{{4}}}/subject (optional) - The specific subject/gimmick of the side event.
  • {{{5}}}/format (optional) - The format of the packets. Should lead with a number and optionally whether the questions are audio or visual.
  • tossups - The number of tossups per packet for sorting purposes. Should be used when the format leads with "≈" or there is some other kind of obfuscating text.
  • audiovisual - Whether the set was an audio set ("audio"), a visual set ("visual"), or neither (empty).
  • {{{6}}}/packets (optional) - Link to the packets, with the number of packets.
  • {{{7}}}/writers (optional) - The writers or organizers, as well as the means by which the set was organized (e.g. was it guerilla?)
  • packetsub - Whether the set is a packet sub set. Any non-whitespace value will indicate that it is, while not using this will indicate that it isn't.
  • {{{8}}} (optional) - Notes

This template makes extensive use of anonymous parameters. A known problem when using anonymous parameters is that outside links will not work properly - to use links, use a named parameter. This means that the simplest case (i.e. a row with only anonymous parameters) can only be used if there are no links to announcements.

Note: providing multiple categories, of which only a subset have valid colors, will result in no color in the cell and a malformed style in the HTML - this does not have any serious consequences but is worth noting. This can be resolved when switch statements work better, which they currently do not.

To view the column names for this table, see Template:Side events table start or the example below.

Examples of categories:

Arts History Literature Science Trash
Arts Arts Arts, History Arts, Literature Arts, Science Arts, Trash
History History, Arts History History, Literature History, Science History, Trash
Literature Literature, Arts Literature, History Literature Literature, Science Literature, Trash
Science Science, Arts Science, History Science, Literature Science Science, Trash
Trash Trash, Arts Trash, History Trash, Literature Trash, Science Trash

Similar patterns appear when provided more than two categories, but a table showing possible options cannot be easily rendered in 2D space and generally side events do not have many more than two.

Example table:

Date Name Category Subject or gimmick Format Packets Writers or organizers Notes
January 1, 2000 Y2K Science The new millenium ≈21 audio tossups Packet sub Cancelled
The year 3000 Art History Arts, History History, art, and art history 20 visual tossups 6 packets 7
February 29, 2019 FAKE Arts, History, Literature, Science, Trash
February 30, 2020 FAKE II General Packets Notes
February 31, 2021 FAKE III Arts, General Subject Writers
February 32, 2022 FAKE IV Literature ≈12
February 33, 2022 FAKE IV II History, Literature 13


{{Side event row|January 1, 2000|Y2K|Science|The new millenium|≈21 audio tossups|tossups=21|audiovisual=audio|Packet sub|packetsub=true|cancelled=true}}
{{Side event row|The year 3000|Art History|Arts, History|History, art, and art history|20 visual tossups|audiovisual=visual|6 packets|7}}
{{Side event row|February 29, 2019|FAKE|Arts, History, Literature, Science, Trash}}
{{Side event row|February 30, 2020|FAKE II|General|packets=Packets|notes=Notes}}
{{Side event row|February 31, 2021|FAKE III|Arts, General|subject=Subject|writers=Writers}}
{{Side event row|February 32, 2022|FAKE IV|Literature|packets=≈12}}
{{Side event row|February 32, 2022|FAKE IV II|History, Literature|packets=13}}