Jump to content

Template:Feature: Difference between revisions

From postmarketOS Wiki
MartijnBraam (talk | contribs)
No edit summary
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.
Line 1: Line 1:
{{#ifeq:{{{1|}}}|P| <div class="feature feature-partial">Partial</div> | {{#ifeq:{{{1|}}}|Y| <div class="feature feature-yes">Works</div> | {{#ifeq:{{{1|}}}|N| <div class="feature feature-no">Broken</div> | {{#ifeq:{{{1|}}}|-| <div class="feature feature-unavailable">Unavailable</div> | <div></div> }} }} }} }}
<!-- 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}}
    |P=<div class="feature feature-partial">{{#if:{{#sub:{{{1|}}}|2}}
        |[[{{#replace:{{#sub:{{{1|}}}|2}}|#|%23}}|Partial]]
        |Partial
    }}</div>
    |Y=<div class="feature feature-yes">{{#if:{{#sub:{{{1|}}}|2}}
        |[[{{#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>
}}

Revision as of 14:36, 1 June 2023