Template:Document: Difference between revisions
No edit summary |
Only render PDF embed for .pdf files; show download link for other file types (zip, etc.) (via update-page on MediaWiki MCP Server) |
||
| (16 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{#default_form:Document}} | __NOCACHE__{{#default_form:Document}}<templatestyles src="Template:Infobox styles.css" /> | ||
<includeonly> | <includeonly> | ||
| Line 13: | Line 13: | ||
}} | }} | ||
{{#arraymap:{{{crt_models|}}}|,|@@@@|{{#set:Has related CRT model=@@@@}}}} | {{#arraymap:{{{crt_models|}}}|,|@@@@|{{#set:Has related CRT model=@@@@}}}} | ||
{{#arraymap:{{{av_devices|}}}|,|@@@@|{{#set:Has related AV device=@@@@}}}} | |||
{{#arraymap:{{{accessories|}}}|,|@@@@|{{#set:Has related accessory=@@@@}}}} | |||
{{#arraymap:{{{parts|}}}|,|@@@@|{{#set:Has related part=@@@@}}}} | |||
[[Category:Documents]] | [[Category:Documents]] | ||
{{#if:{{{file|}}}{{{url|}}}||[[Category:Documents missing content]]}} | |||
{{#if:{{{crt_models|}}}{{{av_devices|}}}{{{accessories|}}}{{{parts|}}}||[[Category:Orphaned documents]]}} | |||
</includeonly> | </includeonly> | ||
== {{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}} == | == {{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}} == | ||
<div | <div class="document-infobox"> | ||
'''Type:''' {{{doc_type|}}} | <div>'''Type:''' {{{doc_type|}}}</div>{{#if:{{{title|}}}|<div>'''Title:''' {{{title}}}</div>}}{{#if:{{{file|}}}|<div>'''File:''' [[:File:{{{file}}}|{{{file}}}]]</div>}}{{#if:{{{url|}}}|<div>'''URL:''' {{{url}}}</div>}}{{#if:{{{crt_models|}}}| | ||
<div class="document-section-header"><strong>Related CRT Models:</strong></div> | |||
{{#if:{{{title|}}}| | {{#ask: | ||
'''Title:''' {{{title}}} | [[Category:CRT models]] | ||
{{#arraymap:{{{crt_models|}}}|,|@@@@|[[@@@@]]|OR}} | |||
}} | |?Has image#100px;x100px=Photo | ||
{{#if:{{{file|}}}| | |?Has model code=Model | ||
'''File:''' [[:File:{{{file}}}|{{{file}}}]] | |?Has CRT type=CRT type | ||
|?Has screen size inches=Screen size (in) | |||
}} | |?Has chassis=Chassis | ||
{{#if:{{{url|}}}| | |?Has TVL=TVL | ||
'''URL:''' | |format=table | ||
|class=wikitable sortable | |||
}} | |mainlabel=CRT model | ||
{{#if:{{{ | }}|}}{{#if:{{{av_devices|}}}| | ||
<div class="document-section-header"><strong>Related AV Devices:</strong></div> | |||
{{#ask: | |||
}} | [[Category:AV devices]] | ||
<div | {{#arraymap:{{{av_devices|}}}|,|@@@@|[[@@@@]]|OR}} | ||
{{#if:{{{file|}}}| | |?Has image#100px;x100px=Photo | ||
[{{fullurl:Special:Redirect/file/{{{file}}}}} <span | |?Has model code=Model | ||
}} | |?Has device type=Type | ||
{{#if:{{{url|}}}| | |?Has signal standard=Standard | ||
[{{{url}}} | |format=table | ||
}} | |class=wikitable sortable | ||
[{{fullurl:Special:FormStart|form=Document&page_name={{ | |mainlabel=AV device | ||
}}|}}{{#if:{{{accessories|}}}| | |||
<div class="document-section-header"><strong>Related Accessories:</strong></div> | |||
{{#ask: | |||
[[Category:Accessories]] | |||
{{#arraymap:{{{accessories|}}}|,|@@@@|[[@@@@]]|OR}} | |||
|?Has image#100px;x100px=Photo | |||
|?Has model code=Model | |||
|?Has accessory type=Type | |||
|?Has description=Description | |||
|format=table | |||
|class=wikitable sortable | |||
|mainlabel=Accessory | |||
}}|}}{{#if:{{{parts|}}}| | |||
<div class="document-section-header"><strong>Related Parts:</strong></div> | |||
{{#ask: | |||
[[Category:Parts]] | |||
{{#arraymap:{{{parts|}}}|,|@@@@|[[@@@@]]|OR}} | |||
|?Has image#100px;x100px=Photo | |||
|?Has model code=Part # | |||
|?Has part type=Type | |||
|?Has description=Description | |||
|format=table | |||
|class=wikitable sortable | |||
|mainlabel=Part | |||
}}|}}<div class="document-buttons"> | |||
{{#if:{{{file|}}}|[{{fullurl:Special:Redirect/file/{{{file}}}}} <span class="document-button document-button-primary">Download</span>]}}{{#if:{{{url|}}}|{{#if:{{{file|}}}||[{{{url}}} <span class="document-button document-button-primary">Download</span>]}}}} [{{fullurl:Special:FormStart|form=Document&page_name={{PAGENAMEE}}}} <span class="document-button document-button-secondary">Edit this data</span>] | |||
</div> | </div> | ||
</div> | </div> | ||
{{#if:{{{file|}}}| | {{#if:{{{file|}}}| | ||
== Document == | |||
{{#ifeq:{{lc:{{#sub:{{{file}}}|-4}}}}|.pdf| | |||
<pdf>File:{{{file}}}</pdf> | <pdf>File:{{{file}}}</pdf> | ||
[[File:{{{file}}}|800px]] | [[File:{{{file}}}|800px]] | ||
| | |||
[[:File:{{{file}}}|Download {{{file}}}]] | |||
}} | }} | ||
}} | }} | ||