Created
June 1, 2013 01:31
-
-
Save t2/5688960 to your computer and use it in GitHub Desktop.
Possible refactor using a decorator for application layout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html | |
%head | |
%title= title | |
= stylesheet_link_tag 'application', :media => 'all' | |
= stylesheet_link_tag '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css' | |
= stylesheet_link_tag '//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css' | |
= javascript_include_tag 'application' | |
/[if lte IE 8] | |
<script src="excanvas.compiled.js"></script> | |
= csrf_meta_tags | |
%body | |
.navbar.navbar-inverse.navbar-fixed-top | |
.navbar-inner | |
.container | |
%a.btn.btn-navbar{'data-toggle' => 'collapse', 'data-target' => '.navbar-responsive-collapse'} | |
%span.icon-bar | |
%span.icon-bar | |
%span.icon-bar | |
= link_to image_tag('logo.png'), root_path, class: 'brand' | |
.nav-collapse.collapse.navbar-responsive-collapse | |
- if user_signed_in? | |
%ul.nav | |
- if can? :manage, User | |
%li#dashboard_link | |
= link_to 'Dashboard', '#' | |
%li#employees_link | |
= link_to 'Users', users_path | |
- else | |
%li | |
= link_to 'Stream', '#' | |
%ul.nav.pull-right | |
%li.divider-vertical | |
%li.dropdown | |
= link_to "#{ image_tag current_user.gravatar_url(size: 30) } #{current_user.profile.first_name} <b class='caret'></b>".html_safe, '#', { class: 'dropdown-toggle', 'data-toggle' => 'dropdown' } | |
%ul.dropdown-menu | |
%li | |
= link_to 'View Profile', user_profile_path | |
- if can? :manage, Client | |
%li.divider | |
%li | |
= link_to 'Manage Clients', clients_path | |
- elsif can? :client_manage, current_user.client | |
%li.divider | |
%li | |
= link_to "Manage #{current_user.client.name}", client_path(current_user.client) | |
-if can? :manage, Partner | |
%li | |
= link_to 'Manage Partners', partners_path | |
%li.divider | |
%li | |
= link_to 'Log Out', destroy_user_session_path | |
- if can? :manage, User | |
= simple_form_for User.new, html: { class: 'navbar-search pull-right' } do |search| | |
= search.text_field :email, class: 'search-query', placeholder: 'Search' | |
#content.container | |
- flash.each do |name, msg| | |
- if msg.is_a?(String) | |
= content_tag :div, msg, :id => "flash_#{name}" | |
= yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not horrible yet. It will grow in complexity.