<%= javascript_include_tag 'jquery.base64' %> <% if @event.errors.any? %>

<%= pluralize(@event.errors.count, "error") %> prohibited this event from being saved:

<% end %> <% locales = Site.first.in_use_locales rescue I18n.available_locales locales = [I18n.locale] + (locales - [I18n.locale]) %>
<%= f.label t("title"), :class=>"control-label" %>
<% locales.each_with_index do |locale, i| %> <%= f.fields_for :title_translations, f.object do |f| %>
" id="title_translations_<%= locale %>"> <% title = f.object.title(locale) %>
<%= title.to_s.html_safe %>
<%= hidden_field_tag "#{f.object_name}[#{locale}]", title %>
<% end %> <% end %>
<% locales.each_with_index do |locale, i| %> " href="#title_translations_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<%= f.label t("calendar.note"), :class=>"control-label" %>
<% locales.each_with_index do |locale, i| %> <%= f.fields_for :note_translations, f.object do |f| %>
" id="note_translations_<%= locale %>"> <% note = f.object.note(locale) %>
<%= note.to_s.html_safe %>
<%= hidden_field_tag "#{f.object_name}[#{locale}]", note %>
<% end %> <% end %>
<% locales.each_with_index do |locale, i| %> " href="#note_translations_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<%= f.label t("url"), :class=>"control-label" %>
<% locales.each_with_index do |locale, i| %> <%= f.fields_for :url_translations, f.object do |f| %>
" id="note_translations_<%= locale %>"> <% url = f.object.url(locale) %> <%= text_field_tag "#{f.object_name}[#{locale}]", url %>
<% end %> <% end %>
<% locales.each_with_index do |locale, i| %> " href="#url_translations_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<% data_format = @all_day ? 'yyyy/MM/dd' : 'yyyy/MM/dd hh:mm' %>
<%= f.label t("start_date"), :class=>"control-label" %> <%#= f.datetime_select :start %>
<%= f.datetime_picker :start, :class => "input-large", data: {"fv-validation" => "required;","fv-messages" => "Cannot be empty;"}, :placeholder => data_format, :new_record => false, :format => data_format %>
<%= f.label t("end_date"), :class=>"control-label" %> <%#= f.datetime_select :end %>
<%= f.datetime_picker :end, :class => "input-large", :placeholder => data_format, :new_record => false, :format=> data_format %>
<%= f.label t("calendar.calendar"), :class=>"control-label" %>
<%= f.select :calendar_type_id, @categories.collect{|t| [ t.title, t.id ]} %>
<%= select_tags(f, @module_app) %>
>
<%=f.label :period, t("calendar.repeats"),:class=>"control-label", :for => "event_period" %>
<%=f.select :period, Event::REPEATS.map{|v| [t("calendar.#{v.downcase}"),v]},{},:class=>"span5",:id => "event_period" %>
<%=f.label :frequency, "Every",:class=>"control-label" %>
<%=f.select :frequency, (1..30).to_a,{},:class=>"span2" %>
<%=f.label :is_weekdays, t("calendar.type") ,:class=>"control-label", :for => "event_is_weekdays" %>
<%=f.select :is_weekdays, options_for_select(['custom', 'weekdays'].map.with_index{|v, i| [t("calendar.#{v}"), i.to_s]}, f.object.is_weekdays ? '1' : '0'),{},:class=>"span5",:id=>"event_is_weekdays" %>
<% weekdays = f.object.weekdays if f.object.new_record? && f.object.start weekdays = [f.object.start.wday] end tmp_html = [] %> <% (0...7).each do |i| %> <% tmp = f.check_box_tag "#{f.object_name}[weekdays][]", i, weekdays.include?(i), {:class=>"weekdays-checkbox", :"data-key"=>i} tmp += t("calendar.short_day.#{i}") tmp_html << tmp %> <% end %> <% unless (CalendarSetting.first.sunday_first rescue false) tmp_html.rotate!(1) end %> <%= tmp_html.join("\n").html_safe %>
<%= f.label t("calendar.recurring_end_date"), :class=>"control-label" %>
<%= f.datetime_picker :recurring_end_date, :class => "input-large", :placeholder => data_format, :new_record => false, :format => data_format %>
<% if action_name == "edit" %> <%= f.button t("calendar.save"),:type=> 'button', :class=>"btn btn-primary", :onclick => 'before_submit(this)' %> <% else %> <%= f.button t(:create_),:type=> 'button', :class=>"btn btn-primary", :onclick => 'before_submit(this)' %> <% end %> Cancel