Commit f82c1425 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Rebuild navigation for dashboard

* projects from explore page are available from dashboard
* use dashboard sidebar for both logged in and not users
* move explroe projects under projects tab
* move explore groups under groups tab
* move public snippets under snippets tab
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b1c1a3d3
...@@ -6,3 +6,11 @@ ...@@ -6,3 +6,11 @@
font-size: 30px; font-size: 30px;
} }
} }
.explore-trending-block {
.lead {
line-height: 32px;
font-size: 18px;
margin-top: 10px;
}
}
...@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController ...@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw] skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
layout 'dashboard' layout 'snippets'
respond_to :html respond_to :html
def index def index
......
...@@ -10,7 +10,7 @@ module ExploreHelper ...@@ -10,7 +10,7 @@ module ExploreHelper
options = exist_opts.merge(options) options = exist_opts.merge(options)
path = request.path path = explore_projects_path
path << "?#{options.to_param}" path << "?#{options.to_param}"
path path
end end
......
...@@ -68,7 +68,13 @@ module TabHelper ...@@ -68,7 +68,13 @@ module TabHelper
current_path?(single_path) current_path?(single_path)
end end
elsif page = options.delete(:page) elsif page = options.delete(:page)
current_page?(page) unless page.respond_to?(:each)
page = [page]
end
page.any? do |single_page|
current_page?(single_page)
end
else else
c = options.delete(:controller) c = options.delete(:controller)
a = options.delete(:action) a = options.delete(:action)
......
%ul.center-top-menu
= nav_link(page: [dashboard_groups_path]) do
= link_to dashboard_groups_path, title: 'Your groups', data: {placement: 'right'} do
Your Groups
= nav_link(page: [explore_groups_path]) do
= link_to explore_groups_path, title: 'Explore groups', data: {toggle: 'tooltip', placement: 'bottom'} do
Explore Groups
%ul.center-top-menu %ul.center-top-menu
= nav_link(path: ['dashboard#show', 'root#show'], html_options: {class: 'home'}) do = nav_link(path: ['dashboard#show', 'root#show']) do
= link_to dashboard_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do = link_to dashboard_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
Your Projects Your Projects
= nav_link(path: 'projects#starred') do = nav_link(page: starred_dashboard_projects_path) do
= link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do = link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do
Starred Projects Starred Projects
= nav_link(controller: :explore) do = nav_link(page: [explore_root_path, trending_explore_projects_path, starred_explore_projects_path, explore_projects_path]) do
= link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do
Explore Projects Explore Projects
- page_title "Groups" - page_title "Groups"
= render 'dashboard/groups_head'
%h3.page-title %h3.page-title
Group Membership Group Membership
- if current_user.can_create_group? - if current_user.can_create_group?
......
- page_title "Groups" - page_title "Groups"
- if current_user
= render 'dashboard/groups_head'
.clearfix .clearfix
.pull-left .pull-left
= form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f|
......
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
%span.light sort:
- if @sort.present?
= sort_options_hash[@sort]
- elsif current_page?(trending_explore_projects_path) || current_page?(explore_root_path)
Trending projects
- elsif current_page?(starred_explore_projects_path)
Most stars
- else
= sort_title_recently_created
%b.caret
%ul.dropdown-menu
%li
= link_to trending_explore_projects_path do
Trending projects
= link_to starred_explore_projects_path do
Most stars
= link_to explore_projects_filter_path(sort: sort_value_recently_created) do
= sort_title_recently_created
= link_to explore_projects_filter_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created
= link_to explore_projects_filter_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
= link_to explore_projects_filter_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
...@@ -46,22 +46,4 @@ ...@@ -46,22 +46,4 @@
= link_to explore_projects_filter_path(tag: tag.name) do = link_to explore_projects_filter_path(tag: tag.name) do
%i.fa.fa-tag %i.fa.fa-tag
= tag.name = tag.name
= render 'explore/projects/dropdown'
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
%span.light sort:
- if @sort.present?
= sort_options_hash[@sort]
- else
= sort_title_recently_created
%b.caret
%ul.dropdown-menu
%li
= link_to explore_projects_filter_path(sort: sort_value_recently_created) do
= sort_title_recently_created
= link_to explore_projects_filter_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created
= link_to explore_projects_filter_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
= link_to explore_projects_filter_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
- page_title "Projects" - page_title "Projects"
- if current_user
= render 'dashboard/projects_head'
.clearfix .clearfix
= render 'filter' = render 'filter'
%br
%hr
.public-projects .public-projects
%ul.bordered-list.top-list %ul.bordered-list.top-list
= render @projects = render @projects
......
- page_title "Starred Projects" - page_title "Starred Projects"
- if current_user
= render 'dashboard/projects_head'
.explore-trending-block .explore-trending-block
%p.lead .lead
%i.fa.fa-star %i.fa.fa-star
See most starred projects See most starred projects
%hr .pull-right
= render 'explore/projects/dropdown'
.public-projects .public-projects
%ul.bordered-list %ul.bordered-list
= render @starred_projects = render @starred_projects
......
- page_title "Trending Projects" - page_title "Trending Projects"
- if current_user
= render 'dashboard/projects_head'
.explore-title .explore-title
%h3 %h3
Explore GitLab Explore GitLab
...@@ -6,10 +8,11 @@ ...@@ -6,10 +8,11 @@
Discover projects and groups. Share your projects with others Discover projects and groups. Share your projects with others
%hr %hr
.explore-trending-block .explore-trending-block
%p.lead .lead
%i.fa.fa-comments-o %i.fa.fa-comments-o
See most discussed projects for last month See most discussed projects for last month
%hr .pull-right
= render 'explore/projects/dropdown'
.public-projects .public-projects
%ul.bordered-list %ul.bordered-list
= render @trending_projects = render @trending_projects
- page_title "Explore" - page_title "Explore"
- header_title "Explore GitLab", explore_root_path - if current_user
- sidebar "explore" - header_title "Dashboard", root_path
- else
- header_title "Explore GitLab", explore_root_path
- sidebar "dashboard"
= render template: "layouts/application" = render template: "layouts/application"
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#starred'], html_options: {class: 'home'}) do = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to root_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do = link_to (current_user ? root_path : explore_root_path), title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Projects Projects
-#= nav_link(path: 'projects#starred') do
-#= link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do
-#= icon('star fw')
-#%span
-#Starred Projects
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to dashboard_groups_path, title: 'Groups', data: {placement: 'right'} do = link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
%span %span
Groups Groups
= nav_link(controller: :milestones) do - if current_user
= link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do = nav_link(controller: :milestones) do
= icon('clock-o fw') = link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do
%span = icon('clock-o fw')
Milestones %span
= nav_link(path: 'dashboard#issues') do Milestones
= link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do = nav_link(path: 'dashboard#issues') do
= icon('exclamation-circle fw') = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do
%span = icon('exclamation-circle fw')
Issues %span
%span.count= current_user.assigned_issues.opened.count Issues
= nav_link(path: 'dashboard#merge_requests') do %span.count= current_user.assigned_issues.opened.count
= link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do = nav_link(path: 'dashboard#merge_requests') do
= icon('tasks fw') = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do
%span = icon('tasks fw')
Merge Requests %span
%span.count= current_user.assigned_merge_requests.opened.count Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do = link_to (current_user ? user_snippets_path(current_user) : snippets_path), title: 'Your snippets', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Snippets Snippets
= nav_link(controller: :profile) do - if current_user
= link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do = nav_link(controller: :profile) do
= icon('user fw') = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
%span = icon('user fw')
Profile %span
Profile
= nav_link(controller: :help) do = nav_link(controller: :help) do
= link_to help_path, title: 'Help', data: {placement: 'right'} do = link_to help_path, title: 'Help', data: {placement: 'right'} do
= icon('question-circle fw') = icon('question-circle fw')
......
%ul.nav.nav-sidebar
= nav_link(path: 'projects#trending') do
= link_to explore_root_path, title: 'Trending Projects', data: {placement: 'right'} do
= icon('comments fw')
%span Trending Projects
= nav_link(path: 'projects#starred') do
= link_to starred_explore_projects_path, title: 'Most-starred Projects', data: {placement: 'right'} do
= icon('star fw')
%span Most-starred Projects
= nav_link(path: 'projects#index') do
= link_to explore_projects_path, title: 'All Projects', data: {placement: 'right'} do
= icon('bookmark fw')
%span All Projects
= nav_link(controller: :groups) do
= link_to explore_groups_path, title: 'All Groups', data: {placement: 'right'} do
= icon('group fw')
%span All Groups
%ul.nav.nav-sidebar
- if current_user
= nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Your Snippets
= nav_link(path: snippets_path) do
= link_to snippets_path, title: 'Discover snippets', data: {placement: 'right'} do
= icon('globe fw')
%span
Discover Snippets
- page_title 'Snippets' - page_title 'Snippets'
- header_title 'Snippets', snippets_path - if current_user
- sidebar "snippets" - header_title "Dashboard", root_path
- else
- header_title 'Snippets', snippets_path
- sidebar "dashboard"
= render template: "layouts/application" = render template: "layouts/application"
- page_title "Public Snippets" - page_title "Public Snippets"
= render 'head' - if current_user
= render 'head'
%h3.page-title %h3.page-title
Public snippets Public snippets
......
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