[unchecked revision] | [unchecked revision] |
m (Ispoonz moved page Template:CargoConcept/SisterTeams to Template:SisterTeams without leaving a redirect) |
(Replaced content with "<noinclude>Category:Cargo Declaration Templates{{documentation|cargodec={{Attach|SisterTeams}} }}</noinclude><includeonly>{{#invoke:SisterTeams|main}}{{#ifeq:{{FULLPAG...") Tag: Replaced |
||
Line 1: | Line 1: | ||
− | <noinclude>[[Category:Cargo Declaration Templates]]{{documentation|cargodec={{ |
+ | <noinclude>[[Category:Cargo Declaration Templates]]{{documentation|cargodec={{Attach|SisterTeams}} |
+ | }}</noinclude><includeonly>{{#invoke:SisterTeams|main}}{{#ifeq:{{FULLPAGENAME}}|CargoConcept:SisterTeams||[[Category:Sister Team Data Pages]]}}</includeonly> |
||
− | |||
− | First make an array for each of active & inactive, as well as index i to 0 for the first loop. Use these arrays in the loops. |
||
− | |||
− | -->{{#arraydefine:active|{{{active|}}} }}<!-- |
||
− | -->{{#arraydefine:inactive|{{{inactive|}}} }}<!-- |
||
− | -->{{#arraydefine:allteams|{{{active|}}},{{{inactive|}}} }}<!-- |
||
− | -->{{#arraysort:allteams|asc}}<!-- |
||
− | -->{{#arrayunique:allteams}}<!-- |
||
− | -->{{#arrayunique:active}}<!-- |
||
− | -->{{#arrayunique:inactive}}<!-- |
||
− | -->{{#vardefine:i|0}}<!-- |
||
− | |||
− | Make the default markup lines for both active & inactive, since the exact list will be stored for each team of the opposite type. |
||
− | |||
− | -->Active Markup: {{#if:{{{active|}}}|{{#vardefineecho:active-markup|{{#arraymaptemplate:{{{active|}}}|CargoConcept/SisterTeams/Markup|,|,}}<!-- end vardefine -->}}<!-- end if -->}}<br> |
||
− | Inactive Markup: {{#if:{{{inactive|}}}|{{#vardefineecho:inactive-markup|{{#arraymaptemplate:{{{inactive|}}}|CargoConcept/SisterTeams/Markup|,|,}}<!-- end vardefine -->}}<!-- end if -->}}<br> |
||
− | All regular: {{#vardefineecho:allteams|{{#arrayprint:allteams}} }}<br> |
||
− | All Markup: {{#vardefineecho:allteams-markup|{{#arraymaptemplate:{{#var:allteams}}|CargoConcept/SisterTeams/Markup|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | -->{{#while: |
||
− | |{{#vardefineecho:this|{{#arrayindex:active|{{#var:i}} }} }} |
||
− | |<!-- |
||
− | |||
− | the NotThis template returns nothing if that entry is = this, otherwise it returns the entry. so we just remove "this" from the array for each element in the array. Since we don't want a team linking to itself. |
||
− | |||
− | -->{{#vardefine:active-notthis|{{#arraymaptemplate:{{{active}}}|CargoConcept/SisterTeams/NotThis|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | then make markup version of the same |
||
− | |||
− | -->{{#vardefine:active-notthis-markup|{{#arraymaptemplate:{{#var:active-notthis}}|CargoConcept/SisterTeams/Markup|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | Now we have to get rid of the leading separator if it exists |
||
− | |||
− | -->{{#vardefine:active-notthis|{{#arraymaptemplate:{{#var:active-notthis}}|Return|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | Now store everything in cargo. So this CargoConcept is actually storing multiple rows of the table. |
||
− | |||
− | -->{{#cargo_store: |
||
− | _table=CCSisterTeams |
||
− | |Team={{#var:this}} |
||
− | |Team_Markup={{team|{{#var:this}}|size=45px}} |
||
− | |Status=Active |
||
− | |ActiveList={{#var:active-notthis}} |
||
− | |InactiveList={{{inactive|}}} |
||
− | |Active_Markup={{#var:active-notthis-markup}} |
||
− | |Inactive_Markup={{#var:inactive-markup}} |
||
− | |AllTeams={{#var:allteams}} |
||
− | |AllTeams_Markup={{#var:allteams-markup}} |
||
− | }}{{#vardefine:i|{{#expr:{{#var:i}}+1}} }} |
||
− | }}<!-- |
||
− | |||
− | Reset i to 0 and repeat for inactive. |
||
− | |||
− | -->{{#vardefine:i|0}}<!-- |
||
− | |||
− | -->{{#while: |
||
− | |{{#vardefineecho:this|{{#arrayindex:inactive|{{#var:i}} }} }} |
||
− | | |
||
− | {{#vardefine:inactive-notthis|{{#arraymaptemplate:{{{inactive|}}}|CargoConcept/SisterTeams/NotThis|,|,}}<!-- end vardefine -->}} |
||
− | {{#vardefine:inactive-notthis-markup|{{#arraymaptemplate:{{#var:inactive-notthis|}}|CargoConcept/SisterTeams/Markup|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | Now we have to get rid of the leading separator if it exists |
||
− | |||
− | -->{{#vardefine:inactive-notthis|{{#arraymaptemplate:{{#var:inactive-notthis}}|Return|,|,}}<!-- end vardefine -->}}<!-- |
||
− | |||
− | now store in cargo |
||
− | |||
− | -->{{#cargo_store: |
||
− | _table=CCSisterTeams |
||
− | |Team={{#var:this}} |
||
− | |Team_Markup={{team|{{#var:this}}|size=45px}} |
||
− | |Status=Inactive |
||
− | |ActiveList={{{active|}}} |
||
− | |InactiveList={{#var:inactive-notthis}} |
||
− | |Active_Markup={{#var:active-markup}} |
||
− | |Inactive_Markup={{#var:inactive-notthis-markup}} |
||
− | |AllTeams={{#var:allteams}} |
||
− | |AllTeams_Markup={{#var:allteams-markup}} |
||
− | }}{{#vardefine:i|{{#expr:{{#var:i}}+1}} }} |
||
− | }}</includeonly> |
Revision as of 17:46, 13 August 2019
Documentation
Cargo Declaration
This template adds rows to the table "SisterTeams", which is declared by the template SisterTeams/CargoDec. View table. See {{SisterTeams/CargoDec}}
for table documentation. See {{CargoDeclare/SisterTeams}}m
to update documentation or table values.
About
This template actually creates multiple lines of the [CCSisterTeams]
table for each concept made. Also there is documentation in the code kinda. For copyable code go to make a new page and it will show you.
Usage
- All concepts should be located at
CargoConcept:<organization's flagship team name>/SisterTeams
, e.g.CargoConcept:Team SoloMid/SisterTeams
. - Please remember to alphabetize entries and use EXACT urls. Currently there is no team name correction via the
Teamnames
module; this may change in the future but it's not high priority since these pages are not user-facing & so it's easy enough for people editing these pages to just do it right.