<commit_before><%
  js_env :CALENDAR => { :ACTIVE_EVENT => @active_event_id }
  js_bundle :calendar
  jammit_css :calendar
  @body_classes << "full-width"
%>
<% content_for :stylesheets do %>
  <style type="text/css">
  <% @contexts.each_with_index do |c, idx| %>
      .group_<%= "#{c.class.to_s.downcase}_#{c.id}" %> {
        border-width: 1px;
        border-style: solid;
        border-color: <%= dark_color_pastel_index(idx) %>;
        background-color: <%= light_color_pastel_index(idx) %> !important;
      }      
  <% end %>
  </style>
<% end %>
<% content_for :right_side do %>
  <div class="calendar_links rs-margin-lr rs-margin-top">
    <div style="margin-bottom: 10px;">
      <a href="#" class="wizard_popup_link <%= 'auto_open' if params[:wizard] %> help"><%= t 'links.how_do_i', "How Do I...?" %></a>
    </div>
  
    <%= render :partial => 'calendars/mini_calendar', :locals => {:current => current, :first_day => first_day } %>
    <hr />
    <div class="text-right" style="font-size: 0.8em;">
      <%= t :calendars_count, { :one => "1 calendar, %{open_count} open", :other => "%{count} calendars, %{open_count} open" },
            :count => @contexts.length, :open_count => '<span class="calendars_open_count"></span>'.html_safe %>
    </div>
    <div style="max-height: 215px; overflow: auto;">
    <% @contexts.each_with_index do |c, idx| %>
      <div>
        <div class="group_reference group_<%= "#{c.class.to_s.downcase}_#{c.id}" %> <%= 'default_context' if c == @context %>">
          <a href="<%= context_url(c, :new_context_calendar_event_url) %>" class="add_event_link btn btn-small" ><%= image_tag "add-small.png" %> <%= t 'links.add_event', "Add Event" %></a>
        
          &nbsp;
          <div style="position: absolute; top: 2px; left: 2px;">
            <input type="checkbox" class="group_reference_checkbox" id="group_<%= "#{c.class.to_s.downcase}_#{c.id}" %>" <%= 'readonly="true"' if @contexts.length > 1  %>/>
            <label for="group_<%= "#{c.class.to_s.downcase}_#{c.id}" %>"><%= c.name %></label>
          </div>
        </div>
        <div class="clear"></div>
      </div>
    <% end %>
    </div>
    <div style=" margin-bottom: 10px; font-size: 0.7em;">
      <div id="max_calendar_count" style="display: none;"><%= CalendarEvent.max_visible_calendars %></div>
      <% if @contexts.length > 10 %><%= t 'messages.max_visible', "You can show up to %{count} calendars at a time", :count => CalendarEvent.max_visible_calendars %><% end %>
    </div>
  
    <div class="undated_link" style="margin: 0 0 10px 10px;">
      <a href="#" class="show_undated_link"><%= t 'links.show_undated_events', "show %{count} undated events", :count => '<span class=\'undated_count\'></span>'.html_safe %></a>
    </div>
    <div class="undated_content" style="display: none;">
      <b><%= before_label :undated_events, "Undated Events" %></b>
      <div class="calendar_undated">
        <div class="calendar_day calendar_day_undated">
          <%= render :partial => 'event', :collection => @undated_events %>
        </div>
      </div>
      <div class="text-right" style="font-size: 0.8em;">
        <a href="#" class="add_event_link add-small"><%= t 'links.add_event', "Add Event" %></a>
      </div>
    </div>

    <div>
      <% if @context_enrollment %>
        <a class="calendar_feed_link small-calendar" href="<%= feeds_calendar_url(@context_enrollment.feed_code) %>.ics"> <%= t :feed_title, "Calendar Feed" %></a>
      <% elsif @context.available? %>
        <a class="calendar_feed_link small-calendar" href="<%= feeds_calendar_url(@context.feed_code) %>.ics"> <%= t :feed_title, "Calendar Feed" %></a>
      <% end %>
    </div>
  </div>
