Jump to content

Template:Security Warning: Difference between revisions

From NixOS Wiki
Overhaul security template
DoggoBit (talk | contribs)
No edit summary
Line 1: Line 1:
<noinclude>{{Template}}
<includeonly>{{Notice
 
  |color={{#switch:{{{type|hiPrio}}}
== Usage ==
    |hiPrio
 
    |critical = var(--color-error)
{{ic|<nowiki>{{Security Warning|This configuration may be unsafe.}}</nowiki>}}
    |lowPrio
 
    |warning = var(--border-color-warning)
{{ic|<nowiki>{{Security Warning|Stop what you're doing!|heading=This is dangerous!}}</nowiki>}}
    |secure = var(--color-success)
 
    |#default = var(--color-progressive)
{{ic|<nowiki>{{Security Warning|Don't do anything that you might regret!|type=lowPrio}}</nowiki>}}
  }}
 
  |background={{#switch:{{{type|hiPrio}}}
{{ic|<nowiki>{{Security Warning|This is safe by default!|type=secure}}</nowiki>}}
    |hiPrio
 
    |critical = var(--background-color-error-subtle)
== Example ==
    |lowPrio
{{Security Warning|This configuration may be unsafe.}}
    |warning = var(--background-color-warning-subtle)
{{Security Warning|Stop what you're doing!|heading=This is dangerous!}}
    |secure = var(--background-color-success-subtle)
{{Security Warning|Don't do anything that you might regret!|type=lowPrio}}
    |#default = var(--background-color-progressive-subtle)
{{Security Warning|This is safe by default!|type=secure}}
  }}
</noinclude>
  |icon=🛡
<includeonly>{{META Message
  |'''{{{heading|Security information:}}}''' {{{1|{{{message}}}}}}
|border = {{#ifeq: hiPrio | {{{type|hiPrio}}} | #ED1515 }}
}}{{#ifeq:{{{category|yes}}}|yes|[[Category:Pages or sections flagged with Template:Security Warning]][[Category:Articles that contain security information]]|}}</includeonly><noinclude>{{Documentation}}</noinclude>
          {{#ifeq: lowPrio | {{{type|hiPrio}}} | #FFC35A }}
          {{#ifeq: secure | {{{type|hiPrio}}} | #78DA06 }}
|signal = [[File:Breeze-security-{{#ifeq: hiPrio | {{{type|hiPrio}}} |low}}{{#ifeq: lowPrio | {{{type|hiPrio}}} |medium}}{{#ifeq: secure | {{{type|hiPrio}}} |high}}.svg|link=]]
|heading = {{#ifeq: hiPrio | {{{type|hiPrio}}} | {{{heading|Warning}}}}}
          {{#ifeq: lowPrio | {{{type|hiPrio}}} | {{{heading|Caution}}}}}
          {{#ifeq: secure | {{{type|hiPrio}}} | {{{heading|Security Information}}}}}
|message = {{{1|{{{message}}}}}}
}}[[Category:Pages or sections flagged with Template:Security Warning]]</includeonly>

Revision as of 17:05, 5 June 2025

Template Documentation [edit source| uses| help]

This notice can be used to display security information to the reader, in a way that disrupts the normal reading flow. This can be especially useful to convey critical information the user should read before proceeding.

🛡︎
Security information: This template is not secure

Usage

Simply including this template, alongside a message to be displayed, would suffice in producing a notice like the one above:

{{Security Warning|This template is not secure}}

There are three distinct levels you can specify for a security warning's type. Each level, along with an example and the resulting output can be seen in the table below:

Type Example Output
critical
{{Security Warning
  |type=critical
  |This information is critical!
}}
🛡︎
Security information: This information is critical!
warning
{{Security Warning
  |type=warning
  |This is your last warning!
}}
🛡︎
Security information: This is your last warning!
secure
{{Security Warning
  |type=secure
  |All clear.
}}
🛡︎
Security information: All clear.
info
{{Security Warning
  |type=info
  |For your information.
}}
🛡︎
Security information: For your information.

You can also specify some text to replace the "Security information" in the notice:

{{Security Warning|type=info|heading=Important info:|This security notice is important.}}
🛡︎
Important info: This security notice is important.