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)
 
(12 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 style="margin-bottom: 1em; padding: 0.5em; border: 1px solid #a2a9b1; background: #f8f9fa;">
<div class="document-infobox">
<div>'''Type:''' {{{doc_type|}}}</div>
<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|}}}|
{{#if:{{{title|}}}|<div>'''Title:''' {{{title}}}</div>}}
<div class="document-section-header"><strong>Related CRT Models:</strong></div>
{{#if:{{{file|}}}|<div>'''File:''' [[:File:{{{file}}}|{{{file}}}]]</div>}}
{{#ask:
{{#if:{{{url|}}}|<div>'''URL:''' {{{url}}}</div>}}
[[Category:CRT models]]
{{#if:{{{crt_models|}}}|<div>'''Related CRT Models:''' {{#arraymap:{{{crt_models|}}}|,|@@@@|[[@@@@]] }}</div>}}
{{#arraymap:{{{crt_models|}}}|,|@@@@|[[@@@@]]|OR}}
<div style="text-align: center; margin-top: 0.5em;">
|?Has image#100px;x100px=Photo
{{#if:{{{file|}}}|[{{fullurl:Special:Redirect/file/{{{file}}}}} <span style="display:inline-block;padding:0.5rem 1rem;background-color:#2563eb;color:#ffffff;border:1px solid #2563eb;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;cursor:pointer;">Download</span>]}}{{#if:{{{url|}}}|{{#if:{{{file|}}}||[{{{url}}} <span style="display:inline-block;padding:0.5rem 1rem;background-color:#2563eb;color:#ffffff;border:1px solid #2563eb;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;cursor:pointer;">Download</span>]}}}} [{{fullurl:Special:FormStart|form=Document&page_name={{PAGENAME}}}} <span style="display:inline-block;padding:0.5rem 1rem;background-color:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;">Edit this data</span>]
|?Has model code=Model
|?Has CRT type=CRT type
|?Has screen size inches=Screen size (in)
|?Has chassis=Chassis
|?Has TVL=TVL
|format=table
|class=wikitable sortable
|mainlabel=CRT model
}}|}}{{#if:{{{av_devices|}}}|
<div class="document-section-header"><strong>Related AV Devices:</strong></div>
{{#ask:
[[Category:AV devices]]
{{#arraymap:{{{av_devices|}}}|,|@@@@|[[@@@@]]|OR}}
|?Has image#100px;x100px=Photo
|?Has model code=Model
|?Has device type=Type
|?Has signal standard=Standard
|format=table
|class=wikitable sortable
|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 ===
== 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}}}]]
}}
}}
}}
MediaWiki Appliance - Powered by TurnKey Linux