46 lines
1.9 KiB
Plaintext
46 lines
1.9 KiB
Plaintext
<div class="wrapper wrapper-alert wrapper-alert-<%= type %>
|
|
<% if(obj.shown) { %>is-shown<% } else { %>is-hiding<% } %>
|
|
id="alert-<%= type %>"
|
|
aria-hidden="<% if(obj.shown) { %>false<% } else { %>true<% } %>"
|
|
aria-labelledby="alert-<%= type %>-title"
|
|
<% if (obj.message) { %>aria-describedby="alert-<%= type %>-description" <% } %>
|
|
<% if (obj.actions) { %>role="dialog"<% } %>
|
|
>
|
|
<div class="alert <%= type %> <% if(obj.actions) { %>has-actions<% } %>">
|
|
<% var iconText = {"warning": "⚠", "confirmation": "✓", "error": "⚠", "announcement": "📢", "step-required": "", "help": "❓", "saving": "⚙"} %>
|
|
<i class="ss-icon ss-symbolicons-block icon icon-<%= type %>"><%= iconText[type] %></i>
|
|
|
|
<div class="copy">
|
|
<h2 class="title title-3" id="alert-<%= type %>-title"><%= title %></h2>
|
|
<% if(obj.message) { %><p class="message" id="alert-<%= type %>-description"><%= message %></p><% } %>
|
|
</div>
|
|
|
|
<% if(obj.actions) { %>
|
|
<nav class="nav-actions">
|
|
<h3 class="sr">Alert Actions</h3>
|
|
<ul>
|
|
<% if(actions.primary) { %>
|
|
<li class="nav-item">
|
|
<a href="#" class="button action-primary <%= actions.primary.class %>"><%= actions.primary.text %></a>
|
|
</li>
|
|
<% } %>
|
|
<% if(actions.secondary) {
|
|
_.each(actions.secondary, function(secondary) { %>
|
|
<li class="nav-item">
|
|
<a href="#" class="button action-secondary <%= secondary.class %>"><%= secondary.text %></a>
|
|
</li>
|
|
<% });
|
|
} %>
|
|
</ul>
|
|
</nav>
|
|
<% } %>
|
|
|
|
<% if(obj.closeIcon) { %>
|
|
<a href="#" rel="view" class="action action-close action-alert-close">
|
|
<i class="ss-icon ss-symbolicons-block icon icon-close">␡</i>
|
|
<span class="label">close alert</span>
|
|
</a>
|
|
<% } %>
|
|
</div>
|
|
</div>
|