openaustralia/planningalerts

View on GitHub
app/views/_tailwind/application/_flashes.html.erb

Summary

Maintainability
Test Coverage
<% if flash.notice %>
  <div class="mt-8">
    <%= render Tailwind::AlertComponent.new(type: :success) do %>
      <%# Using sanitize here so that we can put html in the flash message safely %>
      <%= sanitize(flash.notice) %>
    <% end %>
  </div>
<% end %>

<% if flash.alert %>
  <div class="mt-8">
    <%= render Tailwind::AlertComponent.new(type: :warning) do %>
      <%# Using sanitize here so that we can put html in the flash message safely %>
      <%= sanitize(flash.alert) %>
    <% end %>
  </div>
<% end %>

<%# TODO: I think we're just using this to show an error on the comment form. Seems weird. Let's fix this. %>
<% if flash[:error] %>
  <div class="mt-8">
    <%= render Tailwind::AlertComponent.new(type: :warning) do %>
      <%# Using sanitize here so that we can put html in the flash message safely %>
      <%= sanitize(flash[:error]) %>
    <% end %>
  </div>
<% end %>