<% end %>
<div style="display: none;" id="context_urls">
  <% @contexts.each do |context| %>
    <% cache([context, 'assignment_groups_for_cal']) do %>
      <a href="<%= context_url(context, :context_calendar_events_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_event_url">&nbsp;</a>
      <a href="<%= context_url(context, :context_calendar_event_url, "{{ id }}") %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_event_url">&nbsp;</a>
      <% if context.respond_to?("assignments") %>
        <a href="<%= context_url(context, :context_assignments_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_assignment_url">&nbsp;</a>
        <a href="<%= context_url(context, :context_assignment_url, "{{ id }}") %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_assignment_url">&nbsp;</a>
        <%= select :assignment, :assignment_group_id, (context.assignment_groups.active.scoped(:select => "id, name").map {|g| [g.name, g.id]} << [t('options.new_group', "[ New Group ]"), "new"]), {}, {:class => "assignment_group_id #{context.try_rescue(:weight_assignment_groups) ? 'weight' : ''}", :id => "#{ context.class.to_s.downcase }_#{ context.id }_assignment_groups"} %>
        <a href="<%= context_url(context, :context_assignment_groups_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_assignment_group_url">&nbsp;</a>
      <% end %>
    <% end %>
  <% end %>
</div>
<div class="calendar_container">
  <div class="hidden-readable">
    <a href="#calendar"><%= t 'links.jump_to_calendar', "Jump to Calendar" %></a>
  </div>
  <a name="calendar"></a>
  <table class="calendar_month">
    <tr>
      <td colspan="7" class="month_title">
        <div class="text-right" style="position: relative;">
          <span style="display: none;" class="month_number"><%= @current.month %></span>
          <a href="#" class="prev_month_link no-hover"><%= image_tag "arrow_left.png", :alt => t('alts.previous', "Previous") %></a>
          <span id="month_and_year">
            <span class="month_name"><%= I18n.t('date.month_names')[current.month] %></span>
            <span class="year_number"><%= @current.year %></span>
          </span>
          <a href="#" class="next_month_link no-hover"><%= image_tag "arrow_right.png", :alt => t('alts.next', "Next") %></a>
          <a href="#" class="refresh_calendar_link"><%= image_tag "ajax-reload.gif", :class => "static" %><%= image_tag "ajax-reload-animated.gif", :class => "animated", :style => "display: none;" %></a>
        </div>
      </td>
    </tr>
    <tr id="calendar-days">
      <% I18n.t('date.day_names').each do |d| %>
      <td><%= d %></td>
      <% end %>
    </tr>
  <% day = first_day %>
  <% cache(['calendar_render', day.to_s].cache_key) do %>
    <% 6.times do %>
      <tr class="calendar_week visible">
      <% 7.times do %>
        <td id="day_<%= day.strftime("%Y_%m_%d") %>" tabindex="0" class="calendar_day_holder <%= day <= last_day ? 'visible' : '' %>"><div class="calendar_day <%= day.month == current.month ? 'current_month' : 'other_month' %>">
          <div class="day_number" title="<%= day.strftime("%m/%d/%Y") %>"><%= day.day %></div>
        </div></td>
        <% day = day.next %>
      <% end %>
    <% end %>
  <% end %>
  </table>
</div>
<%= render :partial => 'event', :object => nil %>
<table id="calendar_blank" style="display: none;">
  <tr class="calendar_week">
    <td class="calendar_day_holder"><div class="calendar_day">
      <div class="day_number" title=""></div>
    </div></td>
  </tr>
</table>
<div id="event_details" style="display: none;">
  <div class="content">
    <div class="details_time time_string">&nbsp;</div>
    <div class="details_title title">&nbsp;</div>
    <div class="details_description description user_content" style="min-height: 20px; max-height: 150px; overflow: auto;"></div>
    <div class="details_description lock_explanation"></div>
    <!--a href="#" class="assignment_link" style="display: none;">View Assignment Details</a-->
    <div class="links">
      <a href="/{{ context_type }}s/{{ context_id }}/assignments/{{ id }}" class="assignment_url" style="display: none;">&nbsp;</a>
      <a href="/{{ context_type }}s/{{ context_id }}/calendar_events/{{ id }}" class="calendar_event_url" style="display: none;">&nbsp;</a>
      <a href="<%= context_url(@context, :new_context_calendar_event_url) %>" class="new_calendar_event_url" style="display: none;">&nbsp;</a>
      <a href="<%= context_url(@context, :new_context_assignment_url) rescue '#' %>" class="new_assignment_url" style="display: none;">&nbsp;</a>
      <a href="#" class="view_event_link"><%= t 'links.full_details', "Full Details" %></a>
      <span class="edit_event"> | <a href="#" class="edit_event_link"><%= t 'links.edit', "Edit" %></a> | </span>
      <span class="delete_event"><a href="#" class="delete_event_link"><%= t 'links.delete', "Delete" %></a></span>
    </div>
  </div>
