Sha256: fe7dc7106186756515f689b7179c1c6ec90c0a675742c8a0d520d0af507cacfa

Contents?: true

Size: 976 Bytes

Versions: 43

Compression:

Stored size: 976 Bytes

Contents

<h1>New Page</h1>
<p>Parent: <%= @parent ? @parent.title : "Home" %></p>
<input type='hidden' id='parent_id' name='parent_id' value='<%= @parent_id %>' />
<p><input type='text' id='title' name='title' placeholder='Title' style="width: 400px;" /></p>
<p><input type='submit' value='Add Page' onclick='add_page();' /></p>

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

var modal = false;
$(document).ready(function() {
  modal = new CabooseModal(420);
});

function add_page()
{
  modal.autosize("<p class='loading'>Adding page...</p>");
  $.ajax({
    url: '/pages',
    type: 'post',
    data: {
      parent_id: $('#parent_id').val(),
      title: $('#title').val()
    },
    success: function(resp) {
      if (resp.error)
        modal.autosize("<p class='note error'>" + resp.error + "</p>");
      if (resp.redirect)
        parent.window.location = resp.redirect
    }
  });
}

</script>
<% end %>

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
caboose-cms-0.2.64 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.2.62 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.2.57 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.55 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.54 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.52 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.50 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.49 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.48 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.47 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.46 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.45 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.44 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.43 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.42 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.41 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.40 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.39 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.38 app/views/caboose/pages/new.html.erb
caboose-cms-0.2.37 app/views/caboose/pages/new.html.erb