Sha256: 1a07d04221b294ca3a8117609b73eccfa80f46d23b5d302094d47e0bdaa1306f

Contents?: true

Size: 1.51 KB

Versions: 139

Compression:

Stored size: 1.51 KB

Contents

<h1>New Page</h1>
<p>Parent: <%= @parent ? @parent.title : "Home" %></p>

<form action='/admin/pages' method='post' id='new_page_form' onsubmit="add_page(); return false;">
<input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>' />
<input type='hidden' name='parent_id' value='<%= @parent_id %>' />
<p><input type='text' name='title' placeholder='Title' style="width: 400px;" /></p>
<p><select name='block_type_id'>
  <option value=''>-- Select a layout --</option>
  <% cat_ids = Caboose::BlockTypeCategory.layouts.collect{ |cat| cat.id } %>
  <% Caboose::BlockType.where("block_type_category_id in (?)", cat_ids).reorder(:description).all.each do |bt| %>
    <option value="<%= bt.id %>"><%= bt.description %></option>
  <% end %>
</select></p>
<div id='message'></div>
<p>
<input type='button' value='< Back' onclick="window.location='/admin/pages';" />
<input type='submit' value='Add Page' />
</p>
</form>

<% 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: '/admin/pages',
    type: 'post',
    data: $('#new_page_form').serialize(),    
    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

139 entries across 139 versions & 1 rubygems

Version Path
caboose-cms-0.4.144 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.143 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.142 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.141 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.140 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.139 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.138 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.137 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.136 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.135 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.134 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.133 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.132 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.131 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.130 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.129 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.128 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.127 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.126 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.125 app/views/caboose/pages/admin_new.html.erb