<div>
  <h2><%= milestone.title %></h2>
  <% if can? :manage, LessonPlanEntry %>
      <%= link_to edit_course_lesson_plan_milestone_path(@course, milestone), class: 'btn' do %>
        <i class="icon-edit"></i>
      <% end %>
      <%= link_to course_lesson_plan_milestone_path(@course, milestone),
            method: :delete,
            data: { confirm: t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
            class: 'btn btn-danger' do %>
          <i class="icon-trash"></i>
      <% end %>
  <% end %>
  <table class="table">
    <tbody>
    <% milestone.entries.each {|entry| %>
    <%= render :partial => 'lesson_plan/entry', locals: { :entry => entry } %>
    <% } %>
    </tbody>
  </table>
</div>
<div>
  <h2><%= milestone.title %></h2>
  <% if can? :manage, LessonPlanEntry %>
      <%= link_to edit_course_lesson_plan_milestone_path(@course, milestone), class: 'btn' do %>
        <i class="icon-edit"></i>
      <% end %>
      <%= link_to course_lesson_plan_milestone_path(@course, milestone),
            method: :delete,
            data: { confirm: t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
            class: 'btn btn-danger' do %>
          <i class="icon-trash"></i>
      <% end %>
  <% end %>
  <table class="table">
    <tbody>
    <% entries = milestone.entries.sort { |a, b| a.start_at <=> b.start_at } %>
    <% entries.each {|entry| %>
    <%= render :partial => 'lesson_plan/entry', locals: { :entry => entry } %>
    <% } %>
    </tbody>
  </table>
</div>
Sort all entries in a milestone by date.
Sort all entries in a milestone by date.
