<commit_before><%= stylesheet_link_tag "courseOverview.css" %>

<!-- make this nice -->
<div class="legend_container"
  <ol class="legend">
    <li class="legend_square" style=" color:#8DE28D;">Veranstaltung absolviert</li>
    <li class="legend_square" style=" color:#ADD8E6;">Veranstaltung eingeplant </li>
    <li class="legend_square" style=" ">Veranstaltung noch nicht belegt</li>
  </ol>
</div>


<p>

<h3> Aktuelles Semester: <%= get_current_semester_and_year_from_date(Time.now) %> </h3>

</p>

<form method="POST" action="/courses">
   <select name="semesters" id = "42" >
      <option>Alle</option> 
      <option><%= get_current_semester_and_year_from_date(Time.now) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+6.month.to_i) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+12.month.to_i) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+18.month.to_i) %></option> 
      
   </select>

  </form>


<br>

  <%if logged_in?%>

    <!-- Ebene 1: Courses -->
    <!-- get_current_semester calculates and displays the current Semester.-->
 
      <ol class = "tree">
      <%course = @courses.find_by_id(current_user.course_id) %>
      <% unless course.nil? %>
        <li class = "course">
          <label id="myCourse" for="course"><%= course.name %></label>
          <input type="checkbox"  id="check_course"/>
            <ol id="outer">
              <!-- Ebene 2: Blocks -->
              <% e = course.blocks.order("name").map %>
              <% e.each_with_index  do |blocks, index| %>
                <li class = "course our_list_item">
                    <label id="myDiv<%= index%>" for="blocks"><%= blocks.name %></label>
                    <input type="checkbox" id="<%= index%>"/>
                      <ol id="inner">
                          <% f = blocks.events.order("title").map %>
                          <% f.each do |event| %>
                            <!-- variable temp is necessary to the filter fuction used in 'courses.coffeee' -->
                            <% temp = event.cycle.sub('(','').sub(')','') %>
                            <% event.schedules.each do |schedule| %>
                              <% temp=temp+' '+schedule.date.sub(%r{/.*},'') %>
                            <% end %>       
                            <% if current_user.events_users.map(&:event_id).include?(event.id) %>
                              <%case convert_date_to_number(event.events_users.find_by_user_id(current_user.id).semester) %>
                              <%when "geplant" %>
                                <li class="plannedfile <%= temp %>">
                                 <%= link_to event.title, event  %>
                              <%when "bestanden"%>
                                <li class="passedfile <%= temp %>">
                                <%= link_to event.title, event  %>
                              <%end%>
                            <%else%>
                              <li class="file <%= temp %>"> 
                              <%= link_to event.title, event  %>
                            <% end %>
                          <% end %>
                      </ol>
                  </li>
              <% end %>
            </ol>
        </li>
      <% end %>
    </ol>
<%end%>

<%= link_to 'Neuer Studiengang', new_course_path, class: 'btn btn-success' %>

<%= params[:semesters] %><commit_msg>debug seed<commit_after><%= stylesheet_link_tag "courseOverview.css" %>

<!-- make this nice -->
<div class="legend_container"
  <ol class="legend">
    <li class="legend_square" style=" color:#8DE28D;">Veranstaltung absolviert</li>
    <li class="legend_square" style=" color:#ADD8E6;">Veranstaltung eingeplant </li>
    <li class="legend_square" style=" ">Veranstaltung noch nicht belegt</li>
  </ol>
</div>


<p>

<h3> Aktuelles Semester: <%= get_current_semester_and_year_from_date(Time.now) %> </h3>

</p>

<form method="POST" action="/courses">
   <select name="semesters" id = "42" >
      <option>Alle</option> 
      <option><%= get_current_semester_and_year_from_date(Time.now) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+6.month.to_i) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+12.month.to_i) %></option>
      <option><%= get_current_semester_and_year_from_date(Time.now+18.month.to_i) %></option> 
      
   </select>

  </form>


<br>

  <%if logged_in?%>

    <!-- Ebene 1: Courses -->
    <!-- get_current_semester calculates and displays the current Semester.-->
 
      <ol class = "tree">
      <%course = @courses.find_by_id(current_user.course_id) %>
      <% unless course.nil? %>
        <li class = "course">
          <label id="myCourse" for="course"><%= course.name %></label>
          <input type="checkbox"  id="check_course"/>
            <ol id="outer">
              <!-- Ebene 2: Blocks -->
              <% e = course.blocks.order("name").map %>
              <% e.each_with_index  do |blocks, index| %>
                <li class = "course our_list_item">
                    <label id="myDiv<%= index%>" for="blocks"><%= blocks.name %></label>
                    <input type="checkbox" id="<%= index%>"/>
                      <ol id="inner">
                          <% f = blocks.events.order("title").map %>
                          <% f.each do |event| %>
                            <!-- variable temp is necessary to the filter fuction used in 'courses.coffeee' -->
                            <% temp = event.cycle.sub('(','').sub(')','') %>
                            <% event.schedules.each do |schedule| %>
                              <% temp=temp+' '+schedule.date.sub(%r{/.*},'') %>
                            <% end %>       
                            <% if current_user.events_users.map(&:event_id).include?(event.id) %>
                            <% semester = event.events_users.find_by_user_id(current_user.id).semester %>
                              <% unless semester.nil? %>
                                <%case convert_date_to_number(semester) %>
                                <%when "geplant" %>
                                  <li class="plannedfile <%= temp %>">
                                   <%= link_to event.title, event  %>
                                <%when "bestanden"%>
                                  <li class="passedfile <%= temp %>">
                                  <%= link_to event.title, event  %>
                                <%end %>
                              <% end %>
                            <%else%>
                              <li class="file <%= temp %>"> 
                              <%= link_to event.title, event  %>
                            <% end %>
                          <% end %>
                      </ol>
                  </li>
              <% end %>
            </ol>
        </li>
      <% end %>
    </ol>
<%end%>

<%= link_to '<NAME>', new_course_path, class: 'btn btn-success' %>

<%= params[:semesters] %>
{'fraction_non_alphanumeric': 0.16431990988453957, 'fraction_numerical': 0.004505773021684032, 'mean_word_length': 1.5707564241766196, 'pattern_counts': {'":': 0, '<': 193, '<?xml version=': 0, '>': 191, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6178984', 'n_tokens_mistral': 2303, 'n_tokens_neox': 2061, 'n_words': 379}