<commit_before><% content_for :sidebar do %>
	<% fields_for :calendar_event, @event do |f| -%>
		<%= render :partial => 'options', :locals => {:f => f} %>
	<% end %>
<% end %>

<fieldset class="clearfix">
<p>
  <%= form.label :title, t(:'adva.calendar.attributes.title') %>
  <%= form.text_field :title %>
</p>

<p>
  <%= form.label :host, t(:'adva.calendar.attributes.host') %>
  <%= form.text_field :host %>
</p>

<p>
  <%= form.label :startdate, t(:'adva.calendar.attributes.startdate') %>
  <%= form.text_field :startdate, :value => @event.startdate.localtime.rfc2822 %><br />
  <label>
  <%= form.check_box :all_day %> <%= t(:'adva.calendar.attributes.all_day') %>
  </label>
</p>

<p>
  <%= form.label :enddate, t(:'adva.calendar.attributes.enddate') %>
  <%= form.text_field :enddate, :value => @event.enddate.localtime.rfc2822 %>
</p>

<p>
  <%= form.label :body, t(:'adva.calendar.attributes.body') %>
  <%= form.text_area :body %>
</p>
<p>
  <%= form.label :tag_list, t(:'adva.calendar.attributes.tags') %>
  <%= form.text_field :tag_list %>
  <span class="hint"><%= t(:'adva.common.hints.tags') %></span>  
</p>

<% if @site.locations.count > 0 %>
<p>
  <%= form.label :location, t(:'adva.calendar.attributes.location') %>
  <%= form.select :location_id, @site.locations.collect{|l| [l.oneliner, l.id]}, :include_blank => t(:'adva.calendar.links.create_new_location') %>
</p>
<% end %>
<fieldset id="new_location" style="<%= @event.location_id.blank? ? "" : "display:none" %>">
<% fields_for :location do |f_l| %>
  <%= render :partial => 'form_location', :locals => {:form => f_l} %>
<% end %>
</fieldset>


<%= form.label :draft, t(:'adva.calendar.question_save_as_draft') %>
<label class="light">
  <%= check_box_tag :draft, '1', @event.draft?, :id => 'calendar-event-draft' %> <%= t(:'adva.calendar.confirm_save_as_draft') %>
</label>

<p id="publish-date" style="<%= @event.draft? ? "display:none" : "" %>">
  <%= form.label :published_at, t(:'adva.calendar.publish_on_date') %>
  <%= form.datetime_select :published_at,
                        :start_year => (@event.published_at || Time.zone.now).year-1,
                        :end_year => (Time.zone.now.year + 5),
                        :order => [:month, :day, :year] %>
</p>
</fieldset><commit_msg>fixing bug on new calendar events with an empty enddate<commit_after><% content_for :sidebar do %>
	<% fields_for :calendar_event, @event do |f| -%>
		<%= render :partial => 'options', :locals => {:f => f} %>
	<% end %>
<% end %>

<fieldset class="clearfix">
<p>
  <%= form.label :title, t(:'adva.calendar.attributes.title') %>
  <%= form.text_field :title %>
</p>

<p>
  <%= form.label :host, t(:'adva.calendar.attributes.host') %>
  <%= form.text_field :host %>
</p>

<p>
  <%= form.label :startdate, t(:'adva.calendar.attributes.startdate') %>
  <%= form.text_field :startdate, :value => @event.startdate.localtime.rfc2822 %><br />
  <label>
  <%= form.check_box :all_day %> <%= t(:'adva.calendar.attributes.all_day') %>
  </label>
</p>

<p>
  <%= form.label :enddate, t(:'adva.calendar.attributes.enddate') %>
  <%= form.text_field :enddate, :value => (@event.enddate ? @event.enddate.localtime.rfc2822 : '') %>
</p>

<p>
  <%= form.label :body, t(:'adva.calendar.attributes.body') %>
  <%= form.text_area :body %>
</p>
<p>
  <%= form.label :tag_list, t(:'adva.calendar.attributes.tags') %>
  <%= form.text_field :tag_list %>
  <span class="hint"><%= t(:'adva.common.hints.tags') %></span>  
</p>

<% if @site.locations.count > 0 %>
<p>
  <%= form.label :location, t(:'adva.calendar.attributes.location') %>
  <%= form.select :location_id, @site.locations.collect{|l| [l.oneliner, l.id]}, :include_blank => t(:'adva.calendar.links.create_new_location') %>
</p>
<% end %>
<fieldset id="new_location" style="<%= @event.location_id.blank? ? "" : "display:none" %>">
<% fields_for :location do |f_l| %>
  <%= render :partial => 'form_location', :locals => {:form => f_l} %>
<% end %>
</fieldset>


<%= form.label :draft, t(:'adva.calendar.question_save_as_draft') %>
<label class="light">
  <%= check_box_tag :draft, '1', @event.draft?, :id => 'calendar-event-draft' %> <%= t(:'adva.calendar.confirm_save_as_draft') %>
</label>

<p id="publish-date" style="<%= @event.draft? ? "display:none" : "" %>">
  <%= form.label :published_at, t(:'adva.calendar.publish_on_date') %>
  <%= form.datetime_select :published_at,
                        :start_year => (@event.published_at || Time.zone.now).year-1,
                        :end_year => (Time.zone.now.year + 5),
                        :order => [:month, :day, :year] %>
</p>
</fieldset>
{'fraction_non_alphanumeric': 0.2393755420641804, 'fraction_numerical': 0.005203816131830009, 'mean_word_length': 3.9978331527627304, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 153, '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': '5525020', 'n_tokens_mistral': 1901, 'n_tokens_neox': 1736, 'n_words': 295}