Sha256: 2be520c3db0e5957db6a08404ddcae560760cca19fb7b8c3da7f89a292e2ebe0

Contents?: true

Size: 1.94 KB

Versions: 27

Compression:

Stored size: 1.94 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[:categories].present?

%li{id: dom_id(page), data: {id: page.id}}
  .row

    .col-md-6.item
      - unless category_view
        .item-controls
          - if has_siblings
            .dragger.d-none.d-md-block
              %i.fas.fa-bars

          - if has_children && !page.root?
            - status = branch_open ? "open" : ""
            - url = toggle_branch_comfy_admin_cms_site_page_path(@site, page)
            = link_to url, remote: true, title: t(".toggle"), class: "toggle #{status}" do
              %i.fas.fa-plus-square.expand
              %i.fas.fa-minus-square.collapse

      .item-content
        .item-title
          - published_css_class = page.is_published? ? "published" : "draft"
          = link_to page.label, edit_comfy_admin_cms_site_page_path(@site, page), class: published_css_class
        .item-meta
          = link_to page.url, page.url, target: "_blank"

    .col-md-2.item-categories.d-flex.align-items-center
      = render "comfy/admin/cms/categories/categories", object: page

    .col-md-4.d-flex.align-items-center.justify-content-md-end
      .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-outline-secondary"
        = link_to t(".edit"), edit_comfy_admin_cms_site_page_path(@site, page), class: "btn btn-outline-secondary"
        = link_to t(".delete"), comfy_admin_cms_site_page_path(@site, page), method: :delete, data: {confirm: t('.are_you_sure')}, class: "btn btn-danger"

  - if !category_view && has_children && branch_open
    %ul.list.children.sortable.pl-md-3
      = render partial: "index_branch", collection: children

Version data entries

27 entries across 27 versions & 7 rubygems

Version Path
comfortable_media_surfer-3.1.1 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_media_surfer-3.1.0 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_media_surfer-3.0.0 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.19 app/views/comfy/admin/cms/pages/_index_branch.html.haml
PixelForce_ETS-0.0.2 app/views/comfy/admin/cms/pages/_index_branch.html.haml
PixelForce_ETS-0.0.1 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest2-0.0.4 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest2-0.0.3 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest2-0.0.2 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest2-0.0.1 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest-0.0.1 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcyEtsTest-2.2.19 app/views/comfy/admin/cms/pages/_index_branch.html.haml
ComfortableMexicanSofa-2.0.18 app/views/comfy/admin/cms/pages/_index_branch.html.haml
kcy1-1.0 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.18 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.17 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.16 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.15 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.14 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.13 app/views/comfy/admin/cms/pages/_index_branch.html.haml