</div>
<div id="edit_event" style="display: none;">
  <div class="content" id="edit_event_tabs">
    <ul>
      <li><a href="#edit_calendar_event_form" class="edit_calendar_event_option"><%= t 'tabs.event', "Event" %></a></li>
      <li><a href="#edit_assignment_form" class="edit_assignment_option"><%= t 'tabs.assignment', "Assignment" %></a></li>
    </ul>
    <% form_for(:calendar_event, :url => context_url(@context, :context_calendar_events_url), :html => {:id => 'edit_calendar_event_form', :style => 'padding: 5px;'}) do |f| %>
    <table class="formtable" style="width: 100%;">
      <tr>
        <td style="vertical-align: top;"><%= before_label :title, "Title" %></td>
        <td>
          <%= f.text_field :title, :style => "width: 150px;" %>
        </td>
      </tr><tr>
        <td style="vertical-align: top;"><%= before_label :date, "Date" %></td>
        <td><input type="text" name="date" style="width: 100px;" class="date_field"/></td>
      </tr><tr style="display: none;">
        <td style="vertical-align: top;"><%= before_label :details, "Details" %></td>
        <td><!--textarea type="text" name="description" style="width: 150px; height: 40px;"></textarea--></td>
      </tr><tr>
        <td style="vertical-align: top;"><%= before_label :from, "From" %></td>
        <td>
          <% ot(:timespan, "%{start_time} *to* %{end_time}", :start_time => capture { %>
            <div style="float: left;"><input type="text" name="start_time" style="width: 60px;" class="time_field start_time"/></div>
          <% }, :wrapper => '<div style="float: left;">&nbsp;\1&nbsp;</div>', :end_time => capture { %>
            <div style="float: left;"><input type="text" name="end_time" style="width: 60px;" class="time_field end_time"/></div>
          <% }) %>
          <div class="clear"></div>
        </td>
      </tr><tr class="context_select" style="<%= hidden unless @contexts.length > 1 %>">
        <td><%= before_label :calendar, "Calendar" %></td>
        <td>
          <select class="context_id">
            <% @contexts.select{|c| c.respond_to?("calendar_events") && c.calendar_events.build.grants_right?(@current_user, session, :create)}.each do |context| %>
              <option value="<%= context.class.to_s.downcase %>_<%= context.id %>"><%= context.name %></option>
            <% end %>
          </select>
        </td>
      </tr><tr>
        <td colspan="2" class="text-right">
          <a href="#" class="btn btn-secondary more_options_link"><%= t 'links.more_options', "More Options" %></a>
          <button type="submit" class="btn btn-primary"><%= t '#buttons.submit', "Submit" %></button>
        </td>
      </tr>
    </table>
    <% end %>
    <% form_for(:assignment, :url => ".", :html => {:id => 'edit_assignment_form', :style => 'padding: 5px;'}) do |f| %>
    <table class="formtable" style="width: 100%;">
      <tr>
        <td><%= before_label :title, "Title" %></td>
        <td><%= f.text_field :title, :style => "width: 200px;" %></td>
      </tr><tr>
        <td><%= before_label :due, "Due" %></td>
        <td>
          <%= f.text_field :due_at, :style => "width: 150px;", :class => "datetime_field" %>
        </td>
      </tr><tr class="context_select" style="<%= hidden unless @contexts.length > 1 %>">
        <td><%= before_label :calendar, "Calendar" %></td>
        <td>
          <select class="context_id">
            <% @contexts.select{|c| c.respond_to?("assignments") && c.assignments.build.grants_right?(@current_user, session, :create)}.each do |context| %>
              <option value="<%= context.class.to_s.downcase %>_<%= context.id %>"><%= context.name %></option>
            <% end %>
          </select>
        </td>
      </tr><tr>
        <td><%= before_label :group, "Group" %></td>
        <td class="assignment_group_select">
        </td>
      </tr><tr>
        <td colspan="2" class="text-right">
          <a href="#" class="btn btn-secondary more_options_link"><%= t 'links.more_options', "More Options" %></a>
          <button type="submit" class="btn btn-primary"><%= t '#buttons.submit', "Submit" %></button>
        </td>
      </tr>
    </table>
    <% end %>
  </div>
