Sha256: 705d71a4460315620a7574b1b8edbed54a24ed65f9456082d4bc1fee8f9a96bd

Contents?: true

Size: 1.6 KB

Versions: 129

Compression:

Stored size: 1.6 KB

Contents

<%
p = @product
%>
<%= render :partial => 'caboose/products/admin_header' %>

<div id='product_<%= p.id %>_category_id'></div>

<%= render :partial => 'caboose/products/admin_footer' %>

<% content_for :caboose_css do %>
<style type='text/css'>
#content table.data input[type='checkbox'] { position: relative; margin: 0; padding: 0; }
#content table.data td { padding: 0 10px !important; }
label span.prefix { display: inline-block; margin: 0 8px; }
</style>
<% end %>
<% content_for :caboose_js do %>
<script type='text/javascript'>

var mb = false;
$(document).ready(function() {
    
  // add_to_crumbtrail('/admin', 'Admin');
  // add_to_crumbtrail('/admin/products', 'Products');  
  // add_to_crumbtrail('/admin/products/<%= p.id %>', <%= raw Caboose.json(p.title) %>);
  // add_to_crumbtrail('/admin/products/<%= p.id %>/categories', 'Categories');
  
  mb = new ModelBinder({
    name: 'Product',
    id: <%= p.id %>,
    update_url: '/admin/products/<%= p.id %>',
    authenticity_token: '<%= form_authenticity_token %>',
    attributes: [
      {
        name: 'category_id',
        nice_name: 'Categories',
        type: 'checkbox-multiple',        
        options_url: '/admin/categories/options',
        value: <%= raw Caboose.json(p.categories.collect{ |cat| cat.id }) %>,        
        fixed_placeholder: false,
        width: 400        
      }
    ],
    on_load: function() {
      setTimeout(function() {
        $('label').each(function(i, el) {
          $(el).html($(el).html().replace(/-/g, "<span class='prefix'>-</span>"));
        });      
      }, 400);          
    }    
  });  
});

</script>
<% end %>

Version data entries

129 entries across 129 versions & 1 rubygems

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