<% @toolbar_title = @page_title = "Add Existing Content to '#{@page.page_title}' Page" %> <% content_for :html_head do %> <%= stylesheet_link_tag("cms/content_library") %> <% javascript_tag do %> jQuery(function($){ var collectionName = '<%= @block_type.content_block_type %>' $('table.data tbody tr').hover(function(){ $(this).addClass('hover'); }, function(){ $(this).removeClass('hover'); }).click(function(){ var match = this.id.match(/(.*)_(\d+)/); var type = match[1]; var id = match[2]; $('table.data tbody tr').removeClass('selected'); $(this).addClass('selected'); $('#connectable_type').attr('value', type); $('#connectable_id').attr('value', id); $('#add_button').removeClass('disabled').click(function(){ $('#connect_form').submit(); return false; }); $('#view_button').removeClass('disabled').attr('href', '/cms/'+collectionName+'/'+id); }) }) <% end %> <% end %> <% content_for :functions do %>

<%=h @toolbar_title %>

<%= link_to span_tag("Add to Page"), "#", :id => "add_button", :class => "button disabled" %> <%= link_to span_tag("View Content"), "#", :id => "view_button", :class => "button disabled" %> <% form_tag cms_connectors_path, :id => 'connect_form' do %> <%= hidden_field_tag :page_id, @page.to_param %> <%= hidden_field_tag :container, @container %> <%= hidden_field_tag :connectable_type, '' %> <%= hidden_field_tag :connectable_id, '' %> <% end %>
<% end %> <% form_tag new_cms_connector_path, :method => :get do %> <%= hidden_field_tag :page_id, @page.to_param %> <%= hidden_field_tag :container, @container %>
<% end %> <%= error_messages_for :connector %> <% @blocks.each do |block| %> <% end %>
Name
Updated
Uses
<%= block.name %> <%= block.updated_at.to_formatted_s(:date) %> <%= link_to_usages(block) %>