</div>
<div style="position: absolute; left: -1000;" id="offside_box">
</div>
<%= render :partial => "shared/add_assignment_group" %>
<div id="calendar_feed_box" style="display: none;">
  <div>
    <%= image_tag "ical_big.png", :style => "float: left; margin: 0px 3px;" %>
    <%= t 'instructions.ics_link', "Copy the link below and paste it into any calendar app that takes
    iCal feeds (Google Calendar, iCal, Outlook, etc.)" %>
  </div>
  <div style="text-align: center; margin: 10px 2px 5px;">
  <input type="text" style="width: 330px;" class="calendar_feed_url"/><br/>
  <a href="#" class="show_calendar_feed_link"><%= t 'links.feed', "click here to view the feed" %></a>
  </div>
</div>
<% js_block do %>
  <script type="text/javascript">
    var managementContexts = <%= raw @contexts.select{|c| can_do(c, @current_user, :manage_calendar) }.map(&:asset_string).to_json %>;
    var canCreateEvent = managementContexts.length > 0;
    lastCalendarUpdate = "<%= ActiveSupport::TimeWithZone.new(Time.now, Time.zone).strftime("%Y-%m-%dT%H:%M:%S") %>";
  </script>
<% end %>
<commit_msg>calendar1 header alignment is centered<commit_after><%
  js_env :CALENDAR => { :ACTIVE_EVENT => @active_event_id }
  js_bundle :calendar
  jammit_css :calendar
  @body_classes << "full-width"
%>
<% content_for :stylesheets do %>
  <style type="text/css">
  <% @contexts.each_with_index do |c, idx| %>
      .group_<%= "#{c.class.to_s.downcase}_#{c.id}" %> {
        border-width: 1px;
        border-style: solid;
        border-color: <%= dark_color_pastel_index(idx) %>;
        background-color: <%= light_color_pastel_index(idx) %> !important;
      }      
  <% end %>
  </style>
