<commit_before><%= render partial: 'reports/shared/month_year_selector' %>
<%= render partial: 'reports/shared/team_selector' %>
<%= render partial: 'reports/shared/header', locals: {base_url: "/reports/absences/:year", append_to_url: "/as/calendar", title: t('.title') } %>

<% @range.select { |date| date.day == 1 }.each do |month_start| %>
  <% range = UberZeit.month_as_range(month_start.year, month_start.month) %>
  <div class="content-summary row">
    <div class="large-12 columns">
      <div class="row">
        <table class="nice large-12 calendar">
          <tr>
            <th><%= l range.min, format: t('.month_in_year') %></td>
            <% range.each do |day| %>
              <% current_day_class = (day.today? ? 'today' : '') %>
              <th class="
                <% if day.today? %>today<% end %>
                <% if @public_holidays[day] %>public-holiday has-tip<% end %>
                <% unless @work_days[day] %>non-work-day<% end %>
                "<% if @public_holidays[day] %> data-tooltip="<%=render(partial: 'shared/public_holiday_tooltip', locals: { public_holiday: @public_holidays[day].first }).to_s%>"<% end %>>
                <%= day.strftime('%d') %>
              </th>
            <% end %>
          </tr>

          <% @users.each do |user| %>
          <tr>
            <td><%= user %></td>
            <% range.each do |day| %>
              <%
                absences = @absences_by_user_and_date.fetch([user.id, day], [])
              %>
              <td class="event
              <% if day.today? %>today<% end %>
              <% if @public_holidays[day] %>public-holiday<% end %>
              <% unless @work_days[day] %>non-work-day<% end %>
              <% unless absences.empty? %>has-tip<% end %>"
              <% unless absences.empty? %>data-tooltip="<%=render(partial: 'shared/absences_tooltip', locals: { absences: absences, day: day, edit: false }).to_s%>" <% end %>
              <% if absences.empty? %>data-add-absence-url="<%= year_user_absences_path(user, day.year, add_absence_for_date: day) %>"<% end %>>
                <% unless absences.blank? %>
                  <div class="event-container">
                    <%= render_absences(absences).html_safe %>
                  </div>
                <% end %>
              </td>
            <% end %>
          </tr>
          <% end %>
        </table>
      </div>
    </div>
  </div><commit_msg>only add absence link if user can actually add absences<commit_after><%= render partial: 'reports/shared/month_year_selector' %>
<%= render partial: 'reports/shared/team_selector' %>
<%= render partial: 'reports/shared/header', locals: {base_url: "/reports/absences/:year", append_to_url: "/as/calendar", title: t('.title') } %>

<% @range.select { |date| date.day == 1 }.each do |month_start| %>
  <% range = UberZeit.month_as_range(month_start.year, month_start.month) %>
  <div class="content-summary row">
    <div class="large-12 columns">
      <div class="row">
        <table class="nice large-12 calendar">
          <tr>
            <th><%= l range.min, format: t('.month_in_year') %></td>
            <% range.each do |day| %>
              <% current_day_class = (day.today? ? 'today' : '') %>
              <th class="
                <% if day.today? %>today<% end %>
                <% if @public_holidays[day] %>public-holiday has-tip<% end %>
                <% unless @work_days[day] %>non-work-day<% end %>
                "<% if @public_holidays[day] %> data-tooltip="<%=render(partial: 'shared/public_holiday_tooltip', locals: { public_holiday: @public_holidays[day].first }).to_s%>"<% end %>>
                <%= day.strftime('%d') %>
              </th>
            <% end %>
          </tr>

          <% @users.each do |user| %>
          <tr>
            <td><%= user %></td>
            <% range.each do |day| %>
              <%
                absences = @absences_by_user_and_date.fetch([user.id, day], [])
              %>
              <td class="event
              <% if day.today? %>today<% end %>
              <% if @public_holidays[day] %>public-holiday<% end %>
              <% unless @work_days[day] %>non-work-day<% end %>
              <% unless absences.empty? %>has-tip<% end %>"
              <% unless absences.empty? %>data-tooltip="<%=render(partial: 'shared/absences_tooltip', locals: { absences: absences, day: day, edit: false }).to_s%>" <% end %>
              <% if can?(:manage, Absence) && absences.empty? %>data-add-absence-url="<%= year_user_absences_path(user, day.year, add_absence_for_date: day) %>"<% end %>>
                <% unless absences.blank? %>
                  <div class="event-container">
                    <%= render_absences(absences).html_safe %>
                  </div>
                <% end %>
              </td>
            <% end %>
          </tr>
          <% end %>
        </table>
      </div>
    </div>
  </div>
{'fraction_non_alphanumeric': 0.18595710238769728, 'fraction_numerical': 0.0020234722784297854, 'mean_word_length': 1.9759181216134858, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 131, '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': '4928509', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1506, 'n_words': 304}