Sha256: 187ae2da436ad033df847732cc103b14ebd56756f1103018c75483cfe0eb4ff2

Contents?: true

Size: 860 Bytes

Versions: 6

Compression:

Stored size: 860 Bytes

Contents

- read        ||= false
- categories  = [params[:categories]].flatten.compact
- active      = categories.flatten.member?(category.label)

.category{id: dom_id(category)}
  - if read
    - active_class = active ? "active" : nil
    - categories = active ? categories.reject{|c| c == category.label} : categories << category.label
    = link_to category.label, {categories: categories}, class: "btn btn-sm btn-light btn-block text-left text-truncate #{active_class}"
  - else
    .btn-group.d-flex
      = link_to category.label, edit_comfy_admin_cms_site_category_path(@site, category), remote: true, class: "btn btn-sm btn-light w-100 text-left text-truncate"
      = link_to comfy_admin_cms_site_category_path(@site, category), method: :delete, remote: true, data: {confirm: t('.are_you_sure')}, class: 'btn btn-sm btn-danger' do
        %i.fas.fa-fw.fa-times

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.9 app/views/comfy/admin/cms/categories/_show.html.haml
comfortable_mexican_sofa-2.0.8 app/views/comfy/admin/cms/categories/_show.html.haml
comfortable_mexican_sofa-2.0.7 app/views/comfy/admin/cms/categories/_show.html.haml
comfortable_mexican_sofa-2.0.6 app/views/comfy/admin/cms/categories/_show.html.haml
comfortable_mexican_sofa-2.0.5 app/views/comfy/admin/cms/categories/_show.html.haml
comfortable_mexican_sofa-2.0.4 app/views/comfy/admin/cms/categories/_show.html.haml