Difference between revisions of "Template:Editnotice"

From Timelines
Jump to: navigation, search
(add support for expiry dates on edit notices)
(Undid revision 410524082 by MSGJ (talk)that broke some editnotices, one at WP:ERRORS for example)
Line 1: Line 1:
{{#ifeq:{{FULLROOTPAGENAME}}|Template:Editnotices
+
{{fmbox
  |{{notice|The following editnotice ''{{#switch:{{{expiry|¬}}}
+
|type      = editnotice
  |indefinite = is set to never expire
+
  |id        = {{{id|}}}
  |
+
|textstyle = {{{textstyle|}}}
  |¬          = does not have an expiry time set
+
|style     = {{{style|}}}
  |#default  = {{#iferror:{{#time:U|{{{expiry}}}}}
+
|image    = {{#if:{{{image|}}}
    |has an invalid expiry time
+
  |{{image|{{{image}}}|40x40px}}
     |{{#ifexpr:{{#time:U|{{{expiry}}}}}-{{#time:U|{{CURRENTTIMESTAMP}}}}>0
+
   |none
    |will expire {{{expiry}}}
 
    |expired {{{expiry}}}
 
    }}
 
  }}
 
   }}''. To adjust this setting, please update the {{para|expiry}} parameter.
 
 
  }}
 
  }}
}}{{#ifexpr:{{#ifeq:{{FULLROOTPAGENAME}}|Template:Editnotices
+
|imageright    = {{#if:{{{imageright|}}}
  |1
+
   |{{image|{{{imageright}}}|40x40px}}
  |0
 
}}+{{#switch:{{{expiry|¬}}}
 
   |indefinite = 1
 
  |
 
  |¬          = 1 <!-- Expiry not specified -->
 
  |#default  = {{#iferror:{{#time:U|{{{expiry}}}}}
 
  |0 <!-- Invalid expiry time -->
 
  |{{#ifexpr:{{#time:U|{{{expiry}}}}}-{{#time:U|{{CURRENTTIMESTAMP}}}}>0
 
    |1 <!-- Notice current -->
 
    |0 <!-- Notice expired -->
 
  }}
 
  }}
 
 
  }}
 
  }}
  |{{fmbox
+
  |text      = {{#if:{{{header|}}}
  |type      = editnotice
+
  |<dl><dt style="{{{headerstyle|}}}">{{{header}}}</dt></dl>
  |id        = {{{id|}}}
 
  |textstyle = {{{textstyle|}}}
 
  |style    = {{{style|}}}
 
  |image    = {{#if:{{{image|}}}
 
  |{{image|{{{image}}}|40x40px}}
 
  |none
 
  }}
 
  |imageright= {{#if:{{{imageright|}}}
 
  |{{image|{{{imageright}}}|40x40px}}
 
  }}
 
  |text      = {{#if:{{{header|}}}
 
  |<dl><dt style="{{{headerstyle|}}}">{{{header}}}</dt></dl>
 
  }}
 
{{{text|{{{1}}}}}}
 
 
  }}
 
  }}
 +
{{{text|{{{1}}}}}}
 
}}<noinclude>
 
}}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 01:58, 28 January 2011

Template documentation[create]