Sha256: 78cba9340b44a5beda8defc4afc2b9b9789fd528f78b0ae2dec88e849b5fefcb

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 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('.tabs'), cms_admin_site_page_tabs_path(@site, page), :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

1 entries across 1 versions & 1 rubygems

Version Path
comfypress-0.1.4 app/views/cms_admin/pages/_index_branch.html.haml