Guest User

Untitled

a guest
May 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #in application_helper.rb
  2. def subnav_link(path, name)
  3. content = "<li#{path == request.path ? ' class="sub-tabs-selected"' : nil}><a href='#{path}'><span>#{name}</span></a></li>"
  4. end
  5.  
  6.  
  7. #in _sub_menu.haml
  8.  
  9. - if not body_classes['home']
  10. #sub-menu-wrap
  11. .sub-menu
  12. %h2.hide Sub Menu
  13. %ul.sub-tabs-nav
  14. - if body_classes['company']
  15. %li Now is the time - company
  16.  
  17. - if body_classes['staff']
  18. %li Now is the time - staff
  19.  
  20. - if body_classes['advisors']
  21. - if current_account && current_account.name == "Pacific Advisors"
  22. = subnav_link(advisors_thedock_path, 'The Dock')
  23. = subnav_link(advisors_path, 'Advisor Listing')
  24. - if current_user.is_advisor?
  25. = subnav_link(advisor_path, 'Your Performance')
  26. - if current_user.admin? || current_user.manager? || current_user.executive?
  27. = subnav_link(advisors_performance_path, 'YTD Commissions')
  28.  
  29. - if body_classes['managers']
  30. %li Now is the time - managers
Add Comment
Please, Sign In to add comment