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.81 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.80 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.79 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.78 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.77 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.76 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.75 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.74 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.73 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.72 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.71 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.70 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.69 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.68 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.67 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.66 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.65 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.64 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.63 app/views/caboose/products/admin_edit_categories.html.erb
caboose-cms-0.9.62 app/views/caboose/products/admin_edit_categories.html.erb