Template:Version: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
mNo edit summary
mNo edit summary
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{doc}}[[Category:Templates]][[Category:Cargo Declaration Templates]][[Category:Cargo Storage Templates]]
{{doc}}[[Category:Templates]][[Category:Cargo Declaration Templates]][[Category:Cargo Storage Templates]]
{{#cargo_declare:_table=PageStatus
{{#cargo_declare:_table=PageStatus
<!-- Version Control -->
| namespace = String
| namespace = String
| pageid = Integer
| pageid   = Integer
| revid = Integer
| revid     = Integer
| revdate = Date
| revdate   = Date
| version = String
| version   = String
| note = String
| lastmention = String
| spoiler = Boolean
| state    = String
| spoilersect = String
| note      = Wikitext
| deletion = Boolean
<!-- Deletion -->
| deletion     = Boolean
| deletionnote = Wikitext
| deletionnote = Wikitext
| stub = Boolean
<!-- Stubs -->
| stub     = Boolean
| stubnote = Wikitext
| stubnote = Wikitext
| cleanup = Boolean
<!-- Cleanup -->
| cleanup     = Boolean
| cleanupnote = Wikitext
| cleanupnote = Wikitext
}}<onlyinclude><includeonly>{{#vardefine:match|{{#ifeq:{{{1|}}}|{{Current version}}|True|{{#ifeq:{{#explode:{{{1|}}}|.|0}}{{#explode:{{{1|}}}|.|1}}|{{#explode:{{Current_version}}|.|0}}{{#explode:{{Current_version}}|.|1}}|True|{{#ifeq:{{{1|}}}|0.8.2.3|Legacy|False}}}}}}}}<!--
}}<onlyinclude><includeonly><!--
-->{| class="version-control" style="border-color:#{{#ifeq:{{#var:match}}|True|3CB886|993838}}"
 
{{#if:{{{spoiler|}}}|{{!}}style="width:5%; padding-left:0; padding-right:0" rowspan="2"{{!}}[[File:Event JacovSubra1.png|60px]]
-->{{#vardefine:ChangelogSearchResult|{{#if:{{{nosearch|}}}|Unknown,|{{FindInChangelog|pageversion={{{1|}}}|name={{{name|}}}|search={{{search|}}}}}}}}}<!--
{{!}}style="width:45%; padding:0; border-bottom: 1px solid #303436"{{!}}<big>'''This page contains spoilers'''</big>}}
 
|style="width:{{#if:{{{spoiler|}}}|5|10}}%; padding-left:0; padding-right:0;{{#if:{{{spoiler|}}}|border-left: 1px solid #303436}}" rowspan="2"|[[File:{{#ifeq:{{#var:match}}|Legacy|icon-outdated-bt|Version Checkmark {{#var:match}}}}.png|60px]]
-->{{#vardefine:UpToDateOrOutdated|{{#explode:{{#var:ChangelogSearchResult}}|,|0}}}}<!--
|style="width:{{#if:{{{spoiler|}}}|45|90}}%; padding:0; border-bottom: 1px solid #303436"|<big>'''{{#switch:{{#var:match}}|True=Data is up-to-date|Legacy=This page is a [[Version History/Legacy|Legacy]] article|False=Data is potentially outdated}}'''</big>
-->{{#vardefine:LatestChangelogVersion|{{#explode:{{#var:ChangelogSearchResult}}|,|1}}}}<!--
-->{{#vardefine:State|{{#switch:{{{1|}}}
|=Outdated
|{{Current version}}=UpToDate
|0.8.2.3=Legacy
|#default={{#switch:{{#var:UpToDateOrOutdated}}|UpToDate=UpToDate|Unknown={{#ifexpr:{{#explode:{{{1|}}}|.|0}}=0|Outdated|{{#if:{{{nosearch|}}}|Outdated|UpToDate}}}}|#default=Outdated}} <!-- If finds the pagename mentioned in newer version changelogs then = Outdated, else UpToDate-->
}}}}<!--
 
 
 
-->{{#if:{{{debug|}}}|<br>
PageName: {{PAGENAME}}<br>
NameParameter: {{{name|}}}<br>
Search: {{{search|}}}<br>
NoSearch: {{{nosearch|}}}<br>
<br>
FindInChangelog: {{FindInChangelog|pageversion={{{1|}}}|name={{{name|}}}|search={{{search|}}}}}
 
ChangelogSearchResult: {{#var:ChangelogSearchResult}}
 
UpToDateOrOutdated: {{#var:UpToDateOrOutdated}}
 
LatestChangelogVersion: {{#var:LatestChangelogVersion}}
 
FinalState: {{#var:State}}
}}<!--
 
 
 
  Border -->
{| class="version-control" style="border-color:#{{#switch:{{#var:State}}|UpToDate=3CB886|Legacy=993838|Outdated=993838}}"<!--
 
  Deletion -->
{{#if:{{{deletion|}}}|{{!}} style="width:5%; padding-left:0; padding-right:0" rowspan="2" {{!}} [[File:Order Dismiss.png|x64px]]
{{!}} style="width:45%; padding:0; border-bottom:1px solid #303436" {{!}} <big>'''Page is a candidate for deletion'''</big>}}<!--
 
  Icon -->
| style="width:{{#if:{{{deletion|}}}|5|10}}%; padding-left:0; padding-right:0" rowspan="2" | [[File:{{#switch:{{#var:State}}
|UpToDate=Version Checkmark True
|Legacy=icon-outdated-bt
|Outdated=Version Checkmark False}}.png|x64px]]<!--
 
  Text -->
| style="width:{{#if:{{{deletion|}}}|45|90}}%; padding:0; border-bottom:1px solid #303436" | <big>'''{{#switch:{{#var:State}}
|UpToDate=Data is up-to-date
|Legacy=This page is a [[Version History#Legacy|Legacy]] article
|Outdated=Data is potentially outdated}}'''</big><!--
 
  Deletion note -->
|-
|-
{{#if:{{{spoiler|}}}|{{!}}style="padding:0{{!}}''Do not read {{#if:{{{spoilersection|}}}| [[{{FULLPAGENAME}}#{{{spoilersection|}}}{{!}}{{{spoilersection|}}}]]|this page}} if you don't want to be spoiled.''}}
{{#if:{{{deletion|}}}|{{!}} style="padding:0" {{!}} Reason: '''{{{deletionnote|No reason provided.}}}'''}}<!--
|style="padding:0; font-size:{{#ifeq:{{#var:match}}|Legacy|100|90}}%"|{{#ifeq:{{#var:match}}|Legacy|''Features described on this page are no longer in the game.''|Last updated for {{#if:{{{1|}}}|version|an}} '''{{v|{{{1|}}}|numonly}}'''<br>The current game version is '''{{v|{{Current_version}}|numonly}}'''{{#if:{{{2|}}}|<br>Notes: {{{2|}}}}}{{#if:{{{deletion|}}}|{{#if:{{{deletenote|}}}|<br>Deletion Reasoning: {{{deletenote}}}}}}}{{#if:{{{cleanup|}}}|{{#if:{{{cleanupnote|}}}|<br>Cleanup Notes: {{{cleanupnote}}}}}}}{{#if:{{{stub|}}}|{{#if:{{{stubnote|}}}|<br>Stub Notes: {{{stubnote|}}}}}}}}}
 
  Versions -->
| style="padding:0; font-size:{{#ifeq:{{{1|}}}|0.8.2.3|100|90}}%" |{{#switch:{{#var:State}}
|UpToDate=Last updated for {{#if:{{{1|}}}|version|an}} '''{{v|{{{1|}}}|numonly}}'''<br><!--
-->{{#ifeq:{{{1|}}}|{{Current version}}||{{#ifeq:{{#var:UpToDateOrOutdated}}|Unknown||Last mentioned in changelog '''{{v|{{#var:LatestChangelogVersion}}|numonly}}'''<br>}}}}<!--
-->The current game version is '''{{v|{{Current_version}}|numonly}}'''
|Legacy=''Features described on this page are no longer in the game.''
|Outdated=Last updated for {{#if:{{{1|}}}|version|an}} '''{{v|{{{1|}}}|numonly}}'''<br><!--
-->{{#ifeq:{{{1|}}}|{{Current version}}||{{#ifeq:{{#var:UpToDateOrOutdated}}|Unknown||Last mentioned in changelog '''{{v|{{#var:LatestChangelogVersion}}|numonly}}'''<br>}}}}<!--
-->The current game version is '''{{v|{{Current_version}}|numonly}}'''
}}<!--
 
  Notes
-->{{#if:{{{2|}}}|<br>Notes: {{{2|}}}}}{{#if:{{{cleanup|}}}|{{#if:{{{cleanupnote|}}}|<br>Cleanup Notes: {{{cleanupnote}}}}}}}{{#if:{{{stub|}}}|{{#if:{{{stubnote|}}}|<br>Stub Notes: {{{stubnote|}}}}}}}<!--
 
-->
|}<!--
|}<!--
-->{{#if:{{{delete|}}}|{{TEX|Version|<indicator name="delete">[[File:Order Dismiss.png|32px|This page is a candidate for deletion.|link=:Category:Candidates for deletion]]</indicator>[[Category:Candidates for deletion]][[Category:Problem articles]]}}}}<!--
 
-->{{#if:{{{cleanup|}}}|{{TEX|Version|<indicator name="cleanup">[[File:Order Cleanup Items.png|32px|This article requires cleanup to meet quality standards.|link=:Category:Cleanup]]</indicator>[[Category:Cleanup]][[Category:Problem articles]]}}}}<!--
-->{{#switch:{{NAMESPACE}}|Template=|User=|#default={{#switch:{{#var:State}}
-->{{#if:{{{stub|}}}|{{TEX|Version|<indicator name="stub">[[File:Icon-stub.png|32px|This article is a stub.|link=:Category:Stubs]]</indicator>[[Category:Stubs]][[Category:Problem articles]]}}}}<!--
|UpToDate=
-->{{#ifeq:{{#var:match}}|False|{{TEX|Version|[[Category:Potentially Outdated]][[Category:Problem articles]]}}}}<!--
|Legacy=[[Category:Legacy Articles]]
-->{{#ifeq:{{#var:match}}|Legacy|{{TEX|Version|[[Category:Legacy Articles]][[Category:Problem articles]]}}}}<!--
|Outdated=[[Category:Potentially Outdated]][[Category:Problem articles]]}}<!--
-->{{TEX|Version|{{#cargo_store:_table=PageStatus
-->{{#if:{{{deletion|}}}|[[Category:Candidates for deletion]][[Category:Problem articles]]}}<!--
-->{{#if:{{{cleanup|}}}|<indicator name="cleanup">[[File:Order Cleanup Items.png|32px|This article requires cleanup to meet quality standards.|link=:Category:Cleanup]]</indicator>[[Category:Cleanup]][[Category:Problem articles]]}}<!--
-->{{#if:{{{stub|}}}|<indicator name="stub">[[File:Icon-stub.png|32px|This article is a stub.|link=:Category:Stubs]]</indicator>[[Category:Stubs]][[Category:Problem articles]]}}<!--
-->{{#cargo_store:_table=PageStatus
<!-- Version Control -->
<!-- Version Control -->
| namespace = {{NAMESPACE}}
| namespace = {{NAMESPACE}}
| pageid = {{PAGEID}}
| pageid   = {{PAGEID}}
| revid = {{REVISIONID:{{PAGENAME}}}}
| revid     = {{REVISIONID:{{PAGENAME}}}}
| revdate = {{REVISIONTIMESTAMP:{{PAGENAME}}}}
| revdate   = {{REVISIONTIMESTAMP:{{PAGENAME}}}}
| version = {{{1|}}}
| version   = {{{1|}}}
| note = {{{2|}}}
| lastmention = {{#var:LatestChangelogVersion}}
<!-- Spoiler -->
| state = {{#var:State}}
| spoiler = {{{spoiler|}}}
| note      = {{{2|}}}
| spoilersect = {{{spoilersection|}}}
<!-- Deletion -->
<!-- Deletion -->
| deletion = {{{delete|}}}
| deletion     = {{#if:{{{deletion|}}}|yes}}
| deletionnote = {{{deletenote|}}}
| deletionnote = {{{deletionnote|}}}
<!-- Stubs -->
<!-- Stubs -->
| stub = {{{stub|}}}
| stub     = {{#if:{{{stub|}}}|yes}}
| stubnote = {{{stubnote|}}}
| stubnote = {{{stubnote|}}}
<!-- Cleanup -->
<!-- Cleanup -->
| cleanup = {{{cleanup|}}}
| cleanup     = {{#if:{{{cleanup|}}}|yes}}
| cleanupnote = {{{cleanupnote|}}}
| cleanupnote = {{{cleanupnote|}}}
}}}}</includeonly></onlyinclude>
}}}}</includeonly></onlyinclude>

Latest revision as of 18:07, 25 December 2023

Documentation

This template is used to easily keep track of page content versions, as well as other flags. It should be placed at the very start of an article.


All of the collected information can be found in the Page Status template.


All parameters are optional.
If using 'delete', 'stub', or 'cleanup', "yes" must be added after an "=" sign, otherwise it might be interpreted as an "anonymous parameter". See examples below.


This template searches changelogs using the FindInChangelog template, to see if the page name has been mentioned in a newer version than the page was last updated for. If it wasn't, the page is considered up to date, even if the page version is lower than current game version. Configuration details in the table below.


Field Note Example Default
1 Version
  • If the page version is equal to current game version, it's considered up to date.
  • If the page version is lower than current game version, but it's name or keywords have only been found in an older changelog, it's considered up to date.
  • If the page version is lower than current game version, and it's name or keywords have been found in a more recent changelog, it's considered outdated.
  • If the page version is lower than current game version, and it's name or keywords have not been found in any changelog:
    • Above 1.0.0.0: It's considered up to date.
    • Under 1.0.0.0: It's considered outdated, instead of up to date.
  • If the page version equals 0.8.2.3, it's considered a legacy article.
1.0.7.0
2 Note Outdated images.
stub Is the article a stub yes
stubnote Note regarding stub status Add more content, images.
cleanup Is the article marked for cleanup yes
cleanupnote Note regarding cleanup status Page layout is hard to follow.
deletion Is the article marked for deletion yes
deletionnote Note regarding deletion status Duplicate page.
search Adds additional keywords to search for in changelogs (Example for Structures page) Wreck,Thalamus,Beacon,Outpost,Ruin
nosearch Disables search functionality. Page will default to outdated unless it's exactly at the current game version yes
debug Displays debug info yes
name Overrides the pagename that the template searches for in the changelogs. For debug/demonstration usage. screwdriver
{{PAGENAME}}

Syntax

{{Version|<version number>|<what is outdated?>|deletion=yes|deletionnote=<why should the page be deleted?>|stub=yes|stubnote=<what needs to be added?>|cleanup=yes|cleanupnote=<what needs to be improved?>}}

Examples


{{Version}} gives:

Data is potentially outdated
Last updated for an unknown version
Last mentioned in changelog 1.2.7.0
The current game version is 1.2.8.0

{{Version|0.10.0.0|Outdated images.}} gives:

Data is potentially outdated
Last updated for version 0.10.0.0
Last mentioned in changelog 1.2.7.0
The current game version is 1.2.8.0
Notes: Outdated Images

{{Version|1.2.8.0|Partially outdated images.}} gives:

Data is up-to-date
Last updated for version 1.2.8.0
The current game version is 1.2.8.0
Notes: Partially outdated images

{{Version|deletion=yes|deletionnote=Duplicate page.}} gives:

Page is a candidate for deletion Data is potentially outdated
Reason: Duplicate page. Last updated for an unknown version
Last mentioned in changelog 1.2.7.0
The current game version is 1.2.8.0

{{Version|0.8.2.3}} gives:

This page is a Legacy article
Features described on this page are no longer in the game.

{{Version|1.0.7.0|name=Screwdriver}} gives:

Data is up-to-date
Last updated for version 1.0.7.0
The current game version is 1.2.8.0

{{Version|1.0.7.0|name=Mudraptor}} gives:

Data is potentially outdated
Last updated for version 1.0.7.0
Last mentioned in changelog 1.1.18.0
The current game version is 1.2.8.0

{{Version|1.1.18.0|name=Mudraptor}} gives:

Data is up-to-date
Last updated for version 1.1.18.0
Last mentioned in changelog 1.1.18.0
The current game version is 1.2.8.0

{{Version|0.20.16.1|name=I Am That Guy|debug=y|nosearch=y}} gives:
PageName: Version
NameParameter: I Am That Guy
Search:
NoSearch: y

FindInChangelog: Unknown

ChangelogSearchResult: Unknown,

UpToDateOrOutdated: Unknown

LatestChangelogVersion:

FinalState: Outdated

Data is potentially outdated
Last updated for version 0.20.16.1
The current game version is 1.2.8.0

{{Version|1.0.0.0|name=PageNameNotInChangelogs|search=search1,search2,search3,traitors|debug=y}} gives:
PageName: Version
NameParameter: PageNameNotInChangelogs
Search: search1,search2,search3,traitors
NoSearch:

FindInChangelog:

Outdated,1.2.6.0

ChangelogSearchResult: Outdated,1.2.6.0

UpToDateOrOutdated: Outdated

LatestChangelogVersion: 1.2.6.0

FinalState: Outdated

Data is potentially outdated
Last updated for version 1.0.0.0
Last mentioned in changelog 1.2.6.0
The current game version is 1.2.8.0

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