Sha256: 53e43d2552483926983bff71711fa6fd330b49f33ded4585a438d1573559697c

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

<div aria-live="polite" aria-atomic="true" class="position-relative" data-controller="toasts">
  <div class="toast-container top-0 end-0 p-3 ">
    <% flash.each do |type, msg| %>
      <%
        type = { alert: :danger, error: :danger, warning: :warning, success: :success }[type.to_sym] || :primary
        title = { danger: 'Error', warning: 'Warning', success: 'Success' }[type] || 'Info'
        icon = {
          danger: 'exclamation-triangle-fill',
          warning: 'exclamation-diamond',
          success: 'check-circle-fill'
        }[type] || 'exclamation-circle'
      %>
      <div class="toast text-bg-<%= type %>" role="alert" aria-live="assertive" aria-atomic="true" data-turbo-temporary>
        <div class="toast-header">
          <i class="bi bi-<%= icon %>"></i>&nbsp;
          <strong class="me-auto"><%= title %></strong>
          <small class="text-body-secondary"><%= timeago(DateTime.now) %></small>
          <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div class="toast-body">
          <%= msg %>
        </div>
      </div>
    <% end %>
  </div>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
plutonium-0.8.0 app/views/application/_flash_toasts.html.erb
plutonium-0.6.2 app/views/resource/_toast.html.erb
plutonium-0.6.1 app/views/resource/_toast.html.erb
plutonium-0.6.0 app/views/resource/_toast.html.erb
plutonium-0.5.0 app/views/resource/_toast.html.erb