Sha256: 60c89d35e4e5b4f1ed4017e7000a601246044d0e1b27880e7622a1f6cffa95f0

Contents?: true

Size: 1.58 KB

Versions: 11

Compression:

Stored size: 1.58 KB

Contents

- page        ||= index_branch
- children      = @pages_by_parent[page.id]
- siblings      = @pages_by_parent[page.parent_id]
- has_children  = children.present?
- has_siblings  = siblings.size > 1
- branch_open   = (session[:cms_page_tree] || []).member?(page.id.to_s) || page.root?
- category_view = params[:category].present?

%li{:id => dom_id(page)}
  .item
    .toggle{:class => branch_open ? 'open' : nil}
      - if !category_view && has_children && !page.root?
        = link_to toggle_branch_cms_admin_site_page_path(@site, page), :remote => true do
          %span= t('.toggle')
        
    .icon{:class => page.is_published?? 'published' : 'draft'}
      - if !category_view && has_siblings
        .dragger
          %span ⇅
          
    .btn-group
      = link_to t('.add_child_page'), new_cms_admin_site_page_path(@site, :parent_id => page.id), :class => 'btn btn-small'
      = link_to t('.edit'), edit_cms_admin_site_page_path(@site, page), :class => 'btn btn-small'
      = link_to t('.delete'), cms_admin_site_page_path(@site, page), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-small btn-danger'
      
    .item-content
      .item-title
        = link_to page.label, edit_cms_admin_site_page_path(@site, page), :class => 'item-label'
        = render :partial => '/cms_admin/categories/categories', :object => page
      .item-meta
        = link_to page.url, page.url, :target => '_blank'
        
  - if !category_view && has_children && branch_open
    %ul.children.sortable
      = render :partial => 'index_branch', :collection => children

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
comfortable_mexican_sofa-1.9.3 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.9.2 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.5 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.9.1 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.9.0 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.4 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.3 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.2 app/views/cms_admin/pages/_index_branch.html.haml
comfypress-0.1.3 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.1 app/views/cms_admin/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.8.0 app/views/cms_admin/pages/_index_branch.html.haml