<commit_before><% cur_reg = current_user.registration_for(@course)  %>
<% show_all = current_user.site_admin? || cur_reg&.professor? %>
<% show_grading = current_user.site_admin? || cur_reg&.staff? %>
<% @page_title = @course.name %>
<style>
  h4 i.glyphicon { font-size: 80%; margin-left: 0.5em; }
  h4 i.glyphicon-chevron-up { display: none; }
  h4 i.glyphicon-chevron-down { display: initial; }
  h4.collapsed i.glyphicon-chevron-up { display: initial; }
  h4.collapsed i.glyphicon-chevron-down { display: none; }
  .team-heading { margin: 10px 15px; font-size: 16px; }
</style>

<div class="row">
  <div class="col-md-6">
    <%= render "assignments/table", assignments: @course.assignments,
        for_user: current_user, show_all: show_all %>
    <%= render "lateness_summary", assignments: @course.assignments,
        for_user: current_user, show_all: show_all %>
    <% if show_all %>
    <%= render "abnormal_summary", abnormals: @abnormals %>
    <% end %>
  </div>
  <div class="col-md-6">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Current Teams</h3>
      </div>
      <%= render "teamsets/all",
          admin: current_user.course_staff?(@course),
          course: @course, tag: "h4", editable: false
          %>
    </div>
    <% unless @allocated_grading.empty? && @completed_grading.empty? %>
    <%= render "grader_allocations/grading_due", course: @course %>
    <% end %>
    <% if show_grading %>
    <%= render "grading_due", assignments: @course.assignments,
        show_all: show_all %>
    <% end %>
  </div>
</div>
<div class="row">
  <%= link_to "Withdraw from this course", withdraw_course_path(@course),
      method: :delete,
      class: "pull-right btn btn-danger",
      data: {confirm: "Are you absolutely sure you want to withdraw from this course?"} %>
</div><commit_msg>enhanced withdrawal UI<commit_after><% cur_reg = current_user.registration_for(@course)  %>
<% show_all = current_user.site_admin? || cur_reg&.professor? %>
<% show_grading = current_user.site_admin? || cur_reg&.staff? %>
<% @page_title = @course.name %>
<style>
  h4 i.glyphicon { font-size: 80%; margin-left: 0.5em; }
  h4 i.glyphicon-chevron-up { display: none; }
  h4 i.glyphicon-chevron-down { display: initial; }
  h4.collapsed i.glyphicon-chevron-up { display: initial; }
  h4.collapsed i.glyphicon-chevron-down { display: none; }
  .team-heading { margin: 10px 15px; font-size: 16px; }
</style>

<div class="row">
  <div class="col-md-6">
    <%= render "assignments/table", assignments: @course.assignments,
        for_user: current_user, show_all: show_all %>
    <%= render "lateness_summary", assignments: @course.assignments,
        for_user: current_user, show_all: show_all %>
    <% if show_all %>
    <%= render "abnormal_summary", abnormals: @abnormals %>
    <% end %>
  </div>
  <div class="col-md-6">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Current Teams</h3>
      </div>
      <%= render "teamsets/all",
          admin: current_user.course_staff?(@course),
          course: @course, tag: "h4", editable: false
          %>
    </div>
    <% unless @allocated_grading.empty? && @completed_grading.empty? %>
    <%= render "grader_allocations/grading_due", course: @course %>
    <% end %>
    <% if show_grading %>
    <%= render "grading_due", assignments: @course.assignments,
        show_all: show_all %>
    <% end %>
  </div>
</div>
<div class="row">
  <button type="button" class="pull-right btn btn-danger"
    data-keybaord="true" data-toggle="modal" data-target="#withdraw">
    Withdraw from this course
  </button>
</div>
<div id="withdraw" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content" style="overflow: hidden;">
      <div class="modal-header panel-heading alert-danger">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Withdraw from this course?</h4>
      </div>
      <div class="modal-body">
        <p>Are you absolutely sure you want to withdraw from this
          course?</p>
        <p>
          You <i>still</i> will have to withdraw from the course at the
          registrar, <i>separately</i> from withdrawing on this site.
          <i><b>Failure to do so will result in your still getting a
          grade for this course!</b></i>
        </p>
      </div>
      <div class="modal-footer alert-danger">
        <button type="submit" class="btn btn-success btn-default pull-left" data-dismiss="modal">
          <span class="glyphicon glyphicon-ok"></span> Stay enrolled
        </button>        
        <%= link_to withdraw_course_path(@course),
            method: :delete, class: "pull-right btn btn-danger" do %>
          <span class="glyphicon glyphicon-log-out"></span>
          Withdraw from this course on Bottlenose
        <% end %>
      </div>
    </div>
  </div>
</div>
{'fraction_non_alphanumeric': 0.16177351707609347, 'fraction_numerical': 0.008587976832434592, 'mean_word_length': 3.197820620284996, 'pattern_counts': {'":': 0, '<': 106, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4530076', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1644, 'n_words': 379}