Sha256: 476c7d844a73709a146afbde218195afc6bd926d3170c8cbf590e188acdb6ea3

Contents?: true

Size: 1.17 KB

Versions: 801

Compression:

Stored size: 1.17 KB

Contents

<%= render :partial => 'caboose/posts/admin_header' %>

<style type='text/css'>
#content input[type=checkbox] { position: relative; }
</style>

<% cat_ids = @post.post_categories.collect { |cat| cat.id } %>
<% @categories.each do |cat| %>
  <% checked = cat_ids.include?(cat.id) %>
  <p>
    <input type='checkbox' id='cat_<%= cat.id %>' value='<%= cat.id %>' <%= checked ? "checked='true'" : '' %> onchange="check_category(<%= @post.id %>, this.value);" /> 
    <label for="cat_<%= cat.id %>"><%= cat.name %></label>
  </p>
<% end %>

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

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

function check_category(post_id, cat_id)
{
  var checked = $('#cat_' + cat_id).is(':checked');   

  $.ajax({
    url: '/admin/posts/' + post_id + '/' + (checked ? 'add-to-category' : 'remove-from-category'),
    data: { post_category_id: cat_id },
    success: function(resp) {}
  });
}

var modal = false;
$(window).load(function() {
  modal = new CabooseModal(800);
});

</script>
<%= tinymce_assets %>
<%= tinymce :caboose, 'width'   => '575px', 'height'  => '240px' %>
<% end %>

Version data entries

801 entries across 801 versions & 1 rubygems

Version Path
caboose-cms-0.9.89 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.88 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.87 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.86 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.85 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.84 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.83 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.82 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.81 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.80 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.79 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.78 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.77 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.76 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.75 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.74 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.73 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.72 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.71 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.70 app/views/caboose/posts/admin_edit_categories.html.erb