<commit_before><% content_for :page_title, t('titles.courses', 'Courses') %>

<% content_for :auto_discovery do %>
  <% if @current_user %>
    <%= auto_discovery_link_tag(:atom, feeds_user_format_path(@current_user.feed_code, :atom), {:title => t('titles.rss.course_announcements', "Course Announcements Atom Feed")}) %>
  <% end %>
<% end %>

<% css_bundle :context_list, :course_list %>
<% js_bundle :course_list %>
<% @favorite_course_ids = @current_user.courses_with_primary_enrollment(:favorite_courses).map(&:id) %>
<% @show_star_column = true %>
<% unless @current_enrollments.empty? %>
  <div class="header-bar">
    <h2><%= t('headings.my_courses', %{All Courses}) %></h2>
  </div>

  <div class="ic-Action-header content--hasMarginTop">
    <div class="ic-Action-header__Secondary">
      <% if @domain_root_account.feature_enabled?(:course_catalog) %>
        <%= link_to t('browse_more_courses', 'Browse More Courses'), "/search/all_courses/", class:"Button" %>
      <% end %>

      <% if show_user_create_course_button(@current_user) %>
          <button type="button"
                  id="start_new_course"
                  class="Button element_toggler"
                  aria-controls="new_course_form"
                  aria-label="<%= t('Add a Course') %>">
                  <i class="icon-plus"></i> <%= t('start_new_course', 'Course') %></button>
          <%= render :partial => 'shared/new_course_form' %>
      <% end %>
    </div>
  </div>

  <table id="my_courses_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
    <% else %>class="table table-bordered course-list-table"<% end %> >
    <thead>
      <tr>
        <th scope="col" class="course-list-star-column"><span class="screenreader-only"><%= t ('Favorites') %></span></th>
        <th scope="col" class="course-list-course-title-column course-list-no-left-border"><%= t ('Course') %></th>
        <th scope="col" class="course-list-nickname-column course-list-no-left-border"><%= t ('Nickname') %></th>
        <th scope="col" class="course-list-term-column course-list-no-left-border"><%= t ('Term') %></th>
        <th scope="col" class="course-list-enrolled-as-column course-list-no-left-border"><%= t ('Enrolled as') %></th>
        <th scope="col" class="course-list-published-column course-list-no-left-border"><%= t ('Published') %></th>
      </tr>
    </thead>
    <tbody>
      <% @current_enrollments.each do |enrollment| %>
        <%= render :partial => "shared/current_enrollment", :object => enrollment %>
      <% end %>
    </tbody>
  </table>
<% end %>

<% @show_star_column = true %>
<% unless @past_enrollments.empty? %>
  <div class="content--hasMarginTop">
    <h2><%= t('headings.past_enrollments', %{Past Enrollments}) %></h2><commit_msg>show message on courses index for users with no enrollments<commit_after><% content_for :page_title, t('titles.courses', 'Courses') %>

<% content_for :auto_discovery do %>
  <% if @current_user %>
    <%= auto_discovery_link_tag(:atom, feeds_user_format_path(@current_user.feed_code, :atom), {:title => t('titles.rss.course_announcements', "Course Announcements Atom Feed")}) %>
  <% end %>
<% end %>

<% css_bundle :context_list, :course_list %>
<% js_bundle :course_list %>
<% @favorite_course_ids = @current_user.courses_with_primary_enrollment(:favorite_courses).map(&:id) %>
<% @show_star_column = true %>
  <div class="header-bar">
    <h2><%= t('headings.my_courses', %{All Courses}) %></h2>
  </div>

  <div class="ic-Action-header content--hasMarginTop">
    <div class="ic-Action-header__Secondary">
      <% if @domain_root_account.feature_enabled?(:course_catalog) %>
        <%= link_to t('browse_more_courses', 'Browse More Courses'), "/search/all_courses/", class:"Button" %>
      <% end %>

      <% if show_user_create_course_button(@current_user) %>
          <button type="button"
                  id="start_new_course"
                  class="Button element_toggler"
                  aria-controls="new_course_form"
                  aria-label="<%= t('Add a Course') %>">
                  <i class="icon-plus"></i> <%= t('start_new_course', 'Course') %></button>
          <%= render :partial => 'shared/new_course_form' %>
      <% end %>
    </div>
  </div>

<% if @current_enrollments.empty? %>
  <%= t("You are not enrolled in any courses.") %>
<% else %>
  <table id="my_courses_table" <% if use_new_styles? %>class="ic-Table ic-Table--bordered course-list-table"
    <% else %>class="table table-bordered course-list-table"<% end %> >
    <thead>
      <tr>
        <th scope="col" class="course-list-star-column"><span class="screenreader-only"><%= t ('Favorites') %></span></th>
        <th scope="col" class="course-list-course-title-column course-list-no-left-border"><%= t ('Course') %></th>
        <th scope="col" class="course-list-nickname-column course-list-no-left-border"><%= t ('Nickname') %></th>
        <th scope="col" class="course-list-term-column course-list-no-left-border"><%= t ('Term') %></th>
        <th scope="col" class="course-list-enrolled-as-column course-list-no-left-border"><%= t ('Enrolled as') %></th>
        <th scope="col" class="course-list-published-column course-list-no-left-border"><%= t ('Published') %></th>
      </tr>
    </thead>
    <tbody>
      <% @current_enrollments.each do |enrollment| %>
        <%= render :partial => "shared/current_enrollment", :object => enrollment %>
      <% end %>
    </tbody>
  </table>
<% end %>

<% @show_star_column = true %>
<% unless @past_enrollments.empty? %>
  <div class="content--hasMarginTop">
    <h2><%= t('headings.past_enrollments', %{Past Enrollments}) %></h2>
{'fraction_non_alphanumeric': 0.1983092638252906, 'fraction_numerical': 0.0014089468122578373, 'mean_word_length': 3.628361858190709, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 159, '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': '6416070', 'n_tokens_mistral': 2055, 'n_tokens_neox': 1879, 'n_words': 338}