openaustralia/planningalerts

View on GitHub
app/views/_tailwind/alerts_new/index.html.erb

Summary

Maintainability
Test Coverage
<%= render Tailwind::Heading.new(tag: :h2).with_content("Your alerts") %>
<div class="text-xl text-navy">
  <p class="mt-3">
    Alerts are sent to your email at
    <%= current_user.email %>
  </p>
  <%= pa_link_to "Change", edit_user_registration_path, extra_classes: "mt-1 inline-block" %>
</div>

<% if @alerts.empty? %>
  <div class="flex items-center justify-between border mt-11 border-light-grey2">
    <div class="flex justify-center flex-grow">
      <div class="ml-12 mr-4 text-xl text-navy">
        <p>You have no saved alerts</p>
        <%= pa_link_to "Create your first one", new_profile_alert_path %>
      </div>
    </div>
    <%= image_tag "tailwind/illustration/woman-looking-off.svg", class: "mt-6", alt: "" %>
  </div>
<% else %>
  <ul class="divide-y border-y mt-11 divide-light-grey border-light-grey">
    <% @alerts.each do |alert| %>
      <li>
        <%= render alert %>
      </li>
    <% end %>
  </ul>
  <div class="mt-12 text-xl">
    <%= pa_link_to "Create new alert", new_profile_alert_path %>
  </div>
<% end %>