Difference between revisions of "Template:ArticleStatus"
From Game Logs
m (Protected "Template:ArticleStatus": шаблон [edit=sysop:move=sysop]) |
(port the template to MW 1.30 and work around older extensions by using a monkey-patched new one.) |
||
(7 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{ #vardefine: rip | | + | <includeonly>{{ #UR-silence: |
− | <noinclude> | + | |
− | + | {{ #vardefine: rip | '''R.I.P.''' }} | |
− | + | {{ #vardefine: frozen | '''frozen''' }} | |
− | + | {{ #vardefine: active | '''active''' }} | |
− | + | {{ #vardefine: descriptionString | {{ | |
− | + | #if: {{{Description|}}} | {{{Description|}}} | {{{Name}}} | |
− | + | }}}} | |
− | + | {{ #vardefine: activeArticleString | {{ | |
− | + | #if: {{{ActiveArticle|}}} | {{{ActiveArticle|}}} | {{{Name}}} | |
− | + | }}}} | |
− | + | {{ #vardefine: lastTimePageInfo| {{REVISIONTIMESTAMP:{{ #var:activeArticleString | touched | {{{DisableCache|false}}} }}}} }} | |
− | + | {{ #vardefine: lastTime | {{ #UR-daysAgo: {{#var: lastTimePageInfo }} }} }} | |
− | + | {{ #vardefine: currentStatus | {{ | |
+ | #ifexpr: {{ #var: lastTime }} > 180 | {{ #var: rip }} | {{ | ||
+ | #ifexpr: {{ #var: lastTime }} > 30 | {{ #var: frozen }} | {{ #var: active }} | ||
+ | }} | ||
+ | }}}} | ||
+ | {{ #vardefine: statusString | {{ | ||
+ | #switch: {{{Status|auto}}} | | ||
+ | rip = {{ #var: rip }} | | ||
+ | frozen = {{ #var: frozen }} | | ||
+ | active = {{ #var: active }} | | ||
+ | auto = {{ #var: currentStatus }} | | ||
+ | {{{Status|auto}}} | ||
+ | }}}} | ||
+ | |||
+ | }} | ||
+ | [[{{{Name}}}|{{ #var: descriptionString }}]] [{{ #ifeq: {{{Status|auto}}} | no || status: {{ #var: statusString }} | }}updated: '''{{#time: j F Y | {{ #var: lastTimePageInfo }} }}''']</includeonly><noinclude> | ||
+ | |||
+ | |||
+ | This template can be used to show status of one wiki page on another page. | ||
+ | |||
+ | '''Parameters''': | ||
+ | |||
+ | *Name - name of article, should be equal to link in wiki (e.g. The Schema). Required to proper work. | ||
+ | |||
+ | *Description - description of article. Can be any string. It'll be shown to user. If empty or didn't specified - Name used instead of Description. | ||
+ | |||
+ | *Status - status of article: | ||
+ | **auto - this is used by default, means that status determined from last update date of page. | ||
+ | **rip - predefined status. It would be set by auto, if article wasn't updated for 180 days. | ||
+ | **frozen - predefined status. It would be set by auto, if article wasn't updated for 30 days. | ||
+ | **active - predefined status. It would be set by auto, if article was updated in 30 days. | ||
+ | **no - predefined status. Use this, if you don't want to see status string. | ||
+ | **any other string - it'll be shown without change. | ||
+ | |||
+ | *ActiveArticle - page, which will be used to determine auto status. Default is Name. | ||
+ | |||
+ | *DisableCache - disables wiki cache for page. | ||
+ | **false - this is default value. Cache is enabled. | ||
+ | **true - disables cache. | ||
+ | |||
+ | [[ArticleStatusTest|In action]] | ||
[[Category:Appearance]] | [[Category:Appearance]] | ||
</noinclude> | </noinclude> |
Latest revision as of 16:45, 18 February 2018
This template can be used to show status of one wiki page on another page.
Parameters:
- Name - name of article, should be equal to link in wiki (e.g. The Schema). Required to proper work.
- Description - description of article. Can be any string. It'll be shown to user. If empty or didn't specified - Name used instead of Description.
- Status - status of article:
- auto - this is used by default, means that status determined from last update date of page.
- rip - predefined status. It would be set by auto, if article wasn't updated for 180 days.
- frozen - predefined status. It would be set by auto, if article wasn't updated for 30 days.
- active - predefined status. It would be set by auto, if article was updated in 30 days.
- no - predefined status. Use this, if you don't want to see status string.
- any other string - it'll be shown without change.
- ActiveArticle - page, which will be used to determine auto status. Default is Name.
- DisableCache - disables wiki cache for page.
- false - this is default value. Cache is enabled.
- true - disables cache.