<% end %>
<% content_for :right_side do %>
  <div class="calendar_links rs-margin-lr rs-margin-top">
    <div style="margin-bottom: 10px;">
      <a href="#" class="wizard_popup_link <%= 'auto_open' if params[:wizard] %> help"><%= t 'links.how_do_i', "How Do I...?" %></a>
    </div>
  
    <%= render :partial => 'calendars/mini_calendar', :locals => {:current => current, :first_day => first_day } %>
    <hr />
    <div class="text-right" style="font-size: 0.8em;">
      <%= t :calendars_count, { :one => "1 calendar, %{open_count} open", :other => "%{count} calendars, %{open_count} open" },
            :count => @contexts.length, :open_count => '<span class="calendars_open_count"></span>'.html_safe %>
    </div>
    <div style="max-height: 215px; overflow: auto;">
    <% @contexts.each_with_index do |c, idx| %>
      <div>
        <div class="group_reference group_<%= "#{c.class.to_s.downcase}_#{c.id}" %> <%= 'default_context' if c == @context %>">
          <a href="<%= context_url(c, :new_context_calendar_event_url) %>" class="add_event_link btn btn-small" ><%= image_tag "add-small.png" %> <%= t 'links.add_event', "Add Event" %></a>
        
          &nbsp;
          <div style="position: absolute; top: 2px; left: 2px;">
            <input type="checkbox" class="group_reference_checkbox" id="group_<%= "#{c.class.to_s.downcase}_#{c.id}" %>" <%= 'readonly="true"' if @contexts.length > 1  %>/>
            <label for="group_<%= "#{c.class.to_s.downcase}_#{c.id}" %>"><%= c.name %></label>
          </div>
        </div>
        <div class="clear"></div>
      </div>
    <% end %>
    </div>
    <div style=" margin-bottom: 10px; font-size: 0.7em;">
      <div id="max_calendar_count" style="display: none;"><%= CalendarEvent.max_visible_calendars %></div>
      <% if @contexts.length > 10 %><%= t 'messages.max_visible', "You can show up to %{count} calendars at a time", :count => CalendarEvent.max_visible_calendars %><% end %>
    </div>
  
    <div class="undated_link" style="margin: 0 0 10px 10px;">
      <a href="#" class="show_undated_link"><%= t 'links.show_undated_events', "show %{count} undated events", :count => '<span class=\'undated_count\'></span>'.html_safe %></a>
    </div>
    <div class="undated_content" style="display: none;">
      <b><%= before_label :undated_events, "Undated Events" %></b>
      <div class="calendar_undated">
        <div class="calendar_day calendar_day_undated">
          <%= render :partial => 'event', :collection => @undated_events %>
        </div>
      </div>
      <div class="text-right" style="font-size: 0.8em;">
        <a href="#" class="add_event_link add-small"><%= t 'links.add_event', "Add Event" %></a>
      </div>
    </div>

    <div>
      <% if @context_enrollment %>
        <a class="calendar_feed_link small-calendar" href="<%= feeds_calendar_url(@context_enrollment.feed_code) %>.ics"> <%= t :feed_title, "Calendar Feed" %></a>
      <% elsif @context.available? %>
        <a class="calendar_feed_link small-calendar" href="<%= feeds_calendar_url(@context.feed_code) %>.ics"> <%= t :feed_title, "Calendar Feed" %></a>
      <% end %>
    </div>
  </div>
<% end %>
<div style="display: none;" id="context_urls">
  <% @contexts.each do |context| %>
    <% cache([context, 'assignment_groups_for_cal']) do %>
      <a href="<%= context_url(context, :context_calendar_events_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_event_url">&nbsp;</a>
      <a href="<%= context_url(context, :context_calendar_event_url, "{{ id }}") %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_event_url">&nbsp;</a>
      <% if context.respond_to?("assignments") %>
        <a href="<%= context_url(context, :context_assignments_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_assignment_url">&nbsp;</a>
        <a href="<%= context_url(context, :context_assignment_url, "{{ id }}") %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_assignment_url">&nbsp;</a>
        <%= select :assignment, :assignment_group_id, (context.assignment_groups.active.scoped(:select => "id, name").map {|g| [g.name, g.id]} << [t('options.new_group', "[ New Group ]"), "new"]), {}, {:class => "assignment_group_id #{context.try_rescue(:weight_assignment_groups) ? 'weight' : ''}", :id => "#{ context.class.to_s.downcase }_#{ context.id }_assignment_groups"} %>
        <a href="<%= context_url(context, :context_assignment_groups_url) %>" class="<%= context.class.to_s.downcase %>_<%= context.id %>_add_assignment_group_url">&nbsp;</a>
      <% end %>
    <% end %>
  <% end %>
</div>
<div class="calendar_container">
  <div class="hidden-readable">
    <a href="#calendar"><%= t 'links.jump_to_calendar', "Jump to Calendar" %></a>
  </div>
  <a name="calendar"></a>
  <table class="calendar_month">
    <tr>
      <td colspan="7" class="month_title">
        <span style="display: none;" class="month_number"><%= @current.month %></span>
        <a href="#" class="prev_month_link no-hover"><%= image_tag "arrow_left.png", :alt => t('alts.previous', "Previous") %></a>
        <span id="month_and_year">
          <span class="month_name"><%= I18n.t('date.month_names')[current.month] %></span>
          <span class="year_number"><%= @current.year %></span>
        </span>
        <a href="#" class="next_month_link no-hover"><%= image_tag "arrow_right.png", :alt => t('alts.next', "Next") %></a>
        <a href="#" class="refresh_calendar_link"><%= image_tag "ajax-reload.gif", :class => "static" %><%= image_tag "ajax-reload-animated.gif", :class => "animated", :style => "display: none;" %></a>
      </td>
    </tr>
    <tr id="calendar-days">
      <% I18n.t('date.day_names').each do |d| %>
      <td><%= d %></td>
      <% end %>
    </tr>
  <% day = first_day %>
  <% cache(['calendar_render', day.to_s].cache_key) do %>
    <% 6.times do %>
      <tr class="calendar_week visible">
      <% 7.times do %>
        <td id="day_<%= day.strftime("%Y_%m_%d") %>" tabindex="0" class="calendar_day_holder <%= day <= last_day ? 'visible' : '' %>"><div class="calendar_day <%= day.month == current.month ? 'current_month' : 'other_month' %>">
          <div class="day_number" title="<%= day.strftime("%m/%d/%Y") %>"><%= day.day %></div>
        </div></td>
        <% day = day.next %>
      <% end %>
    <% end %>
  <% end %>
  </table>
