Jump to content

Template:Copyright: Difference between revisions

Line 14: Line 14:
<!-- If name is missing, error out -->
<!-- If name is missing, error out -->
{{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}}
{{#switch: {{#if:{{{name|{{{2|}}}}}}|1|0}}
  | 0 = <span class="errpr">Copyright error: missing name.</span>
  | 0 = <span class="error">Copyright error: missing name.</span>
  | 1 =
  | 1 =
   <!-- If year is omitted, use current year -->
   <!-- If year is omitted, use current year -->
Line 25: Line 25:
         <!-- Year is valid and <= current year -->
         <!-- Year is valid and <= current year -->
         {{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} |
         {{#ifexpr: {{{year|{{{1|}}}}}} = {{#time:Y}} |
           &copy; {{#time:Y}} {{{name|{{{2|}}}}}} |
           <div class="copyright">&copy; {{#time:Y}} {{{name|{{{2|}}}}}}</div> |
           &copy; {{{year|{{{1|}}}}}}&ndash;{{#time:Y}} {{{name|{{{2|}}}}}}
           <div class="copyright">&copy; {{{year|{{{1|}}}}}}&ndash;{{#time:Y}} {{{name|{{{2|}}}}}}</div>
         }}
         }}
       }}
       }}
Line 32: Line 32:
   |
   |
     <!-- No year given -->
     <!-- No year given -->
     &copy; {{#time:Y}} {{{name|{{{2|}}}}}}
     <div class="copyright">&copy; {{#time:Y}} {{{name|{{{2|}}}}}}</div>
   }}
   }}
}}
}}