Difference between revisions of "Template:Editnotice"

From Timelines
Jump to: navigation, search
(add support for expiry dates on edit notices)
Line 1: Line 1:
{{fmbox
+
{{#ifeq:{{FULLROOTPAGENAME}}|Template:Editnotices
  |type      = editnotice
+
  |{{notice|The following editnotice ''{{#switch:{{{expiry|¬}}}
|id        = {{{id|}}}
+
  |indefinite = is set to never expire
|textstyle = {{{textstyle|}}}
+
  |
|style     = {{{style|}}}
+
  |¬          = does not have an expiry time set
|image    = {{#if:{{{image|}}}
+
  |#default  = {{#iferror:{{#time:U|{{{expiry}}}}}
  |{{image|{{{image}}}|40x40px}}
+
    |has an invalid expiry time
   |none
+
     |{{#ifexpr:{{#time:U|{{{expiry}}}}}-{{#time:U|{{CURRENTTIMESTAMP}}}}>0
 +
    |will expire {{{expiry}}}
 +
    |expired {{{expiry}}}
 +
    }}
 +
  }}
 +
   }}''. To adjust this setting, please update the {{para|expiry}} parameter.
 
  }}
 
  }}
  |imageright    = {{#if:{{{imageright|}}}
+
}}{{#ifexpr:{{#ifeq:{{FULLROOTPAGENAME}}|Template:Editnotices
  |{{image|{{{imageright}}}|40x40px}}
+
  |1
 +
  |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 -->
 +
  }}
 +
  }}
 
  }}
 
  }}
  |text      = {{#if:{{{header|}}}
+
  |{{fmbox
  |<dl><dt style="{{{headerstyle|}}}">{{{header}}}</dt></dl>
+
  |type      = editnotice
 +
  |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 23:40, 27 January 2011

Template documentation[create]