Sha256: 9f97b7827df5f70340fa4d67e11dabd06f308cbee8ef9c640bd42d44a131de0a

Contents?: true

Size: 1.35 KB

Versions: 9

Compression:

Stored size: 1.35 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_css do %>
<style>
  #content2 p input[type="checkbox"] {
    top: 10px;
    margin-right: 5px;
  }
  #content2 > p {
    margin: 0 0 5px 0;
  }
</style>
<% end %>

<% 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

9 entries across 9 versions & 1 rubygems

Version Path
caboose-cms-0.9.108 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.107 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.106 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.105 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.104 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.103 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.102 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.101 app/views/caboose/posts/admin_edit_categories.html.erb
caboose-cms-0.9.100 app/views/caboose/posts/admin_edit_categories.html.erb