</div>
<%= render :partial => 'event', :object => nil %>
<table id="calendar_blank" style="display: none;">
  <tr class="calendar_week">
    <td class="calendar_day_holder"><div class="calendar_day">
      <div class="day_number" title=""></div>
    </div></td>
  </tr>
</table>
<div id="event_details" style="display: none;">
  <div class="content">
    <div class="details_time time_string">&nbsp;</div>
    <div class="details_title title">&nbsp;</div>
    <div class="details_description description user_content" style="min-height: 20px; max-height: 150px; overflow: auto;"></div>
    <div class="details_description lock_explanation"></div>
    <!--a href="#" class="assignment_link" style="display: none;">View Assignment Details</a-->
    <div class="links">
      <a href="/{{ context_type }}s/{{ context_id }}/assignments/{{ id }}" class="assignment_url" style="display: none;">&nbsp;</a>
      <a href="/{{ context_type }}s/{{ context_id }}/calendar_events/{{ id }}" class="calendar_event_url" style="display: none;">&nbsp;</a>
      <a href="<%= context_url(@context, :new_context_calendar_event_url) %>" class="new_calendar_event_url" style="display: none;">&nbsp;</a>
      <a href="<%= context_url(@context, :new_context_assignment_url) rescue '#' %>" class="new_assignment_url" style="display: none;">&nbsp;</a>
      <a href="#" class="view_event_link"><%= t 'links.full_details', "Full Details" %></a>
      <span class="edit_event"> | <a href="#" class="edit_event_link"><%= t 'links.edit', "Edit" %></a> | </span>
      <span class="delete_event"><a href="#" class="delete_event_link"><%= t 'links.delete', "Delete" %></a></span>
    </div>
  </div>
