Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.

Difference between revisions of "Template:Assignment/row"

From PCGamingWiki, the wiki about fixing PC games
m (added date formating)
m (piped variables)
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><tr class="template-infotable-body table-assignment-body-row">
+
<includeonly><tr class="template-infotable-body table-assignment-body-row">{{#if: {{{disableAppliedLinks|}}}{{#var:disableAppliedLinksGlobal|}} | {{#vardefine:disableAppliedLinksLocal|true}} }}
<td class="table-assignment-body-game"> [[{{{1}}}]] </td>
+
<td class="table-assignment-body-game"> [[{{{1|}}}]] </td>
 
<td class="table-assignment-body-status" data-sort-value="{{{2|}}}">{{Assignment/tickcross|{{{2|}}}}}</td>
 
<td class="table-assignment-body-status" data-sort-value="{{{2|}}}">{{Assignment/tickcross|{{{2|}}}}}</td>
<td class="table-availability-body-DRM" data-sort-value="{{{3|}}}">{{#if: {{{3}}}|{{#arraymap:{{{3|}}}|,|x|{{Availability/DRM|x|{{#switch: {{lc:{{{3|}}}}}
+
<td class="table-availability-body-DRM" data-sort-value="{{{3|}}}">{{#if: {{{3|}}} |{{#arraymaptemplate:{{{3|}}}|Availability/DRM|,|}}|{{Availability/DRM}}}}</td>
|amazon
+
<td class="table-assignment-body-release-date" style="text-align: center">{{#if: {{{4|}}} | {{#time: F j, Y | {{{4|}}} }} }}</td>
|amazon.com = Amazon
+
<td class="table-assignment-body-applied">{{#if: {{{5|}}}|{{#arraymap:{{{5|}}}|,|x|[[User:x|x]] ([[User talk:x|t]]{{!}}[[Special:Contributions/x|c]]{{#ifeq: {{#var:disableAppliedLinksLocal|}} | true | |{{!}}[{{PCGamingWiki:Assignments/Assignees/row/allApplied|x}} a]}})|<br/>}}}}</td>
|amazon.co.uk = Amazon UK
+
<td class="table-assignment-body-completion-date" style="text-align: center">{{#if: {{{6|}}} | {{#time: F j, Y | {{{6|}}} }} }}</td>
|battle.net = Battlenet
+
<td class="table-assignment-body-assigned">{{#if: {{{7|}}}|{{#arraymap:{{{7|}}}|,|x|[[User:x|x]] ([[User talk:x|t]]{{!}}[[Special:Contributions/x|c]]{{#ifeq: {{#var:disableAppliedLinksLocal|}} | true | |{{!}}[{{PCGamingWiki:Assignments/Assignees/row/allApplied|x}} a]}})|<br/>}}}}</td>
|bethesda
 
|bethesda.net = Bethesdanet
 
|epic games store = Epic Games Store
 
|gog
 
|gog.com = GOGcom
 
|gmg = Green Man Gaming
 
|humble = Humble Store
 
|itch.io = itchio
 
|macapp = Mac App Store
 
|oculus = Oculus Store
 
|steam-sub
 
|steam-bundle = Steam
 
|#Default={{{3|}}}
 
}}}}|}}|{{Availability/DRM}}}}</td>
 
<td class="table-assignment-body-release-date" style="text-align: center">{{#time:d F, Y|{{{4|}}}}}</td>
 
<td class="table-assignment-body-applied">{{#if: {{{5}}}|{{#arraymap:{{{5|}}}|,|x|[[User:x|x]] ([[User talk:x|t]]{{!}}[[Special:Contributions/x|c]])|<br/>}}}}</td>
 
<td class="table-assignment-body-completion-date" style="text-align: center">{{#time:d F, Y|{{{6|}}}}}</td>
 
<td class="table-assignment-body-assigned">{{#if: {{{7}}}|{{#arraymap:{{{7|}}}|,|x|[[User:x|x]] ([[User talk:x|t]]{{!}}[[Special:Contributions/x|c]])|<br/>}}}}</td>
 
 
<td class="table-assignment-body-notes">{{{8|}}}</td>
 
<td class="table-assignment-body-notes">{{{8|}}}</td>
 
</tr></includeonly><noinclude>{{#cargo_declare:
 
</tr></includeonly><noinclude>{{#cargo_declare:
Line 35: Line 17:
 
|Completion_Date=Date
 
|Completion_Date=Date
 
|Assigned=List (,) of String
 
|Assigned=List (,) of String
|Notes=String
+
|Notes=Wikitext
}}</noinclude><includeonly>{{#cargo_store:
+
|EncodedName=String
 +
}}</noinclude><includeonly>{{#ifeq: {{NAMESPACE}} | PCGamingWiki | {{#cargo_store:
 
_table=Assignments
 
_table=Assignments
 
|Game={{{1|}}}
 
|Game={{{1|}}}
Line 46: Line 29:
 
|Assigned={{{7|}}}
 
|Assigned={{{7|}}}
 
|Notes={{{8|}}}
 
|Notes={{{8|}}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
+
|EncodedName={{urlencode:{{PAGENAME:{{{1|}}}}}|PATH}}
 +
}}}}{{#vardefine:disableAppliedLinksLocal|null}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 17:28, 7 April 2021

This template defines the table "Assignments". View table.

Documentation for the above template (sometimes hidden from view).

Description

Template used to define and store data in the cargo table Assignments. A call to this template with the appropriate parameters set will automatically store a new row in the table. Beyond that, it also displays the data in a table row with the relevant data separated in columns.

Because of {{PAGENAME}} does not necessarily output the same final text as just copy/pasting the page name manually, the template actually retrieves the exact {{PAGENAME}} value of a page before encoding it and storing it in the Cargo table in the EncodedName column. The exact call is as follows: {{urlencode:{{PAGENAME:{{{1|}}}}}|PATH}}. This approach was necessary to circumvent situations where e.g. ; would cause the call from {{Assignment/checkAvailable}} to fail because of a mismatch between the stored game name and the actual page name as returned by {{PAGENAME}}. It also makes the check compatible with quotation marks and various special characters. See Aemony's userpage for more information.

Notes

This row-based table tries to cheat and re-use as much stuff from Template:Availability/DRM as possible.
For displaying rows as a part of {{#cargo_query}}, use Template:Assignment/row/displayonly instead to prevent duplicate rows from being created.

Syntax

{{Assignment/row| title | state | platform | release_date | applied | completion_date | assigned | notes }}
  • title should match the name of the PCGW article of the game.
  • state can be various states, but the common ones are available, assigned, complete, and not available. Visit Template:Assignment/tickcross to see all possible states.
  • platform works the same as the DRM column of the Availability table.
  • release_date expects the typical MMMM DD, YYYY format (e.g. January 1, 1970). Might or might not work with other date formats.
  • applied is a list of users (comma-delimited) whom have applied for the assignment so far.
  • completion_date is the date when the assignment was completed by the assigned user(s).
  • assigned is a list of users (comma-delimited) whom have been assigned to perform the assignment.
  • notes is for notes that might apply.