Template:ArticleStatus: Difference between revisions

From Game Logs
Jump to navigationJump to search
Undo revision 6793 by Aen Sidhe (Talk)
port the template to MW 1.30 and work around older extensions by using a monkey-patched new one.
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<includeonly>{{ #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: {{#pageInfo:{{ #var:activeArticleString | touched | {{{DisableCache|false}}} }} }} }}{{  #vardefine: lastTime | {{#DateDiff: {{#time: c }} | {{#time: c | {{#var: lastTimePageInfo }} }} | days |{{{DisableCache|false}}} }}}}{{  #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 }} &#124;&nbsp; }}updated: '''{{#time: j F Y | {{ #var: lastTimePageInfo }} }}''']</includeonly>
<includeonly>{{ #UR-silence:
<noinclude>
 
*This template can be used to show status of one wiki page on another page.
    {{ #vardefine: rip | '''R.I.P.''' }}
*Parameters
    {{ #vardefine: frozen | '''frozen''' }}
**Name - name of article, should be equal to link in wiki (e.g. The Schema). Required to proper work.
    {{ #vardefine: active | '''active''' }}
**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.
    {{ #vardefine: descriptionString |  {{
**Status - status of article:
        #if: {{{Description|}}} |      {{{Description|}}} |      {{{Name}}}
***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.
    {{ #vardefine: activeArticleString | {{
***frozen - predefined status. It would be set by auto, if article wasn't updated for 30 days.
        #if: {{{ActiveArticle|}}} |      {{{ActiveArticle|}}} |      {{{Name}}}
***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.
    {{ #vardefine: lastTimePageInfo| {{REVISIONTIMESTAMP:{{ #var:activeArticleString | touched | {{{DisableCache|false}}} }}}} }}
***any other string - it'll be shown without change.
    {{  #vardefine: lastTime | {{ #UR-daysAgo: {{#var: lastTimePageInfo }} }} }}
**ActiveArticle - page, which will be used to determine auto status. Default is Name.
    {{  #vardefine: currentStatus |  {{
**DisableCache - disables wiki cache for page.
        #ifexpr: {{ #var: lastTime }} > 180 |      {{ #var: rip }} |      {{
***false - this is default value. Cache is enabled.
            #ifexpr: {{ #var: lastTime }} > 30 |          {{ #var: frozen }} |          {{ #var: active }}
***true - disables cache.
        }}
* [[ArticleStatusTest|In action]]
    }}}}
    {{  #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 }} &#124;&nbsp; }}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.

In action