diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-20 14:19:32 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-20 14:19:32 +0200 |
commit | 8819007c83fdf1ac642836640a37cc541f6eddc6 (patch) | |
tree | 3a70e37e033ed1b58af4d64b0e1381a2feefd5ab | |
parent | eb057209b072e9557f41c6f062832f9b37f62fc8 (diff) | |
parent | 90071a08d77069410e64b7cfe926eb806fd70504 (diff) | |
download | gitlab-ce-8819007c83fdf1ac642836640a37cc541f6eddc6.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
27 files changed, 184 insertions, 135 deletions
diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index d36530169a9..bf5c7a8d75e 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -373,3 +373,23 @@ table { border-color: #EEE !important; } } + +.center-top-menu { + border-bottom: 1px solid #EEE; + list-style: none; + text-align: center; + padding-bottom: 15px; + margin-bottom: 15px; + + li { + display: inline-block; + + a { + padding: 10px; + } + + &.active a { + color: #666; + } + } +} diff --git a/app/assets/stylesheets/pages/explore.scss b/app/assets/stylesheets/pages/explore.scss index 9b92128624c..da06fe9954e 100644 --- a/app/assets/stylesheets/pages/explore.scss +++ b/app/assets/stylesheets/pages/explore.scss @@ -6,3 +6,11 @@ font-size: 30px; } } + +.explore-trending-block { + .lead { + line-height: 32px; + font-size: 18px; + margin-top: 10px; + } +} diff --git a/app/helpers/explore_helper.rb b/app/helpers/explore_helper.rb index 7616fe6bad8..0d291f9a87e 100644 --- a/app/helpers/explore_helper.rb +++ b/app/helpers/explore_helper.rb @@ -10,7 +10,7 @@ module ExploreHelper options = exist_opts.merge(options) - path = request.path + path = explore_projects_path path << "?#{options.to_param}" path end diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb index 77727337f07..0e7d8065ac7 100644 --- a/app/helpers/tab_helper.rb +++ b/app/helpers/tab_helper.rb @@ -67,6 +67,14 @@ module TabHelper path.any? do |single_path| current_path?(single_path) end + elsif page = options.delete(:page) + unless page.respond_to?(:each) + page = [page] + end + + page.any? do |single_page| + current_page?(single_page) + end else c = options.delete(:controller) a = options.delete(:action) diff --git a/app/views/dashboard/_groups_head.html.haml b/app/views/dashboard/_groups_head.html.haml new file mode 100644 index 00000000000..8a397a84e0e --- /dev/null +++ b/app/views/dashboard/_groups_head.html.haml @@ -0,0 +1,7 @@ +%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 diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml new file mode 100644 index 00000000000..f7be194c696 --- /dev/null +++ b/app/views/dashboard/_projects_head.html.haml @@ -0,0 +1,10 @@ +%ul.center-top-menu + = nav_link(path: ['dashboard#show', 'root#show']) do + = link_to dashboard_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do + Your Projects + = nav_link(page: starred_dashboard_projects_path) do + = link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do + Starred Projects + = 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 + Explore Projects diff --git a/app/views/dashboard/groups/index.html.haml b/app/views/dashboard/groups/index.html.haml index 0a354373b9b..0860fe3c761 100644 --- a/app/views/dashboard/groups/index.html.haml +++ b/app/views/dashboard/groups/index.html.haml @@ -1,14 +1,13 @@ - page_title "Groups" -%h3.page-title - Group Membership += render 'dashboard/groups_head' + +.slead + Group members have access to all group projects. - if current_user.can_create_group? %span.pull-right.hidden-xs - = link_to new_group_path, class: "btn btn-new" do + = link_to new_group_path, class: "btn btn-new btn-sm" do %i.fa.fa-plus New Group -%p.light - Group members have access to all group projects. -%hr .panel.panel-default .panel-heading %strong Groups diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml index 8aaa0a7f071..98b8cde4766 100644 --- a/app/views/dashboard/projects/starred.html.haml +++ b/app/views/dashboard/projects/starred.html.haml @@ -1,4 +1,6 @@ - page_title "Starred Projects" += render 'dashboard/projects_head' + - if @projects.any? = render 'shared/show_aside' diff --git a/app/views/dashboard/show.html.haml b/app/views/dashboard/show.html.haml index 5001c2101e1..a3a32b6932f 100644 --- a/app/views/dashboard/show.html.haml +++ b/app/views/dashboard/show.html.haml @@ -2,6 +2,8 @@ - if current_user = auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity") += render 'dashboard/projects_head' + - if @projects.any? = render 'shared/show_aside' diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml index f3f0b778539..7dcefd330a1 100644 --- a/app/views/explore/groups/index.html.haml +++ b/app/views/explore/groups/index.html.haml @@ -1,5 +1,7 @@ - page_title "Groups" -.clearfix +- if current_user + = render 'dashboard/groups_head' +.clearfix.append-bottom-10 .pull-left = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| = hidden_field_tag :sort, @sort @@ -28,15 +30,12 @@ = link_to explore_groups_path(sort: sort_value_oldest_updated) do = sort_title_oldest_updated -%hr - %ul.bordered-list - @groups.each do |group| %li .clearfix %h4 = link_to group_path(id: group.path) do - %i.fa.fa-users = group.name .clearfix %p diff --git a/app/views/explore/projects/_dropdown.html.haml b/app/views/explore/projects/_dropdown.html.haml new file mode 100644 index 00000000000..b23a3c1e5c1 --- /dev/null +++ b/app/views/explore/projects/_dropdown.html.haml @@ -0,0 +1,27 @@ +.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 + diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml index 82622a58ed2..4b91291caf4 100644 --- a/app/views/explore/projects/_filter.html.haml +++ b/app/views/explore/projects/_filter.html.haml @@ -46,22 +46,4 @@ = link_to explore_projects_filter_path(tag: tag.name) do %i.fa.fa-tag = tag.name - - .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 + = render 'explore/projects/dropdown' diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml index ba2276f51ce..4956081e1ed 100644 --- a/app/views/explore/projects/index.html.haml +++ b/app/views/explore/projects/index.html.haml @@ -1,8 +1,9 @@ - page_title "Projects" +- if current_user + = render 'dashboard/projects_head' .clearfix = render 'filter' - -%hr +%br .public-projects %ul.bordered-list.top-list = render @projects diff --git a/app/views/explore/projects/starred.html.haml b/app/views/explore/projects/starred.html.haml index b5d146b1f2f..fdccbe5692f 100644 --- a/app/views/explore/projects/starred.html.haml +++ b/app/views/explore/projects/starred.html.haml @@ -1,9 +1,12 @@ - page_title "Starred Projects" +- if current_user + = render 'dashboard/projects_head' .explore-trending-block - %p.lead + .lead %i.fa.fa-star See most starred projects - %hr + .pull-right + = render 'explore/projects/dropdown' .public-projects %ul.bordered-list = render @starred_projects diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml index 5e24df76a63..98a4174b426 100644 --- a/app/views/explore/projects/trending.html.haml +++ b/app/views/explore/projects/trending.html.haml @@ -1,4 +1,6 @@ - page_title "Trending Projects" +- if current_user + = render 'dashboard/projects_head' .explore-title %h3 Explore GitLab @@ -6,10 +8,11 @@ Discover projects and groups. Share your projects with others %hr .explore-trending-block - %p.lead + .lead %i.fa.fa-comments-o See most discussed projects for last month - %hr + .pull-right + = render 'explore/projects/dropdown' .public-projects %ul.bordered-list = render @trending_projects diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml index 56bb92a536e..17fee9c510d 100644 --- a/app/views/layouts/explore.html.haml +++ b/app/views/layouts/explore.html.haml @@ -1,5 +1,8 @@ - page_title "Explore" -- header_title "Explore GitLab", explore_root_path -- sidebar "explore" +- if current_user + - header_title "Dashboard", root_path +- else + - header_title "Explore GitLab", explore_root_path +- sidebar "dashboard" = render template: "layouts/application" diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index b3cd7b0e37b..12ddbe6f1b7 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -17,13 +17,13 @@ %li.visible-sm.visible-xs = link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('search') - %li.hidden-xs + -#%li.hidden-xs = link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('question-circle fw') - %li + -#%li = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('globe fw') - %li + -#%li = link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('clipboard fw') - if current_user.is_admin? @@ -34,7 +34,7 @@ %li.hidden-xs = link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('plus fw') - %li + -#%li = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('cog fw') %li diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 687c1fc3dd2..8f010196d1a 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -1,36 +1,43 @@ %ul.nav.nav-sidebar - = nav_link(path: ['dashboard#show', 'root#show'], html_options: {class: 'home'}) do - = link_to dashboard_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do + = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do + = link_to (current_user ? root_path : explore_root_path), title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do = icon('dashboard fw') %span - Your 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 + Projects = 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') %span Groups - = nav_link(controller: :milestones) do - = link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do - = icon('clock-o fw') - %span - Milestones - = nav_link(path: 'dashboard#issues') do - = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do - = icon('exclamation-circle fw') - %span - Issues - %span.count= current_user.assigned_issues.opened.count - = nav_link(path: 'dashboard#merge_requests') do - = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do - = icon('tasks fw') + - if current_user + = nav_link(controller: :milestones) do + = link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do + = icon('clock-o fw') + %span + Milestones + = nav_link(path: 'dashboard#issues') do + = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do + = icon('exclamation-circle fw') + %span + Issues + %span.count= current_user.assigned_issues.opened.count + = nav_link(path: 'dashboard#merge_requests') do + = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do + = icon('tasks fw') + %span + Merge Requests + %span.count= current_user.assigned_merge_requests.opened.count + = nav_link(controller: :snippets) do + = link_to (current_user ? user_snippets_path(current_user) : snippets_path), title: 'Your snippets', data: {placement: 'right'} do + = icon('dashboard fw') %span - Merge Requests - %span.count= current_user.assigned_merge_requests.opened.count + Snippets + - if current_user + = nav_link(controller: :profile) do + = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do + = icon('user fw') + %span + Profile = nav_link(controller: :help) do = link_to help_path, title: 'Help', data: {placement: 'right'} do = icon('question-circle fw') diff --git a/app/views/layouts/nav/_explore.html.haml b/app/views/layouts/nav/_explore.html.haml deleted file mode 100644 index 66870e84ceb..00000000000 --- a/app/views/layouts/nav/_explore.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%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 - diff --git a/app/views/layouts/nav/_snippets.html.haml b/app/views/layouts/nav/_snippets.html.haml deleted file mode 100644 index 458b76a2c99..00000000000 --- a/app/views/layouts/nav/_snippets.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%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 diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml index 9b0f40073ab..b77fe09fc2a 100644 --- a/app/views/layouts/snippets.html.haml +++ b/app/views/layouts/snippets.html.haml @@ -1,5 +1,8 @@ - page_title 'Snippets' -- header_title 'Snippets', snippets_path -- sidebar "snippets" +- if current_user + - header_title "Dashboard", root_path +- else + - header_title 'Snippets', snippets_path +- sidebar "dashboard" = render template: "layouts/application" diff --git a/app/views/snippets/_head.html.haml b/app/views/snippets/_head.html.haml new file mode 100644 index 00000000000..0adf6b91f2c --- /dev/null +++ b/app/views/snippets/_head.html.haml @@ -0,0 +1,7 @@ +%ul.center-top-menu + = nav_link(page: user_snippets_path(current_user), html_options: {class: 'home'}) do + = link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do + Your Snippets + = nav_link(page: snippets_path) do + = link_to snippets_path, title: 'Explore snippets', data: {placement: 'right'} do + Explore Snippets diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml index 0718f743828..62a967a2e06 100644 --- a/app/views/snippets/current_user_index.html.haml +++ b/app/views/snippets/current_user_index.html.haml @@ -1,13 +1,13 @@ - page_title "Your Snippets" -%h3.page-title - Your Snippets - .pull-right - = link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do - Add new snippet += render 'head' -%p.light +.slead Share code pastes with others out of git repository + .pull-right + = link_to new_snippet_path, class: "btn btn-new btn-sm", title: "New Snippet" do + Add new snippet + %ul.nav.nav-tabs = nav_tab :scope, nil do = link_to user_snippets_path(@user) do diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index e9bb6a908d3..8608815e0a6 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,17 +1,9 @@ - page_title "Public Snippets" -%h3.page-title - Public snippets +- if current_user + = render 'head' - .pull-right - - if current_user - = link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do - Add new snippet - = link_to user_snippets_path(current_user), class: "btn btn-grouped" do - Your snippets - -%p.light +.slead Public snippets created by you and other users are listed here -%hr = render 'snippets' diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 089e8122918..aed00f9caeb 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -1,5 +1,5 @@ - page_title @snippet.title, "Snippets" -%h3.page-title +%h4.page-title = @snippet.title - if @snippet.private? @@ -8,17 +8,14 @@ private .pull-right - = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do + = link_to new_snippet_path, class: "btn btn-new btn-sm", title: "New Snippet" do Add new snippet -%hr -.append-bottom-20 +.append-bottom-10.prepend-top-10 .pull-right - = "##{@snippet.id}" %span.light - by + created by = link_to user_snippets_path(@snippet.author) do - = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: '' = @snippet.author_name .back-link @@ -27,7 +24,7 @@ ← your snippets - else = link_to snippets_path do - ← discover snippets + ← explore snippets .file-holder .file-title diff --git a/app/views/snippets/user_index.html.haml b/app/views/snippets/user_index.html.haml index 23700eb39da..7af5352da34 100644 --- a/app/views/snippets/user_index.html.haml +++ b/app/views/snippets/user_index.html.haml @@ -1,14 +1,13 @@ - page_title "Snippets", @user.name -%h3.page-title - = image_tag avatar_icon(@user.email), class: "avatar s24" - = @user.name - %span - \/ - Snippets - - if current_user - = link_to new_snippet_path, class: "btn btn-sm add_new pull-right", title: "New Snippet" do - Add new snippet -%hr +%ol.breadcrumb + %li + = link_to snippets_path do + Snippets + %li + = @user.name + .pull-right.hidden-xs + = link_to user_path(@user) do + #{@user.name} profile page = render 'snippets' diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index 72d873caa57..92e099315d8 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -26,7 +26,7 @@ module SharedActiveTab end step 'the active main tab should be Home' do - ensure_active_main_tab('Your Projects') + ensure_active_main_tab('Projects') end step 'the active main tab should be Projects' do |