Jump to content

Template:Feature: Difference between revisions

From postmarketOS Wiki
Nt8r (talk | contribs)
reimplement. formats on multiple lines, uses #switch instead of #ifeq, and optionally link to a page specifying reason for status if the argument uses "Y:PageName#anchor" notation, also documents usage.
Knuxify (talk | contribs)
add styling to "No data" fallback (todo: this should be in MediaWiki:Common.css, or we should add TemplateStyles and move those styles under the template)
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<!-- The argument should be a string of P/Y/N/- possibly followed
by a colon and a page link or section link for more info. Examples:
{{Feature|Y:OnePlus 6#GPS}}
{{Feature|N:HardPhone#Why nothing works}}
{{Feature|P:#Issues with boot}}
-->
{{#switch:{{#sub:{{{1|}}}|0|1}}
{{#switch:{{#sub:{{{1|}}}|0|1}}
     |P=<div class="feature feature-partial">{{#if:{{#sub:{{{1|}}}|2}}
     |P=<div class="feature feature-partial">Partial</div>  
        |[[{{#replace:{{#sub:{{{1|}}}|2}}|#|%23}}|Partial]]
     |Y=<div class="feature feature-yes">Works</div>  
        |Partial
     |N=<div class="feature feature-no">Broken</div>  
    }}</div>  
     |-=<div class="feature feature-unavailable">Unavailable</div>  
     |Y=<div class="feature feature-yes">{{#if:{{#sub:{{{1|}}}|2}}
     |=<div class="feature feature-no-data" style="font-style: italic; opacity: 0.6;">No data</div>
        |[[{{#replace:{{#sub:{{{1|}}}|2}}|#|%23}}|Works]]
        |Works
    }}</div>  
     |N=<div class="feature feature-no">{{#if:{{#sub:{{{1|}}}|2}}
        |[[{{#replace:{{#sub:{{{1|}}}|2}}|#|%23}}|Broken]]
        |Broken
    }}</div>  
     |-=<div class="feature feature-unavailable">{{#if:{{#sub:{{{1|}}}|2}}
        |[[{{#replace:{{#sub:{{{1|}}}|2}}|#|%23}}|Unavailable]]
        |Unavailable
    }}</div>  
     | <div></div>
}}
}}

Latest revision as of 12:09, 8 March 2025

No data