Sha256: 304f9d069ae5023031d69d07e5893496a454a1aa41418197421bf5e5d5500916

Contents?: true

Size: 1.64 KB

Versions: 45

Compression:

Stored size: 1.64 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 ,
    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

45 entries across 45 versions & 1 rubygems

Version Path
caboose-cms-0.9.144 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.143 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.142 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.141 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.140 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.139 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.138 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.137 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.136 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.135 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.134 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.133 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.132 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.131 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.130 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.129 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.128 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.127 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.126 app/views/caboose/posts/admin_index.html.erb
caboose-cms-0.9.125 app/views/caboose/posts/admin_index.html.erb