Template:ShowEdition: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(test for NewWork facility)
(Replaced Template:IsNew with equivalent code)
 
(3 intermediate revisions by one other user not shown)
Line 8: Line 8:
<tt>orig = <view original (nonfilelink) data in edit mode></tt>
<tt>orig = <view original (nonfilelink) data in edit mode></tt>
| {{#ifeq: {{{Status}}}
| {{#ifeq: {{{Status}}}
| withdrawn |  [[Edition:CPDL {{{EdNo}}}|<b>CPDL #<font color=gray>{{{EdNo}}}</font>:</b>]] ''This edition has been'' '''withdrawn''' ''{{{reason|at the request of the {{{contributor|editor}}}}}}.''[[Category:Works with withdrawn editions]]
| withdrawn |  [[Edition:CPDL {{{EdNo}}}|<b>CPDL #<font color=gray>{{{EdNo}}}</font>:</b>]] ''This edition has been '''withdrawn''' {{{reason|at the request of the {{{contributor|editor}}}}}}.''[[Category:Works with withdrawn editions]]
| {{switch|{{IsNew|{{{posted|1901-01-01}}}}}
| {{#ifexpr:{{#time:Ymd|now-31 days}}<{{#time:Ymd|{{{1|}}}}}|{{filepath:NewScore.gif}} [[Category:New works| {{{posted|1901-01-01}}}]] {{#ifexpr:{{#time:Ymd|now-31 days}}<{{#time:Ymd|{{{1|}}}}}|{{{posted|1901-01-01}}}}}
|case: yes={{filepath:NewScore.gif}} [[Category:New works| {{{posted|1901-01-01}}}]] {{switch|{{IsNew|{{{posted|1901-01-01}}}|range=30 days}}
|yes|[[Category:Posted {{{posted|1901-01-01}}}]]}} <small>(Posted {{{posted|1901-01-01}}})</small> &nbsp;}} [[Edition:CPDL {{{EdNo}}}|<b>CPDL #<font color=green>{{{EdNo}}}</font>:</b>]] {{{filelinks|}}} }}
|case: yes=[[Category:Posted {{{posted|1901-01-01}}}]]
|default=
}} <small>(Posted {{{posted|1901-01-01}}})</small> &nbsp;
|default=
}} [[Edition:CPDL {{{EdNo}}}|<b>CPDL #<font color=green>{{{EdNo}}}</font>:</b>]] {{{filelinks|}}} }}
{{{orig}}}
{{{orig}}}
}}</includeonly><noinclude>This (preliminary) template displays an edition as it appears on a works page.
}}</includeonly><noinclude>This (preliminary) template displays an edition as it appears on a works page. Before use, it should be modified to remove Category:New works.
[[Category:Templates|{{PAGENAME}}]]</noinclude>
[[Category:Experimental templates]]</noinclude>

Latest revision as of 16:23, 31 July 2020

This (preliminary) template displays an edition as it appears on a works page. Before use, it should be modified to remove Category:New works.