Sha256: 2e3159b3008e4c91389fe3a662e03f2c1f73e9b0df67831dc762c2abe42b4f9e

Contents?: true

Size: 1.71 KB

Versions: 10

Compression:

Stored size: 1.71 KB

Contents

:ruby
  def p_recursive_navi(navis, current_level = 0, max_level = 99, ul = 'ul', first_wrap = '')
    a = "\n <#{ul}#{first_wrap}>\n"
    navis.each do |navi|
      x = link_to 'edit', edit_entry_path('navigation', navi), class: 'edit icon'
      y = link_to 'delete', entry_path('navigation', navi), method: :delete, confirm: t('bhf.helpers.promts.confirm'), class: 'delete icon'
      a += " <li id='navigation_#{navi.id}'><div><span class='title'>#{navi.title}</span> <span class='links'>#{x} #{y}</span></div>"
      if current_level <= max_level and navi.children.any?
        a += p_recursive_navi(navi.children, current_level+1, max_level, ul)
      end
      a += "</li> "
    end
    a += "</#{ul}> "
  end
  

%table.navigation_capiton.data_table{id: "#{platform.name}_platform", class: (platform.custom_columns? ? :custom_columns : :default_columns)}
  %caption
    %h4= platform.title
    %p.info= t('ksk.navigation_sort.info')
    - unless platform.hide_create
      %p.create= link_to new_t(platform), new_entry_path(platform.name), class: :alt_button
    - unless platform.custom_partial
      = render partial: 'search', locals: {platform: platform} if platform.search?

.content_box
  .navi.js_tree_holder{data: {:'update-url' => ksk.sort_navigations_path}}
    = p_recursive_navi(Navigation.top_level, 0, 99, 'ol', ' class="multi_grid js_tree_list"').html_safe  

  .template_data.hide{data: {:'update-path' => ksk.navigations_path, :'prompt-question' => I18n.t('ksk.navigation_sort.prompt_question')}}
    = link_to 'edit', edit_entry_path('navigation', 'NAVIID'), class: 'edit icon'
    = link_to 'delete', entry_path('navigation', 'NAVIID'), method: :delete, data: {confirm: t('bhf.helpers.promts.confirm')}, class: 'delete icon'

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ksk-0.4.2 app/views/bhf/platform/_navigation_tree.haml
ksk-0.4.1 app/views/bhf/platform/_navi.html.haml
ksk-0.4.0 app/views/bhf/platform/_navi.html.haml
ksk-0.3.4 app/views/bhf/platform/_navi.html.haml
ksk-0.3.3 app/views/bhf/platform/_navi.html.haml
ksk-0.3.2 app/views/bhf/platform/_navi.html.haml
ksk-0.3.0 app/views/bhf/pages/_navi.html.haml
ksk-0.2.15 app/views/bhf/pages/_navi.html.haml
ksk-0.2.14 app/views/bhf/pages/_navi.html.haml
ksk-0.2.13 app/views/bhf/pages/_navi.html.haml