Sha256: ee2435b588618d33039b2954f6c1d21cc572cae2251c4af0224cce065db84d92

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

<h1>New Event</h1>       

<form action='/admin/calendars/<%= @calendar.id %>' method='post' id='new_event_form'>
  <input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>'>
  <input type='hidden' name='begin_date' value='<%= @begin_date.strftime('%Y-%m-%d') %>'>
  <p><input type='text' name='name' id='name'       placeholder='Name' style='width: 500px;'></p>    
  <div id='message'></div>
  <p>
    <input type='button' value='Cancel' onclick="modal.close();" />
    <input type='submit' value='Add New Event' onclick="add_event(); return false;" />
  </p>
</form>

<% content_for :caboose_js do %>
<%= javascript_include_tag "caboose/model/all" %>
<script type="text/javascript">

$(window).load(function() {
  modal = new CabooseModal(600);
});

function add_event()
{  
  $('#message').html("<p class='loading'>Adding event...</p>");
  $.ajax({
    url: '/admin/calendars/<%= @calendar.id %>/events',
    type: 'post',
    data: $('#new_event_form').serialize(),
    success: function(resp) {
      if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
      if (resp.redirect) window.location = resp.redirect;
    }
  });
}

</script>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caboose-cms-0.4.110 app/views/caboose/events/admin_new.html.erb