<commit_before><% content_for :page_title, @context.name %>
<% jammit_css :course_show %>
<% @active_tab ||= "home" %>
<h1 class='screenreader-only'><%= @context.name %></h1>
<% content_for :auto_discovery do %>
  <% if @context_enrollment %>
    <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context_enrollment.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  <% elsif @context.available? %>
    <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  <% end %>
<% end %>

<% content_for :right_side do %>
  <div id="course_show_secondary">
    <% @can_manage_content = can_do(@context, @current_user, :manage_content) %>
    <% if @can_manage_content && can_do(@context, @current_user, :change_course_state) && (@context.unpublished? || @context.unpublishable?) %>
      <div id="course_status" class="text-center">
        <h4>
          <%= t('headers.course_status', %{Course Status}) %>
        </h4>
        <div id='course_status_actions' class="ui-buttonset">
          <%= form_for @context do |f| %>
            <% if @context.created? || @context.claimed? %>
              <button type="button" class='ui-button btn-unpublish disabled'>
                <i class="icon-unpublish"></i>
                <%= t('#buttons.unpublished', %{Unpublished}) %>
              </button>
              <button type='submit' class="ui-button btn-publish">
                <i class="icon-unpublished"></i>
                <%= t('#buttons.publish', %{Publish}) %>
              </button>
              <input type='hidden' name='course[event]' value='offer' />
            <% else %>
              <button type='submit' class="ui-button">
                <i class="icon-unpublish"></i>
                <%= t('#buttons.unpublish', %{Unpublish}) %>
              </button>
              <button type="button" class="ui-button disabled btn-published">
                <i class="icon-publish"></i>
                <%= t('#buttons.published', %{Published}) %>
              </button>
              <input type='hidden' name='course[event]' value='claim' />
            <% end %>
          <% end %>
        </div>
      </div>
    <% end %>

    <% if @can_manage_content || @course_home_view != 'feed' || @course_home_sub_navigation_tools.present? %>
      <div class="course-options">
        <% @course_home_sub_navigation_tools.each do |tool| %>
          <a class="btn button-sidebar-wide course-home-sub-navigation-lti"
             href="<%= course_external_tool_path(@context, tool, launch_type: 'course_home_sub_navigation') %>">
            <img class="icon" src="<%= tool.course_home_sub_navigation(:icon_url) %>" />
            <%= tool.label_for(:course_home_sub_navigation) %>
          </a>
        <% end %>
        <% if @can_manage_content %>
          <a class="btn button-sidebar-wide element_toggler choose_home_page_link" aria-controls="edit_course_home_content_form" href="<%= context_url(@context, :context_details_url) %>">
            <i class="icon-target"></i>
            <%= t('links.choose_home_page', %{Choose Home Page}) %>
          </a>
        <% end %>

        <% if @course_home_view != 'feed' %>
          <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_url, :view => 'feed') %>">
            <i class="icon-stats"></i>
            <%= t('links.view_course_stream', %{View Course Stream}) %>
          </a>
        <% end %>

          <% if @can_manage_content %>
            <% js_bundle :course_wizard %>
            <% jammit_css :course_wizard %>
            <a href="#" class="btn button-sidebar-wide wizard_popup_link  <%= 'auto_open' if @context.created? || @context.claimed? %>">
              <i class="icon-question"></i> <%= t('links.course_setup', %{Course Setup Checklist}) %>
            </a>

          <a class="btn button-sidebar-wide" href="<%= context_url(@context, :new_context_discussion_topic_url, :is_announcement => true) %>"><i class="icon-announcement"></i> <%= t('links.new_announcement', %{New Announcement}) %>
          </a>
        <% end %>
      </div>
    <% else %>
      <% if @can_manage_content || @course_home_sub_navigation_tools.present? %>
        <div class="secondary-button-group rs-margin-lr rs-margin-top rs-margin-bottom">
        <% @course_home_sub_navigation_tools.each do |tool| %>
          <a class="btn button-sidebar-wide course-home-sub-navigation-lti"
             href="<%= course_external_tool_path(@context, tool, launch_type: 'course_home_sub_navigation') %>">
            <img class="icon" src="<%= tool.course_home_sub_navigation(:icon_url) %>" />
            <%= tool.label_for(:course_home_sub_navigation) %>
          </a>
        <% end %>
        <% if @can_manage_content %>
            <% js_bundle :course_wizard %>
            <% jammit_css :course_wizard %>
            <a href="#" class="btn button-sidebar-wide wizard_popup_link  <%= 'auto_open' if @context.created? || @context.claimed? %>"><i class="icon-question"></i> <%= t('links.course_setup', %{Course Setup Checklist}) %></a>
            <a class="btn button-sidebar-wide" href="<%= context_url(@context, :new_context_discussion_topic_url, :is_announcement => true) %>"><i class="icon-announcement"></i> <%= t('links.new_announcement', %{New Announcement}) %></a>
        <% end %>
        </div>
      <% end %>
    <% end %>

    <% if @context.available? && @context.self_enrollment_enabled? && @context.open_enrollment && (!@context_enrollment || !@context_enrollment.active?) %>
      <div class="rs-margin-lr rs-margin-top">
        <a href="<%= enroll_url(@context.self_enrollment_code) %>" title="<%= t('links.join_course', %{Join this Course}) %>" class="btn button-sidebar-wide self_enrollment_link" data-open-as-dialog><i class="icon-user-add"></i>  <%= t('links.join_course', %{Join this Course}) %></a>
      </div>
    <% elsif @context_enrollment && @context_enrollment.self_enrolled && @context_enrollment.active? %>
      <div class="rs-margin-lr rs-margin-top">
        <a href="#" class="btn button-sidebar-wide self_unenrollment_link"><i class="icon-end"></i> <%= t('links.drop_course', %{Drop this Course}) %></a>
      </div>
      <div id="self_unenrollment_dialog" style="display: none;">
        <h2><i class="icon-warning"></i> <%= t('headings.confirm_unenroll', %{Confirm Unenrollment}) %></h2>
        <%= t('details.confirm_unenroll', %{Are you sure you want to unenroll in this course?  You will no longer be able to see the course roster or communicate directly with the teachers, and you will no longer see course events in your stream and as notifications.}) %>
        <div class="button-container">
          <a href="<%= course_self_unenrollment_path(@context, @context_enrollment.uuid) %>" class="btn btn-primary action"><i class="icon-end"></i> <span><%= t('links.drop_course', %{Drop this Course}) %></span></a>
          <a href="#" class="btn dialog_closer"><%= t('#buttons.cancel', %{Cancel}) %></a>
        </div>
      </div>
    <% end %>
    <%= render :partial => 'assignments_needing_grading', :locals => {:contexts => [@context]} %>
    <%= render :partial => "group_list", :object => @user_groups %>
    <%= nbsp unless @current_user %>
  </div>
  <% if @course_home_view == 'assignments' %>
    <%= render :partial => 'assignments/assignments_list_right_side', :locals => {:course_home => true} %>
  <% elsif @course_home_view == 'syllabus' %>
    <%= render :partial => 'assignments/syllabus_right_side', :locals => {:course_home => true} %>
  <% else %>
    <% locals = {:title => t("Coming Up"), :contexts_to_link_to => @context, :upcoming => true, :period => :one_week} %>
    <% if @current_user %>
      <% cache(safe_cache_key([@current_user, @contexts, 'course_upcoming_events' ])) do %>
        <%= render :partial => "shared/event_list", :object => @current_user.upcoming_events(:contexts => @contexts), :locals => locals %>
      <% end %>
    <% else %>
      <%= render :partial => "shared/event_list", :object => [], :locals => locals %>
    <% end %>
  <% end %>
  <% if @show_recent_feedback %>
    <%= render :partial => "shared/event_list", :object => @recent_feedback, :locals => {:title => t('titles.recent_feedback', "Recent Feedback"), :contexts_to_link_to => @context, :is_recent_feedback => true, :period => :two_weeks} %>
  <% end %>
