diff options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_admin_navigation_item.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/_header.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/_navigation.html.haml | 15 |
3 files changed, 16 insertions, 12 deletions
diff --git a/app/views/layouts/_admin_navigation_item.html.haml b/app/views/layouts/_admin_navigation_item.html.haml new file mode 100644 index 0000000..8dd8a39 --- /dev/null +++ b/app/views/layouts/_admin_navigation_item.html.haml @@ -0,0 +1,3 @@ +- item = admin_navigation_item.to_s +%li{:class => ("active" if controller?(item))} + = link_to t(".#{item}", cascade: true), path_for(item) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index e827f60..7b7999a 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1,12 +1,8 @@ - if admin? %ul.nav.nav-tabs - = # this navigation isn't quite right. also, we will want to active for an identity controller once it is added. - %li{:class => ("active" if controller?('users', 'overviews') || params[:user_id])} - = link_to t(".users"), users_path - %li{:class => ("active" if controller?('tickets') && !params[:user_id])} - = link_to t(".tickets", cascade: true), tickets_path - %li - = link_to t(:logout), logout_path, :method => :delete + = render partial: 'common/navigation_item', + collection: [:users, :identities, :tickets] + = link_to_navigation :logout, logout_path, :method => :delete - if @user && @show_navigation .lead = @user.email_address diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 94f71f7..dccba0c 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -1,7 +1,12 @@ %ul.nav.sidenav - = link_to_navigation t(:overview), @user, :active => (controller?(:users) && action?(:show)) - = link_to_navigation t(:account_settings), edit_user_path(@user), :active => (controller?(:users) && !action?(:show)) + = link_to_navigation :overview, @user, + active: (controller?(:users) && action?(:show)) + = link_to_navigation :account_settings, edit_user_path(@user), + active: (controller?(:users) && !action?(:show)) - # will want link for identity settings - = link_to_navigation t(".tickets"), auto_tickets_path, :active => controller?(:tickets) - = link_to_navigation t(:billing_settings), billing_top_link(@user), :active => controller?(:customer, :payments, :subscriptions, :credit_card_info) if APP_CONFIG[:billing] - = link_to_navigation t(:logout), logout_path, :method => :delete + = link_to_navigation ".tickets", auto_tickets_path, + active: controller?(:tickets) + - if APP_CONFIG[:billing] + = link_to_navigation :billing_settings, billing_top_link(@user), + active: controller?(:customer, :payments, :subscriptions, :credit_card_info) + = link_to_navigation :logout, logout_path, method: :delete |