Template:Version: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
No edit summary
(added ability to include stub and cleanup in the version box, with auto resize, and orange border if stub/cleanup but data is uptodate.)
Line 5: Line 5:
| stub = Boolean
| stub = Boolean
| cleanup = Boolean
| cleanup = Boolean
| outdated = Boolean
| stubnote = String
| cleanupnote = String
}}
}}
</noinclude><includeonly>{{#vardefine:match<!--
</noinclude><includeonly>{{#vardefine:match<!--
Line 13: Line 14:
-->|{{#ifeq:{{#explode:{{{1}}}|.|0}}{{#explode:{{{1}}}|.|1}}{{#explode:{{{1}}}|.|2}}|{{#explode:{{Current_version}}|.|0}}{{#explode:{{Current_version}}|.|1}}{{#explode:{{Current_version}}|.|2}}|true|false}}}}}}<!--
-->|{{#ifeq:{{#explode:{{{1}}}|.|0}}{{#explode:{{{1}}}|.|1}}{{#explode:{{{1}}}|.|2}}|{{#explode:{{Current_version}}|.|0}}{{#explode:{{Current_version}}|.|1}}{{#explode:{{Current_version}}|.|2}}|true|false}}}}}}<!--


--><table class="version-control" style="border-color:{{#ifeq:{{#var:match}}|true|#3CB886|#993838}};">
--><table class="version-control" style="border-color:{{#ifeq:{{#var:match}}|true|{{#if:{{{cleanup|}}}|#ffa007|{{#if:{{{stub|}}}|#ffa007|#3CB886}}}}|#993838}};max-width:{{#if:{{{cleanup|}}}|{{#if:{{{stub|}}}|9|6}}|{{#if:{{{stub|}}}|6|3}}}}0%;">
<tr>
<tr>
<td style="width:10%;">[[File:Version Checkmark{{Space}}{{#ifeq:{{#var:match}}|true|True|False}}.png|70px]]</td>
{{#if: {{{cleanup|}}}|
<td style="padding-left:0;padding-right:0;"><div style="margin:0.3em 0px 0px; font-size:1.2em; border-bottom: 1px solid #303436;">'''Versioning - {{#ifeq:{{#var:match}}|true|Up-to-date|Potentially Outdated}}'''</div>
<td style="width:{{#if:{{{stub|}}}|6|8}}%;">[[File:Cleanup.svg|60px]]</td>
<td style="width:{{#if:{{{stub|}}}|27|42}}%;padding-left:0;padding-right:0.5em;border-right: 1px solid #303436;"><div style="font-size:1.2em;">'''Cleanup Required'''</div><span style="font-size:89%;">This article requires '''cleanup''' to meet this wiki's [[Official Barotrauma Wiki:Guidelines|quality standards]].{{#if:{{{cleanupnote|}}}|<br>NOTE: {{{cleanupnote}}}|}}</span></td>
|}}
{{#if: {{{stub|}}}|
<td style="width:{{#if:{{{cleanup|}}}|6|8}}%;">[[File:Icon-stub.png|60px]]</td>
<td style="width:{{#if:{{{cleanup|}}}|27|42}}%;padding-left:0;padding-right:0.5em;border-right: 1px solid #303436;"><div style="font-size:1.2em;">'''Stub'''</div><span style="font-size:89%;">This article is a '''[[:Category:Stubs|stub]].''' Help the {{SITENAME}} by [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it].{{#if:{{{stubnote|}}}|<br>NOTE: {{{stubnote}}}|}}</span></td>
|}}
<td style="width:{{#if:{{{cleanup|}}}|{{#if:{{{stub|}}}|7|8}}|{{#if:{{{stub|}}}|8|10}}}}%;">[[File:Version Checkmark{{Space}}{{#ifeq:{{#var:match}}|true|True|False}}.png|60px]]</td>
<td style="width:{{#if:{{{cleanup|}}}|{{#if:{{{stub|}}}|27|42}}|{{#if:{{{stub|}}}|42|90}}}}%;padding-left:0;padding-right:0;"><div style="font-size:1.2em; border-bottom: 1px solid #303436;">'''{{#ifeq:{{#var:match}}|true|Data is Up-to-date|Data is Potentially Outdated}}'''</div>
<span style="font-size:89%;"><!--
<span style="font-size:89%;"><!--


Line 23: Line 32:
-->|{{#if:{{{1|}}}|Last updated for version: [[Version history/Alpha#{{{1}}}{{!}}{{{1}}}]]|Last updated for unknown version}}<br>}}<!--
-->|{{#if:{{{1|}}}|Last updated for version: [[Version history/Alpha#{{{1}}}{{!}}{{{1}}}]]|Last updated for unknown version}}<br>}}<!--


-->Current game version: [[Version history/Alpha#{{Current_version}}{{!}}{{Current_version}}]]<!--
-->Current game version: [[Version history/Alpha#{{Current_version}}{{!}}{{Current_version}}]]
 
{{#if:{{{2|}}}|<br>NOTE: {{{2}}}|}}
-->{{#if:{{{2|}}}|<br>NOTE: {{{2}}}|}}
</span></td>
</span></td>
</tr>
</tr>
</table>{{#ifeq:{{#var:match}}|true||{{#ifeq:{{NAMESPACE}}|Template||[[Category:Potentially Outdated]]}}}}
</table>{{#ifeq:{{NAMESPACE}}|Template||{{#ifeq:{{#var:match}}|true||[[Category:Potentially Outdated]]}}{{#if:{{{stub|}}}||[[Category:Stubs]][[Category:Problem articles]]}}{{#if:{{{cleanup|}}}||[[Category:Cleanup]][[Category:Problem articles]]}}}}
{{#cargo_store:_table=PageStatus
{{#cargo_store:_table=PageStatus
| version = {{{1|}}}
| version = {{{1|}}}
| note = {{{2|}}}
| stub = {{{stub|}}}
| cleanup = {{{cleanup|}}}
| stubnote = {{{stubnote|}}}
| cleanupnote = {{{cleanupnote|}}}
}}</includeonly>
}}</includeonly>

Revision as of 21:10, 7 November 2021

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 unknown version
Current game version: 1.4.5.0


{{Version|0.10.0.0|Outdated images.}} gives:
Data is Potentially Outdated

Last updated for version: 0.10.0.0
Current game version: 1.4.5.0
NOTE: Outdated Images


{{Version|1.4.5.0|Partially outdated images.}} gives:
Data is Up-to-date

Current game version: 1.4.5.0
NOTE: Partially outdated images


{{Version|deletion=yes|deletionnote=Duplicate page.}} gives:
Data is Potentially Outdated

Last updated for unknown version
Current game version: 1.4.5.0


{{Version|0.8.2.3}} gives:
Data is Potentially Outdated

Last updated for version: 0.8.2.3
Current game version: 1.4.5.0


{{Version|1.0.7.0|name=Screwdriver}} gives:
Data is Potentially Outdated

Last updated for version: 1.0.7.0
Current game version: 1.4.5.0


{{Version|1.0.7.0|name=Mudraptor}} gives:
Data is Potentially Outdated

Last updated for version: 1.0.7.0
Current game version: 1.4.5.0


{{Version|1.1.18.0|name=Mudraptor}} gives:
Data is Potentially Outdated

Last updated for version: 1.1.18.0
Current game version: 1.4.5.0


{{Version|0.20.16.1|name=I Am That Guy|debug=y|nosearch=y}} gives:
Data is Potentially Outdated

Last updated for version: 0.20.16.1
Current game version: 1.4.5.0


{{Version|1.0.0.0|name=PageNameNotInChangelogs|search=search1,search2,search3,traitors|debug=y}} gives:
Data is Potentially Outdated

Last updated for version: 1.0.0.0
Current game version: 1.4.5.0

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