Sha256: db22dc42fe842b768d42445420148d17f9da0491dce8b0608b29984f72440eb2

Contents?: true

Size: 1.36 KB

Versions: 9

Compression:

Stored size: 1.36 KB

Contents

<% 
  page        ||= index_branch 
  has_children  = page.children.present?
  has_siblings  = page.siblings.present?
  branch_open   = (session[:cms_page_tree] || []).member?(page.id.to_s) || page.root?
%>

<li id='<%= dom_id(page) %>'>
  <div class='item'>
    <div class='toggle <%= 'open' if branch_open %>'>
      <%= 
        if has_children && !page.root?
          link_to span_tag(t('.toggle')), toggle_branch_cms_admin_site_page_path(@site, page), :remote => true
        end
      %>
    </div>
    <div class='icon'>
      <% if has_siblings %>
        <div class='dragger'><span><%= t('cms.views.pages.drag') %></span></div>
      <% end %>
    </div>
    <div class='action_links'>
      <%= link_to t('.add_page'), new_cms_admin_site_page_path(@site, :parent_id => page.id) %>
      <%= link_to t('.edit'), edit_cms_admin_site_page_path(@site, page) %>
      <%= link_to t('.delete'), cms_admin_site_page_path(@site, page), :method => :delete, :confirm => t('.are_you_sure') %>
    </div>
    <div class='label'>
      <%= link_to page.label, edit_cms_admin_site_page_path(@site, page) %>
      <div class='sublabel'>
        <%= link_to page.url, page.full_path, :target => '_blank' %>
      </div>
    </div>
  </div>
  <% if has_children && branch_open %>
    <ul>
      <%= render :partial => 'index_branch', :collection => page.children %>
    </ul>
  <% end %>
</li>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.3.8 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.7 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.6 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.5 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.4 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.3 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.2 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.1 app/views/cms_admin/pages/_index_branch.html.erb
comfortable_mexican_sofa-1.3.0 app/views/cms_admin/pages/_index_branch.html.erb