Sha256: 4f4d91adf5b194cd517fe8ff27c6d877635c5d15b530d6d307cb3a5188a118f0

Contents?: true

Size: 1.6 KB

Versions: 665

Compression:

Stored size: 1.6 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.includes(:block_type_site_memberships).where("block_type_category_id in (?) and block_type_site_memberships.site_id = ?", cat_ids, @site.id).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

665 entries across 665 versions & 1 rubygems

Version Path
caboose-cms-0.9.149 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.148 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.147 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.146 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.145 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.144 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.143 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.142 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.141 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.140 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.139 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.138 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.137 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.136 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.135 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.134 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.133 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.132 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.131 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.9.130 app/views/caboose/pages/admin_new.html.erb