%remote_form_for @event, :url => {:action => :update} , :before => "$('#updating_events').show();", :complete => "$('#updating_events').hide();" do |f| %>
<%=f.label :title, "Titulo" %>
<%=f.text_field :title %>
<%=f.label :description, "Descripcion" %>
<%=f.text_area :description, :rows => 4, :cols => 30 %>
<%=f.label :starttime, 'Inicio' %>
<%=f.datetime_select :starttime, :minute_step => 30 %>
<%=f.label :endtime, 'Fin' %>
<%=f.datetime_select :endtime, :minute_step => 30 %>
<%=f.label :all_day, "Todo el día" %> <%=f.check_box :all_day %>
<% #if @event.calendar_event_series %> <%period = (@event.calendar_event_series)?@event.calendar_event_series.period : nil -%><%=f.label :period, "Repetir" %> <%=f.select :period, CalendarEvent::REPEATS,{:selected => period}, :onchange => "showPeriodAndFrequency(this.value);" %>
<%frequency = (@event.calendar_event_series)?@event.calendar_event_series.frequency : nil -%><%=f.label :frequency, "Repetir cada" %> <%=f.select :frequency, (1..30).to_a, {:selected => frequency} %>
<%=f.label :starttime, 'Repetir hasta' %>
<%= select_date Date.current, :prefix => :repeat_until, :order => [:year, :month, :day] %>
<%if @event.calendar_event_series -%> <%=f.submit 'Actualizar solo esta instancia', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%> <%=f.submit 'Actualizar todas las instancias', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%> <%=f.submit 'Actualizar todas las instancias siguientes', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%> <%else-%> <%=f.submit 'Guardar', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%> <%end-%>
<%end %>