Sha256: 87d0bdbbcc013607c5092f5300356dc3dc79a3ff0811b0d6f0d2358992df17c5

Contents?: true

Size: 1.62 KB

Versions: 12

Compression:

Stored size: 1.62 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_comfy_admin_cms_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.btn-group-sm
      = link_to t('.add_child_page'), new_comfy_admin_cms_site_page_path(@site, :parent_id => page.id), :class => 'btn btn-default'
      = link_to t('.edit'), edit_comfy_admin_cms_site_page_path(@site, page), :class => 'btn btn-default'
      = link_to t('.delete'), comfy_admin_cms_site_page_path(@site, page), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-danger'
      
    .item-content
      .item-title
        = link_to page.label, edit_comfy_admin_cms_site_page_path(@site, page), :class => 'item-label'
        = render :partial => 'comfy/admin/cms/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

12 entries across 12 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.12.11 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.10 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.9 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.8 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.7 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.6 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.5 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.4 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.3 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.2 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.1 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-1.12.0 app/views/comfy/admin/cms/pages/_index_branch.html.haml