afimb/chouette2

View on GitHub
app/views/referentials/_validity_out.html.erb

Summary

Maintainability
Test Coverage
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><%= t('.validity_out_time_tables') %>: <%= tm_cnt = @referential.time_tables.validity_out_from_on?(Date.today).size %></div>
  <ul class="list-group">
      <% if tm_cnt > 0 %>
      <% @referential.time_tables.validity_out_from_on?(Date.today,5).each do |tm| %>
      <li class="list-group-item"><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></li>
      <% end %>
      <% if tm_cnt > 5 %>
      <li class="list-group-item">...</li>
    <% end %>
      <% end %>
  </ul>
</div>

<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading"><%= t('.validity_out_soon_time_tables', :count => "7") %>: <%= tm_cnt = @referential.time_tables.validity_out_between?(Date.today,Date.today+7).size %></div>
  <ul class="list-group">
      <% if tm_cnt > 0 %>
      <% @referential.time_tables.validity_out_between?(Date.today,Date.today+7,5).each do |tm| %>
      <li class="list-group-item"><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></li>
      <% end %>
      <% if tm_cnt > 5 %>
      <li class="list-group-item">...</li>
    <% end %>
      <% end %>
  </ul>
</div>