Sha256: 0ef8f094d75c58a5b0df9b67ef28267c3033c6e8f42634388c2941ad54862c9c

Contents?: true

Size: 1.56 KB

Versions: 5

Compression:

Stored size: 1.56 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| %>
    <% next if bt.site_id && bt.site_id != @site.id %>
    <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

5 entries across 5 versions & 1 rubygems

Version Path
caboose-cms-0.4.149 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.148 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.147 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.146 app/views/caboose/pages/admin_new.html.erb
caboose-cms-0.4.145 app/views/caboose/pages/admin_new.html.erb