Sha256: 6ac4bf67506c4d280467dc2bbf8a7f9c766b0aed1cc39ed6abcc079d6d235a58

Contents?: true

Size: 885 Bytes

Versions: 942

Compression:

Stored size: 885 Bytes

Contents

<h1>New Post</h1>

<p><input type='text' id='title' name='title' placeholder='Title' style="width: 400px;" /></p>
<div id='message'></div>
<p><input type='submit' value='Add Post' onclick='add_post();' /></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_post()
{
  modal.autosize("<p class='loading'>Adding post...</p>");
  $.ajax({
    url: '/admin/posts',
    type: 'post',
    data: {
      authenticity_token: "<%= form_authenticity_token %>",
      title: $('#title').val(),
    },
    success: function(resp) {
      if (resp.error)
        modal.autosize("<p class='note error'>" + resp.error + "</p>");
      if (resp.redirect)
        window.location = resp.redirect
    }
  });
}

</script>
<% end %>

Version data entries

942 entries across 942 versions & 1 rubygems

Version Path
caboose-cms-0.9.170 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.169 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.168 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.167 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.166 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.165 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.164 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.163 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.162 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.161 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.160 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.159 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.158 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.157 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.156 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.155 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.154 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.153 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.152 app/views/caboose/posts/admin_new.html.erb
caboose-cms-0.9.151 app/views/caboose/posts/admin_new.html.erb