<% @top_content_frames.each.with_index do |top_content_frame, count| %>
  <% if top_content_frame.expression_flag == 1 %>
(表示) <%= link_to "[変更]", :action => :change_expression, :id => top_content_frame.id, :expression => 0 %>
  <% else %>
(非表示) <%= link_to "[変更]", :action => :change_expression, :id => top_content_frame.id, :expression => 1 %>
  <% end %>
<br />
  [ID: <%= top_content_frame.id %>]　<%= top_content_frame.title %>
  <%= link_to "編集", { :action => 'edit_page', :id => top_content_frame.id } %><br />
  + <%= link_to "サブページの追加", { :action => 'add_subpage',
                                      :id => top_content_frame.id} %><br />
  <% sub_content_frames =
          ContentFrame
          .where(:master_frame => top_content_frame.id)
          .order("content_frame_order ASC") -%>
  <% if sub_content_frames.length > 0 -%>
    <% sub_content_frames.each.with_index do |sub_content_frame, count_sub| -%>
      [ID: <%= sub_content_frame.id %>]  <%= sub_content_frame.title %>
      <span>
        <%= link_to "編集", { :action => 'edit_page', :id => sub_content_frame.id } %>
      </span>
      <span data-turbo="true">
        <%= link_to "削除", { :action => 'delete_page', :id => sub_content_frame.id },
                               data: { turbo_method: "delete", turbo_confirm: "削除します。よろしいですか?" } %>
        <%#= link_to '[削除]', {action: 'destroy', id: announcement.id},
                               class: 'delete',
                               data: { turbo_method: "delete", turbo_confirm: "削除します。よろしいですか?" } -%>
      </span>
      <br />
    <% end -%>
  <% end -%>
  <br />
<% end -%>
