Sha256: 99063a4c83282d59ad370e2c73f38148ce5dce7a3a696a06da8a148022631484

Contents?: true

Size: 1.67 KB

Versions: 86

Compression:

Stored size: 1.67 KB

Contents

<h1>Posts</h1>
<div id='posts'></div>

<% content_for :caboose_css do %>
<style>
  table.data {margin-right: 30px;}
</style>
<% end %>

<% content_for :caboose_js do %>
<%= javascript_include_tag 'caboose/model/all' %>
<script type='text/javascript'>

$(document).ready(function() {  
  var that = this;
  var table = new IndexTable({    
    form_authenticity_token: '<%= form_authenticity_token %>',
    container: 'posts',
    base_url: '/admin/posts',
    allow_bulk_import:   false ,
    allow_bulk_edit:     false ,
    allow_bulk_delete:   false ,
    allow_duplicate:     false ,
    allow_advanced_edit: true ,
    after_add: 'redirect',
    fields: [
      { show: true , bulk_edit: false , name: 'title'        , nice_name: 'Title'        , sort: 'title'        , type: 'text'     , value: function(p) { return p.title                                     }, width: 300, editable: false },
      { show: true , bulk_edit: false , name: 'published'    , nice_name: 'Published'    , sort: 'published'    , type: 'checkbox' , value: function(p) { return p.published ? 'Yes' : 'No'                  }, width: 100, editable: false },
      { show: true , bulk_edit: false , name: 'created_at'   , nice_name: 'Date Created' , sort: 'created_at'   , type: 'date'     , value: function(p) { return new Date(p.created_at).toLocaleDateString() }, width: 100, editable: false },
    ],
    new_model_text: 'New Post',
    no_models_text: 'There are no posts right now.',
    new_model_fields: [
      { name: 'title', nice_name: 'Title', type: 'text', width: 400 }
    ],
    search_fields: [
      { name: 'title_like', nice_name: 'Title' , type: 'text', width: 400 },
    ],
  });
});

</script>
<% end %>

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/views/caboose/posts/admin_index.html.erb
caboose-cms-1.0.2 app/views/caboose/posts/admin_index.html.erb
caboose-cms-1.0.1 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.228 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.227 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.226 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.225 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.224 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.223 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.222 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.221 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.220 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.219 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.218 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.217 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.216 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.215 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.214 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.213 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.212 app/views/caboose/posts/admin_index.html.erb