Commit f0d0b193 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fold sidebar for mobile devices and expand for desktop

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b4e6dec8
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
} }
} }
@media(min-width:768px) { @mixin expanded-sidebar {
.page-with-sidebar { .page-with-sidebar {
padding-left: 250px; padding-left: 250px;
} }
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
} }
} }
.fold-sidenav { @mixin folded-sidebar {
.page-with-sidebar { .page-with-sidebar {
padding-left: 50px; padding-left: 50px;
} }
...@@ -153,3 +153,12 @@ ...@@ -153,3 +153,12 @@
} }
} }
} }
@media (max-width: $screen-sm-max) {
@include folded-sidebar;
}
@media(min-width: $screen-sm-max) {
@include expanded-sidebar;
}
%ul.nav-sidebar.navbar-collapse.collapse %ul.nav.nav-sidebar
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to admin_root_path, title: "Stats" do = link_to admin_root_path, title: "Stats" do
Overview %i.fa.fa-dashboard
%span
Overview
= nav_link(controller: :projects) do = nav_link(controller: :projects) do
= link_to "Projects", admin_projects_path = link_to admin_projects_path do
%i.fa.fa-cube
%span
Projects
= nav_link(controller: :users) do = nav_link(controller: :users) do
= link_to "Users", admin_users_path = link_to admin_users_path do
%i.fa.fa-users
%span
Users
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to "Groups", admin_groups_path = link_to admin_groups_path do
%i.fa.fa-group
%span
Groups
= nav_link(controller: :logs) do = nav_link(controller: :logs) do
= link_to "Logs", admin_logs_path = link_to admin_logs_path do
%i.fa.fa-file-text
%span
Logs
= nav_link(controller: :broadcast_messages) do = nav_link(controller: :broadcast_messages) do
= link_to "Messages", admin_broadcast_messages_path = link_to admin_broadcast_messages_path do
%i.fa.fa-bullhorn
%span
Messages
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to "Hooks", admin_hooks_path = link_to admin_hooks_path do
%i.fa.fa-external-link
%span
Hooks
= nav_link(controller: :background_jobs) do = nav_link(controller: :background_jobs) do
= link_to "Background Jobs", admin_background_jobs_path = link_to admin_background_jobs_path do
%i.fa.fa-cog
%span
Background Jobs
%ul.nav.nav-sidebar.navbar-collapse.collapse %ul.nav.nav-sidebar
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
= link_to root_path, title: 'Home', class: 'shortcuts-activity' do = link_to root_path, title: 'Home', class: 'shortcuts-activity' do
%i.fa.fa-dashboard %i.fa.fa-dashboard
......
%ul.nav.nav-sidebar.navbar-collapse.collapse %ul.nav.nav-sidebar
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do = link_to group_path(@group), title: "Home" do
%i.fa.fa-dashboard %i.fa.fa-dashboard
Activity %span
Activity
- if current_user - if current_user
= nav_link(controller: [:group, :milestones]) do = nav_link(controller: [:group, :milestones]) do
= link_to group_milestones_path(@group) do = link_to group_milestones_path(@group) do
%i.fa.fa-clock-o %i.fa.fa-clock-o
Milestones %span
Milestones
= nav_link(path: 'groups#issues') do = nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do = link_to issues_group_path(@group) do
%i.fa.fa-exclamation-circle %i.fa.fa-exclamation-circle
Issues %span
- if current_user Issues
%span.count= Issue.opened.of_group(@group).count - if current_user
%span.count= Issue.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do = nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do = link_to merge_requests_group_path(@group) do
%i.fa.fa-tasks %i.fa.fa-tasks
Merge Requests %span
- if current_user Merge Requests
%span.count= MergeRequest.opened.of_group(@group).count - if current_user
%span.count= MergeRequest.opened.of_group(@group).count
= nav_link(path: 'groups#members') do = nav_link(path: 'groups#members') do
= link_to members_group_path(@group) do = link_to members_group_path(@group) do
%i.fa.fa-users %i.fa.fa-users
Members %span
Members
- if can?(current_user, :manage_group, @group) - if can?(current_user, :manage_group, @group)
= nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do = nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
= link_to edit_group_path(@group), class: "tab no-highlight" do = link_to edit_group_path(@group), class: "tab no-highlight" do
%i.fa.fa-cogs %i.fa.fa-cogs
Settings %span
%i.fa.fa-angle-down Settings
%i.fa.fa-angle-down
- if group_settings_page? - if group_settings_page?
= render 'groups/settings_nav' = render 'groups/settings_nav'
%ul.nav-sidebar.navbar-collapse.collapse %ul.nav.nav-sidebar
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: "Profile" do = link_to profile_path, title: "Profile" do
%i.fa.fa-user %i.fa.fa-user
Profile %span
Profile
= nav_link(controller: :accounts) do = nav_link(controller: :accounts) do
= link_to profile_account_path do = link_to profile_account_path do
%i.fa.fa-gear %i.fa.fa-gear
...@@ -10,33 +11,40 @@ ...@@ -10,33 +11,40 @@
= nav_link(controller: :emails) do = nav_link(controller: :emails) do
= link_to profile_emails_path do = link_to profile_emails_path do
%i.fa.fa-envelope-o %i.fa.fa-envelope-o
Emails %span
%span.count= current_user.emails.count + 1 Emails
%span.count= current_user.emails.count + 1
- unless current_user.ldap_user? - unless current_user.ldap_user?
= nav_link(controller: :passwords) do = nav_link(controller: :passwords) do
= link_to edit_profile_password_path do = link_to edit_profile_password_path do
%i.fa.fa-lock %i.fa.fa-lock
Password %span
Password
= nav_link(controller: :notifications) do = nav_link(controller: :notifications) do
= link_to profile_notifications_path do = link_to profile_notifications_path do
%i.fa.fa-inbox %i.fa.fa-inbox
Notifications %span
Notifications
= nav_link(controller: :keys) do = nav_link(controller: :keys) do
= link_to profile_keys_path do = link_to profile_keys_path do
%i.fa.fa-key %i.fa.fa-key
SSH Keys %span
%span.count= current_user.keys.count SSH Keys
%span.count= current_user.keys.count
= nav_link(path: 'profiles#design') do = nav_link(path: 'profiles#design') do
= link_to design_profile_path do = link_to design_profile_path do
%i.fa.fa-image %i.fa.fa-image
Design %span
Design
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to profile_groups_path do = link_to profile_groups_path do
%i.fa.fa-group %i.fa.fa-group
Groups %span
Groups
= nav_link(path: 'profiles#history') do = nav_link(path: 'profiles#history') do
= link_to history_profile_path do = link_to history_profile_path do
%i.fa.fa-history %i.fa.fa-history
History %span
History
%ul.project-navigation.nav.nav-sidebar.navbar-collapse.collapse %ul.project-navigation.nav.nav-sidebar
= nav_link(path: 'projects#show', html_options: {class: "home"}) do = nav_link(path: 'projects#show', html_options: {class: "home"}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
%i.fa.fa-dashboard %i.fa.fa-dashboard
......
...@@ -2,24 +2,30 @@ ...@@ -2,24 +2,30 @@
= nav_link(path: 'projects#edit') do = nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), class: "stat-tab tab " do = link_to edit_project_path(@project), class: "stat-tab tab " do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Project %span
Project
= nav_link(controller: [:team_members, :teams]) do = nav_link(controller: [:team_members, :teams]) do
= link_to project_team_index_path(@project), class: "team-tab tab" do = link_to project_team_index_path(@project), class: "team-tab tab" do
%i.fa.fa-users %i.fa.fa-users
Members %span
Members
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to project_deploy_keys_path(@project) do = link_to project_deploy_keys_path(@project) do
%i.fa.fa-key %i.fa.fa-key
Deploy Keys %span
Deploy Keys
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to project_hooks_path(@project) do = link_to project_hooks_path(@project) do
%i.fa.fa-link %i.fa.fa-link
Web Hooks %span
Web Hooks
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to project_services_path(@project) do = link_to project_services_path(@project) do
%i.fa.fa-cogs %i.fa.fa-cogs
Services %span
Services
= nav_link(controller: :protected_branches) do = nav_link(controller: :protected_branches) do
= link_to project_protected_branches_path(@project) do = link_to project_protected_branches_path(@project) do
%i.fa.fa-lock %i.fa.fa-lock
Protected branches %span
Protected branches
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