Commit 324e5769 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Implement top navigation concept for profile area

Main idea is to keep left sidebar static so user is not confused by
changing context. Instead we put changing navigation with changing
content in one main block
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 55380e69
......@@ -185,3 +185,11 @@
}
}
}
.layout-nav {
margin-bottom: 5px;
.nav-links {
padding: 0 $gl-padding;
}
}
......@@ -84,6 +84,14 @@ module PageLayoutHelper
end
end
def nav(name = nil)
if name
@nav = name
else
@nav
end
end
def fluid_layout(enabled = false)
if @fluid_layout.nil?
@fluid_layout = (current_user && current_user.layout == "fluid") || enabled
......
......@@ -110,4 +110,12 @@ module TabHelper
'active'
end
end
def profile_tab_class
if controller.controller_path =~ /\Aprofiles/
return 'active'
end
'active' if current_controller?('oauth/applications')
end
end
- page_title "Applications"
- header_title page_title, applications_profile_path
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
......
......@@ -25,6 +25,9 @@
.content-wrapper
= render "layouts/flash"
= yield :flash_message
- if defined?(nav) && nav
.layout-nav
= render "layouts/nav/#{nav}"
%div{ class: (container_class unless @no_container) }
.content
.clearfix
......
......@@ -6,6 +6,6 @@
= yield :scripts_body_top
= render "layouts/header/default", title: header_title
= render 'layouts/page', sidebar: sidebar
= render 'layouts/page', sidebar: sidebar, nav: nav
= yield :scripts_body
......@@ -48,8 +48,7 @@
%span
Help
%li.separate-item
= nav_link(controller: :profile) do
= nav_link(html_options: {class: profile_tab_class}) do
= link_to profile_path, title: 'Profile Settings', data: {placement: 'bottom'} do
= icon('user fw')
%span
......
%ul.nav.nav-sidebar
= nav_link do
= link_to root_path, title: 'Go to dashboard', class: 'back-link' do
= icon('caret-square-o-left fw')
%span
Go to dashboard
%li.separate-item
%ul.nav-links
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: 'Profile Settings' do
= icon('user fw')
%span
Profile Settings
Profile
= nav_link(controller: [:accounts, :two_factor_auths]) do
= link_to profile_account_path, title: 'Account' do
= icon('gear fw')
......
- page_title "Profile Settings"
- header_title "Profile Settings", profile_path unless header_title
- sidebar "profile"
- sidebar "dashboard"
- nav "profile"
= render template: "layouts/application"
- page_title "Account"
- header_title page_title, profile_account_path
- if current_user.ldap_user?
.alert.alert-info
......
- page_title "Audit Log"
- header_title page_title, audit_log_profile_path
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
......
- page_title "Emails"
- header_title page_title, profile_emails_path
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
......
- page_title "SSH Keys"
- header_title page_title, profile_keys_path
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
......
- page_title "Notifications"
- header_title page_title, profile_notifications_path
%div
- if @user.errors.any?
......
- page_title "Password"
- header_title page_title, edit_profile_password_path
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
......
- page_title 'Preferences'
- header_title page_title, profile_preferences_path
= form_for @user, url: profile_preferences_path, remote: true, method: :put, html: {class: 'row prepend-top-default js-preferences-form'} do |f|
.col-lg-3.profile-settings-sidebar
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment