tnantoka/wizu

View on GitHub
app/views/pages/_breadcrumb.html.slim

Summary

Maintainability
Test Coverage
ol.breadcrumb.clean-background
  - page.ancestors.each do |p|
    li
      - if p.wiki?
        = link_to p.title, wiki_path(p)
        span.text-muted= wiki_icon(p)
      - else
        = link_to p.title, p
      =< render 'pages/siblings', page: p

  - if %w(histories tree new index activities).include?(action_name)
    li
      = link_to page.title, page
      span.text-muted= wiki_icon(page) if page.wiki?
      =< render 'pages/siblings', page: page
  - case action_name
  - when 'histories'
    li.active= t('global.histories')
  - when 'tree'
    li.active= t('global.tree_view')
  - when 'new'
    li.active= t('global.new_page')
  - when 'activities'
    li.active= t('global.activities')
  - when 'index'
    - case controller_name
    - when 'attachments'
      li.active= t('global.attachments')
    - when 'collaborations'
      li.active= t('global.collaborators')
  - else
    li.active
      = page.title
      = wiki_icon(page) if page.wiki?
      =< render 'pages/siblings', page: page
      
    li.active= link_to icon('plus'), new_wiki_page_path(@wiki, parent_id: (page.wiki? ? nil : page.id))