Difference between revisions of "Template:Alerts"

From Arks-Visiphone
Jump to navigation Jump to search
Line 1: Line 1:
 
{{#switch: {{{alert|}}}
 
{{#switch: {{{alert|}}}
 
| warning =  
 
| warning =  
<div class="alert alert-warning alert-dismissible fade show" role="alert"><h4 class="alert-heading">{{{1|}}}</h4><p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
+
<div class="alert alert-warning" role="alert">{{#if: {{{1|}}}|<h4 class="alert-heading">{{{1|}}}</h4>|}}<p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
 
| danger =  
 
| danger =  
<div class="alert alert-danger alert-dismissible fade show" role="alert"><h4 class="alert-heading">{{{1|}}}</h4><p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
+
<div class="alert alert-danger" role="alert">{{#if: {{{1|}}}|<h4 class="alert-heading">{{{1|}}}</h4>|}}<p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
 
| dark =  
 
| dark =  
<div class="alert alert-dark alert-dismissible fade show" role="alert"><h4 class="alert-heading">{{{1|}}}</h4><p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
+
<div class="alert alert-dark" role="alert">{{#if: {{{1|}}}|<h4 class="alert-heading">{{{1|}}}</h4>|}}<p>{{{2|}}}</p><div type="button" class="close" data-dismiss="alert" aria-label="Close" style="cursor: pointer;"><span aria-hidden="true">&times;</span></div></div>
 
|#default =  
 
|#default =  
<div class="alert alert-light" role="alert"><h4 class="alert-heading">{{{1|}}}</h4><p>{{{2|}}}</p></div>
+
<div class="alert alert-light" role="alert"><p>{{{2|}}}</p></div>
 
}}
 
}}
 
<noinclude>
 
<noinclude>
<div class="row">
+
<div class="row template-documentation">
<div class="col-12 template-documentation">
+
<div class="col-12">
<div>
+
<h2>Template Documentation</h2>
<h2>Template Documentation</h2>
+
<p>Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p>
<p>Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p>
 
</div>
 
 
</div>
 
</div>
 +
<div class="col-12">
 +
<h4>Usage</h4>
 +
<hr>
 +
<p>This template can be used to provide an alert textbox in 4 contextual cases with 3 of them having a close/dismiss button. This template can display the following alerts:</p>
 +
<ol>
 +
<li>A warning alert</li>
 +
<li>A danger alert</li>
 +
<li>A dark alert</li>
 +
<li>And a normal alert</li>
 +
</ol>
 +
</div>
 +
<div class="col-12">
 +
<h4>Examples</h4>
 +
<hr>
 +
<h5>The Classic Light Alert</h5>
 +
<p>The following displays the light alert text box. You can follow this with whatever text/images/markup you like.</p>
 +
<p>Wiki code:</p>
 +
<pre>{{Alerts|message}}</pre>
 +
</div>
 
 
 
</div>
 
</div>
  
 
</noinclude>
 
</noinclude>

Revision as of 08:11, 30 April 2020

Template Documentation

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Usage


This template can be used to provide an alert textbox in 4 contextual cases with 3 of them having a close/dismiss button. This template can display the following alerts:

  1. A warning alert
  2. A danger alert
  3. A dark alert
  4. And a normal alert

Examples


The Classic Light Alert

The following displays the light alert text box. You can follow this with whatever text/images/markup you like.

Wiki code:

{{Alerts|message}}