</div>
<div id="edit_event" style="display: none;">
  <div class="content" id="edit_event_tabs">
    <ul>
      <li><a href="#edit_calendar_event_form" class="edit_calendar_event_option"><%= t 'tabs.event', "Event" %></a></li>
      <li><a href="#edit_assignment_form" class="edit_assignment_option"><%= t 'tabs.assignment', "Assignment" %></a></li>
    </ul>
    <% form_for(:calendar_event, :url => context_url(@context, :context_calendar_events_url), :html => {:id => 'edit_calendar_event_form', :style => 'padding: 5px;'}) do |f| %>
    <table class="formtable" style="width: 100%;">
      <tr>
        <td style="vertical-align: top;"><%= before_label :title, "Title" %></td>
        <td>
          <%= f.text_field :title, :style => "width: 150px;" %>
        </td>
      </tr><tr>
        <td style="vertical-align: top;"><%= before_label :date, "Date" %></td>
        <td><input type="text" name="date" style="width: 100px;" class="date_field"/></td>
      </tr><tr style="display: none;">
        <td style="vertical-align: top;"><%= before_label :details, "Details" %></td>
        <td><!--textarea type="text" name="description" style="width: 150px; height: 40px;"></textarea--></td>
      </tr><tr>
        <td style="vertical-align: top;"><%= before_label :from, "From" %></td>
        <td>
          <% ot(:timespan, "%{start_time} *to* %{end_time}", :start_time => capture { %>
            <div style="float: left;"><input type="text" name="start_time" style="width: 60px;" class="time_field start_time"/></div>
          <% }, :wrapper => '<div style="float: left;">&nbsp;\1&nbsp;</div>', :end_time => capture { %>
            <div style="float: left;"><input type="text" name="end_time" style="width: 60px;" class="time_field end_time"/></div>
          <% }) %>
          <div class="clear"></div>
        </td>
      </tr><tr class="context_select" style="<%= hidden unless @contexts.length > 1 %>">
        <td><%= before_label :calendar, "Calendar" %></td>
        <td>
          <select class="context_id">
            <% @contexts.select{|c| c.respond_to?("calendar_events") && c.calendar_events.build.grants_right?(@current_user, session, :create)}.each do |context| %>
              <option value="<%= context.class.to_s.downcase %>_<%= context.id %>"><%= context.name %></option>
            <% end %>
          </select>
        </td>
      </tr><tr>
        <td colspan="2" class="text-right">
          <a href="#" class="btn btn-secondary more_options_link"><%= t 'links.more_options', "More Options" %></a>
          <button type="submit" class="btn btn-primary"><%= t '#buttons.submit', "Submit" %></button>
        </td>
      </tr>
    </table>
    <% end %>
    <% form_for(:assignment, :url => ".", :html => {:id => 'edit_assignment_form', :style => 'padding: 5px;'}) do |f| %>
    <table class="formtable" style="width: 100%;">
      <tr>
        <td><%= before_label :title, "Title" %></td>
        <td><%= f.text_field :title, :style => "width: 200px;" %></td>
      </tr><tr>
        <td><%= before_label :due, "Due" %></td>
        <td>
          <%= f.text_field :due_at, :style => "width: 150px;", :class => "datetime_field" %>
        </td>
      </tr><tr class="context_select" style="<%= hidden unless @contexts.length > 1 %>">
        <td><%= before_label :calendar, "Calendar" %></td>
        <td>
          <select class="context_id">
            <% @contexts.select{|c| c.respond_to?("assignments") && c.assignments.build.grants_right?(@current_user, session, :create)}.each do |context| %>
              <option value="<%= context.class.to_s.downcase %>_<%= context.id %>"><%= context.name %></option>
            <% end %>
          </select>
        </td>
      </tr><tr>
        <td><%= before_label :group, "Group" %></td>
        <td class="assignment_group_select">
        </td>
      </tr><tr>
        <td colspan="2" class="text-right">
          <a href="#" class="btn btn-secondary more_options_link"><%= t 'links.more_options', "More Options" %></a>
          <button type="submit" class="btn btn-primary"><%= t '#buttons.submit', "Submit" %></button>
        </td>
      </tr>
    </table>
    <% end %>
  </div>
</div>
<div style="position: absolute; left: -1000;" id="offside_box">
</div>
<%= render :partial => "shared/add_assignment_group" %>
<div id="calendar_feed_box" style="display: none;">
  <div>
    <%= image_tag "ical_big.png", :style => "float: left; margin: 0px 3px;" %>
    <%= t 'instructions.ics_link', "Copy the link below and paste it into any calendar app that takes
    iCal feeds (Google Calendar, iCal, Outlook, etc.)" %>
  </div>
  <div style="text-align: center; margin: 10px 2px 5px;">
  <input type="text" style="width: 330px;" class="calendar_feed_url"/><br/>
  <a href="#" class="show_calendar_feed_link"><%= t 'links.feed', "click here to view the feed" %></a>
  </div>
</div>
<% js_block do %>
  <script type="text/javascript">
    var managementContexts = <%= raw @contexts.select{|c| can_do(c, @current_user, :manage_calendar) }.map(&:asset_string).to_json %>;
    var canCreateEvent = managementContexts.length > 0;
    lastCalendarUpdate = "<%= ActiveSupport::TimeWithZone.new(Time.now, Time.zone).strftime("%Y-%m-%dT%H:%M:%S") %>";
  </script>
<% end %>

{'fraction_non_alphanumeric': 0.22162375668785234, 'fraction_numerical': 0.006283888110883694, 'mean_word_length': 3.6416666666666666, 'pattern_counts': {'":': 0, '<': 837, '<?xml version=': 0, '>': 919, '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': '4996380', 'n_tokens_mistral': 10158, 'n_tokens_neox': 9452, 'n_words': 1967}