Sha256: a7094dcc0ed80e3ff3bf61d3a98e7f2e3883911c1139c8c888becb647de54f3e

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

<%= render :partial => 'blog/admin/shared/post_tabs', :locals => {:current => "Categories"} %>

<div id="categories-box">
  <%= form_for([:admin, @post]) do |f| %>
    <fieldset>
      <legend><%= t('.manage_categories') %></legend>
      <table class="index">
        <% @post_categories.each_with_index do |category, index| -%>
          <tr id="<%= dom_id(category) %>" class="<%= index % 2 == 0 ? 'alt' : 'row' %>">
            <td>
              <%= check_box_tag "post[post_category_ids][]", category.id, @post.post_categories.include?(category), :id => "post_category_id_#{index}" -%>
              <%= label_tag "post_category_id_#{index}", category.name -%>
            </td>
            <td class="options" style="width: 120px">
              <%= link_to_with_icon('edit', t("edit"), edit_admin_post_category_url(@post, category.id)) %> &nbsp;
              <%= link_to_delete category, {:url => admin_post_category_url(@post, category.id)} %>
            </td>
          </tr>
        <% end -%>
      </table>
      <%= hidden_field_tag "post[post_category_ids][]", 0 %>
      <%= hidden_field_tag :redirect_to, request.fullpath %>
      <%= button t("update") %>
    </fieldset>
  <% end %>
</div>
  
<div id="new_category"></div>
  
<p><%= link_to icon('add') + ' ' + t("new_category"), new_admin_post_category_url(@post), :id => "btn_new_category" %></p>
  

<% content_for :head do %>
  <script type="text/javascript">
    jQuery(document).ready(function(){  
      
      jQuery('#btn_new_category').click(function (event) { 
        event.preventDefault();
        jQuery(this).hide();
        jQuery.ajax({type: 'GET', url: this.href, data: ({authenticity_token: AUTH_TOKEN}), success: function(r){ jQuery('#new_category').html(r);} });
      });
      
    });
  </script>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_essential_blog-0.1.0 app/views/blog/admin/post_categories/index.html.erb
spree_essential_blog-0.1.0.rc1 app/views/blog/admin/post_categories/index.html.erb