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