Sha256: dfaeb28ef89420e7c8b8d6ce337e2a2c79e26ff88c0132c2ac51e39ae2b526a1

Contents?: true

Size: 1.92 KB

Versions: 2

Compression:

Stored size: 1.92 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)}
  .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

2 entries across 2 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.5 app/views/comfy/admin/cms/pages/_index_branch.html.haml
comfortable_mexican_sofa-2.0.4 app/views/comfy/admin/cms/pages/_index_branch.html.haml