<% end %>

<%
  jammit_css :dashboard
  case @course_home_view
  when 'wiki'
    jammit_css :tinymce
  when 'modules'
    js_bundle :context_modules
  when 'assignments'
    js_bundle :assignments
  when 'syllabus'<commit_msg>Makes a11y message on course home page for modules better<commit_after><% content_for :page_title, @context.name %>
<% jammit_css :course_show %>
<% @active_tab ||= "home" %>
<h1 class='screenreader-only'><%= @context.name %></h1>
<% content_for :auto_discovery do %>
  <% if @context_enrollment %>
    <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context_enrollment.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  <% elsif @context.available? %>
    <%= auto_discovery_link_tag(:atom, feeds_course_format_path(@context.feed_code, :atom), {:title => t("Course Atom Feed")}) %>
  <% end %>
<% end %>

<% content_for :right_side do %>
  <div id="course_show_secondary">
    <% @can_manage_content = can_do(@context, @current_user, :manage_content) %>
    <% if @can_manage_content && can_do(@context, @current_user, :change_course_state) && (@context.unpublished? || @context.unpublishable?) %>
      <div id="course_status" class="text-center">
        <h4>
          <%= t('headers.course_status', %{Course Status}) %>
        </h4>
        <div id='course_status_actions' class="ui-buttonset">
          <%= form_for @context do |f| %>
            <% if @context.created? || @context.claimed? %>
              <button type="button" class='ui-button btn-unpublish disabled'>
                <i class="icon-unpublish"></i>
                <%= t('#buttons.unpublished', %{Unpublished}) %>
              </button>
              <button type='submit' class="ui-button btn-publish">
                <i class="icon-unpublished"></i>
                <%= t('#buttons.publish', %{Publish}) %>
              </button>
              <input type='hidden' name='course[event]' value='offer' />
            <% else %>
              <button type='submit' class="ui-button">
                <i class="icon-unpublish"></i>
                <%= t('#buttons.unpublish', %{Unpublish}) %>
              </button>
              <button type="button" class="ui-button disabled btn-published">
                <i class="icon-publish"></i>
                <%= t('#buttons.published', %{Published}) %>
              </button>
              <input type='hidden' name='course[event]' value='claim' />
            <% end %>
          <% end %>
        </div>
      </div>
    <% end %>

    <% if @can_manage_content || @course_home_view != 'feed' || @course_home_sub_navigation_tools.present? %>
      <div class="course-options">
        <% @course_home_sub_navigation_tools.each do |tool| %>
          <a class="btn button-sidebar-wide course-home-sub-navigation-lti"
             href="<%= course_external_tool_path(@context, tool, launch_type: 'course_home_sub_navigation') %>">
            <img class="icon" src="<%= tool.course_home_sub_navigation(:icon_url) %>" />
            <%= tool.label_for(:course_home_sub_navigation) %>
          </a>
        <% end %>
        <% if @can_manage_content %>
          <a class="btn button-sidebar-wide element_toggler choose_home_page_link" aria-controls="edit_course_home_content_form" href="<%= context_url(@context, :context_details_url) %>">
            <i class="icon-target"></i>
            <%= t('links.choose_home_page', %{Choose Home Page}) %>
          </a>
        <% end %>

        <% if @course_home_view != 'feed' %>
          <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_url, :view => 'feed') %>">
            <i class="icon-stats"></i>
            <%= t('links.view_course_stream', %{View Course Stream}) %>
          </a>
        <% end %>

          <% if @can_manage_content %>
            <% js_bundle :course_wizard %>
            <% jammit_css :course_wizard %>
            <a href="#" class="btn button-sidebar-wide wizard_popup_link  <%= 'auto_open' if @context.created? || @context.claimed? %>">
              <i class="icon-question"></i> <%= t('links.course_setup', %{Course Setup Checklist}) %>
            </a>

          <a class="btn button-sidebar-wide" href="<%= context_url(@context, :new_context_discussion_topic_url, :is_announcement => true) %>"><i class="icon-announcement"></i> <%= t('links.new_announcement', %{New Announcement}) %>
          </a>
        <% end %>
      </div>
    <% else %>
      <% if @can_manage_content || @course_home_sub_navigation_tools.present? %>
        <div class="secondary-button-group rs-margin-lr rs-margin-top rs-margin-bottom">
        <% @course_home_sub_navigation_tools.each do |tool| %>
          <a class="btn button-sidebar-wide course-home-sub-navigation-lti"
             href="<%= course_external_tool_path(@context, tool, launch_type: 'course_home_sub_navigation') %>">
            <img class="icon" src="<%= tool.course_home_sub_navigation(:icon_url) %>" />
            <%= tool.label_for(:course_home_sub_navigation) %>
          </a>
        <% end %>
        <% if @can_manage_content %>
            <% js_bundle :course_wizard %>
            <% jammit_css :course_wizard %>
            <a href="#" class="btn button-sidebar-wide wizard_popup_link  <%= 'auto_open' if @context.created? || @context.claimed? %>"><i class="icon-question"></i> <%= t('links.course_setup', %{Course Setup Checklist}) %></a>
            <a class="btn button-sidebar-wide" href="<%= context_url(@context, :new_context_discussion_topic_url, :is_announcement => true) %>"><i class="icon-announcement"></i> <%= t('links.new_announcement', %{New Announcement}) %></a>
        <% end %>
        </div>
      <% end %>
    <% end %>

    <% if @context.available? && @context.self_enrollment_enabled? && @context.open_enrollment && (!@context_enrollment || !@context_enrollment.active?) %>
      <div class="rs-margin-lr rs-margin-top">
        <a href="<%= enroll_url(@context.self_enrollment_code) %>" title="<%= t('links.join_course', %{Join this Course}) %>" class="btn button-sidebar-wide self_enrollment_link" data-open-as-dialog><i class="icon-user-add"></i>  <%= t('links.join_course', %{Join this Course}) %></a>
      </div>
    <% elsif @context_enrollment && @context_enrollment.self_enrolled && @context_enrollment.active? %>
      <div class="rs-margin-lr rs-margin-top">
        <a href="#" class="btn button-sidebar-wide self_unenrollment_link"><i class="icon-end"></i> <%= t('links.drop_course', %{Drop this Course}) %></a>
      </div>
      <div id="self_unenrollment_dialog" style="display: none;">
        <h2><i class="icon-warning"></i> <%= t('headings.confirm_unenroll', %{Confirm Unenrollment}) %></h2>
        <%= t('details.confirm_unenroll', %{Are you sure you want to unenroll in this course?  You will no longer be able to see the course roster or communicate directly with the teachers, and you will no longer see course events in your stream and as notifications.}) %>
        <div class="button-container">
          <a href="<%= course_self_unenrollment_path(@context, @context_enrollment.uuid) %>" class="btn btn-primary action"><i class="icon-end"></i> <span><%= t('links.drop_course', %{Drop this Course}) %></span></a>
          <a href="#" class="btn dialog_closer"><%= t('#buttons.cancel', %{Cancel}) %></a>
        </div>
      </div>
    <% end %>
    <%= render :partial => 'assignments_needing_grading', :locals => {:contexts => [@context]} %>
    <%= render :partial => "group_list", :object => @user_groups %>
    <%= nbsp unless @current_user %>
  </div>
  <% if @course_home_view == 'assignments' %>
    <%= render :partial => 'assignments/assignments_list_right_side', :locals => {:course_home => true} %>
  <% elsif @course_home_view == 'syllabus' %>
    <%= render :partial => 'assignments/syllabus_right_side', :locals => {:course_home => true} %>
  <% else %>
    <% locals = {:title => t("Coming Up"), :contexts_to_link_to => @context, :upcoming => true, :period => :one_week} %>
    <% if @current_user %>
      <% cache(safe_cache_key([@current_user, @contexts, 'course_upcoming_events' ])) do %>
        <%= render :partial => "shared/event_list", :object => @current_user.upcoming_events(:contexts => @contexts), :locals => locals %>
      <% end %>
    <% else %>
      <%= render :partial => "shared/event_list", :object => [], :locals => locals %>
    <% end %>
  <% end %>
  <% if @show_recent_feedback %>
    <%= render :partial => "shared/event_list", :object => @recent_feedback, :locals => {:title => t('titles.recent_feedback', "Recent Feedback"), :contexts_to_link_to => @context, :is_recent_feedback => true, :period => :two_weeks} %>
  <% end %>
<% end %>

<%
  jammit_css :dashboard
  case @course_home_view
  when 'wiki'
    jammit_css :tinymce
  when 'modules'
    js_bundle :context_modules
    jammit_css :context_modules2
  when 'assignments'
    js_bundle :assignments
  when 'syllabus'
{'fraction_non_alphanumeric': 0.18497143186933687, 'fraction_numerical': 0.000865700929185664, 'mean_word_length': 3.2140077821011674, 'pattern_counts': {'":': 0, '<': 379, '<?xml version=': 0, '>': 445, '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': '4204192', 'n_tokens_mistral': 5889, 'n_tokens_neox': 5380, 'n_words': 1052}