Module: Wafflemix::ApplicationHelper
- Defined in:
- app/helpers/wafflemix/application_helper.rb
Instance Method Summary collapse
- #main_menu(pages) ⇒ Object
- #main_subnav ⇒ Object
- #menu_level_class(page) ⇒ Object
- #sub_nav_links ⇒ Object
- #top_nav ⇒ Object
- #top_nav_links ⇒ Object
Instance Method Details
#main_menu(pages) ⇒ Object
69 70 71 72 73 74 75 |
# File 'app/helpers/wafflemix/application_helper.rb', line 69 def (pages) pages.map do |page, sub_pages| content_tag(:li, :id => page.title, :class => (page)) do link_to(page.title, link_with_parents(page)) + (content_tag(:ul, (sub_pages), :class => 'dropdown') if sub_pages.any?) end end.join.html_safe end |
#main_subnav ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/helpers/wafflemix/application_helper.rb', line 30 def output = '' output += content_tag(:div, :class => 'subnav') do content_tag(:ul, :class => 'nav nav-pills') do sub_nav_links.html_safe end end output.html_safe end |
#menu_level_class(page) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'app/helpers/wafflemix/application_helper.rb', line 77 def (page) if page.is_root? 'level1' elsif page.parent.is_root? 'level2' else 'level3' end end |
#sub_nav_links ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'app/helpers/wafflemix/application_helper.rb', line 60 def sub_nav_links t = content_tag(:li, link_to('Global styles', '#')) t += content_tag(:li, link_to('Grid system', '#')) t += content_tag(:li, link_to('Fluid grid system', '#')) t += content_tag(:li, link_to('Customizing', '#')) t += content_tag(:li, link_to('Layouts', '#')) t += content_tag(:li, link_to('Responsive design', '#')) end |
#top_nav ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/wafflemix/application_helper.rb', line 4 def top_nav output = '' output += content_tag(:div, :class => 'navbar navbar-fixed-top') do content_tag(:div, :class => 'navbar-inner') do content_tag(:div, :class => 'container') do container_content = '' container_content += content_tag(:div, :class => 'btn btn-navbar', :type => 'button', 'data-toggle' => 'collapse', 'data-target' => '.nav-collapse') do = '' += content_tag(:span, '', :class => 'icon-bar') += content_tag(:span, '', :class => 'icon-bar') += content_tag(:span, '', :class => 'icon-bar') .html_safe end container_content += link_to('WaffleMix', '#', :class => 'brand') container_content += content_tag(:div, '', :class => 'nav-collapse collapse') do content_tag(:ul, :class => 'nav') do top_nav_links.html_safe end end container_content.html_safe end end end output.html_safe end |
#top_nav_links ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/helpers/wafflemix/application_helper.rb', line 40 def top_nav_links t = content_tag(:li, link_to('Switch to Site', root_path, :class => 'brand brand_switch')) t += content_tag(:li, link_to('Dashboard', '#'), :class => 'active') t += content_tag(:li, link_to('Pages', admin_pages_path)) t += content_tag(:li, link_to('Users', admin_users_path)) t += content_tag(:li, link_to('Files and Images', admin_assets_path)) t += content_tag(:li, link_to('Categories', admin_categories_path)) t += content_tag(:li, link_to('Posts', admin_posts_path)) t += content_tag(:li, link_to('Slides', )) t += content_tag(:li, link_to('Portfolio', admin_portfolios_path)) t += content_tag(:li, link_to('Contact Forms', admin_contact_forms_path)) t += content_tag(:li, '', :class => 'divider-vertical') if user_signed_in? t += content_tag(:li, link_to('Logout', destroy_user_session_path, :method => :delete)) else t += content_tag(:li, link_to('Login', new_user_session_path)) end t += content_tag(:li, link_to('Customize', '#')) end |