amatriain/feedbunch

View on GitHub
FeedBunch-app/app/views/layouts/_alerts.html.erb

Summary

Maintainability
Test Coverage
<%= render 'layouts/cookies_warning' %>

<% if  notice.present? %>
  <div id="notice" class="alert alert-warning fade in" ng-show="error_rails">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
    <p><%= notice %></p>
  </div>
<% end %>

<% if  alert.present? %>
  <div id="alert" class="alert alert-danger fade in" ng-show="error_rails">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
    <p><%= alert %></p>
  </div>
<% end %>

<% cache "tour_alerts-#{I18n.locale}" do %>

  <%# Alert displayed when there is a problem loading a tour's steps from the server %>
  <div id="problem-loading-tour" class="alert alert-danger" ng-show="error_loading_tour">
    <button type="button" class="close" ng-click="reset_flag('error_loading_tour')">&times;</button>
    <p><%= t 'layouts.alerts.problem_loading_tour' %></p>
  </div>

  <%# Alert displayed when there is a problem changing a "show tour" flag for the current user %>
  <div id="problem-show-tour-change" class="alert alert-danger" ng-show="error_changing_show_tour">
    <button type="button" class="close" ng-click="reset_flag('error_changing_show_tour')">&times;</button>
    <p><%= t 'layouts.alerts.problem_change_show_tour' %></p>
  </div>

  <%# Alert displayed when tours are reset successfully %>
  <div id="success-reset-tours" class="alert alert-success" ng-show="success_reset_tours">
    <button type="button" class="close" ng-click="reset_flag('success_reset_tours')">&times;</button>
    <p><%= t 'layouts.alerts.success_reset_tours' %></p>
  </div>

<% end %>