Sha256: 4c21dd1cb90c39db956d85b1d98b4b97ae5a4f0476218134878811c49bf8ae76

Contents?: true

Size: 1.59 KB

Versions: 159

Compression:

Stored size: 1.59 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

159 entries across 159 versions & 1 rubygems

Version Path
caboose-cms-0.9.101 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.100 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.99 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.98 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.97 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.96 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.95 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.94 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.93 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.92 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.91 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.90 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.89 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.88 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.87 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.86 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.85 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.84 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.83 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.82 app/views/caboose/products/admin_edit_categories.html.erb