Commit 5fcfba27 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dashboard-titles' into 'master'

Clean up overlap between dashboard and explore

- Clean up overlap between dashboard and explore. ... 5d785457
  - Split up SnippetsController into separate dashboard and explore sections.
  - Use consistent page titles, header titles and sidebars between dashboard and explore sections when signed in or not.
- Consistently case `Back to X` links. 260fcd45
- Link to help from signin page bottom. d92696d3
- Make Help accessible for guests. c258e977

cc @dzaporozhets

See merge request !1260
parents 4f461fd4 a6997e33
class Dashboard::ProjectsController < Dashboard::ApplicationController class Dashboard::ProjectsController < Dashboard::ApplicationController
before_action :event_filter before_action :event_filter
def index
@projects = current_user.authorized_projects.sorted_by_activity.non_archived
@projects = @projects.includes(:namespace)
@last_push = current_user.recent_push
respond_to do |format|
format.html
format.atom do
event_filter
load_events
render layout: false
end
end
end
def starred def starred
@projects = current_user.starred_projects @projects = current_user.starred_projects
@projects = @projects.includes(:namespace, :forked_from_project, :tags) @projects = @projects.includes(:namespace, :forked_from_project, :tags)
......
class Dashboard::SnippetsController < Dashboard::ApplicationController
def index
@snippets = SnippetsFinder.new.execute(current_user,
filter: :by_user,
user: current_user,
scope: params[:scope]
)
@snippets = @snippets.page(params[:page]).per(PER_PAGE)
end
end
class DashboardController < Dashboard::ApplicationController class DashboardController < Dashboard::ApplicationController
before_action :load_projects, except: :activity
before_action :event_filter, only: :activity before_action :event_filter, only: :activity
respond_to :html respond_to :html
def show
@projects = @projects.includes(:namespace)
@last_push = current_user.recent_push
respond_to do |format|
format.html
format.atom do
event_filter
load_events
render layout: false
end
end
end
def merge_requests def merge_requests
@merge_requests = get_merge_requests_collection @merge_requests = get_merge_requests_collection
@merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE) @merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE)
...@@ -50,10 +35,6 @@ class DashboardController < Dashboard::ApplicationController ...@@ -50,10 +35,6 @@ class DashboardController < Dashboard::ApplicationController
protected protected
def load_projects
@projects = current_user.authorized_projects.sorted_by_activity.non_archived
end
def load_events def load_events
project_ids = project_ids =
if params[:filter] == "starred" if params[:filter] == "starred"
......
class Explore::ApplicationController < ApplicationController class Explore::ApplicationController < ApplicationController
skip_before_action :authenticate_user!, :reject_blocked
layout 'explore' layout 'explore'
end end
class Explore::GroupsController < Explore::ApplicationController class Explore::GroupsController < Explore::ApplicationController
skip_before_action :authenticate_user!,
:reject_blocked, :set_current_user_for_observers
def index def index
@groups = GroupsFinder.new.execute(current_user) @groups = GroupsFinder.new.execute(current_user)
@groups = @groups.search(params[:search]) if params[:search].present? @groups = @groups.search(params[:search]) if params[:search].present?
......
class Explore::ProjectsController < Explore::ApplicationController class Explore::ProjectsController < Explore::ApplicationController
skip_before_action :authenticate_user!,
:reject_blocked
def index def index
@projects = ProjectsFinder.new.execute(current_user) @projects = ProjectsFinder.new.execute(current_user)
@tags = @projects.tags_on(:tags) @tags = @projects.tags_on(:tags)
......
class Explore::SnippetsController < Explore::ApplicationController
def index
@snippets = SnippetsFinder.new.execute(current_user, filter: :all)
@snippets = @snippets.page(params[:page]).per(PER_PAGE)
end
end
...@@ -14,6 +14,10 @@ class GroupsController < Groups::ApplicationController ...@@ -14,6 +14,10 @@ class GroupsController < Groups::ApplicationController
layout :determine_layout layout :determine_layout
def index
redirect_to(current_user ? dashboard_groups_path : explore_groups_path)
end
def new def new
@group = Group.new @group = Group.new
end end
......
class HelpController < ApplicationController class HelpController < ApplicationController
skip_before_action :authenticate_user!, :reject_blocked
layout 'help' layout 'help'
def index def index
......
...@@ -24,7 +24,7 @@ class InvitesController < ApplicationController ...@@ -24,7 +24,7 @@ class InvitesController < ApplicationController
path = path =
if current_user if current_user
dashboard_path dashboard_projects_path
else else
new_user_session_path new_user_session_path
end end
...@@ -73,7 +73,7 @@ class InvitesController < ApplicationController ...@@ -73,7 +73,7 @@ class InvitesController < ApplicationController
path = group_path(group) path = group_path(group)
else else
label = "who knows what" label = "who knows what"
path = dashboard_path path = dashboard_projects_path
end end
[label, path] [label, path]
......
...@@ -78,7 +78,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -78,7 +78,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
@project.project_members.find_by(user_id: current_user).destroy @project.project_members.find_by(user_id: current_user).destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to dashboard_path } format.html { redirect_to dashboard_projects_path }
format.js { render nothing: true } format.js { render nothing: true }
end end
end end
......
...@@ -10,6 +10,10 @@ class ProjectsController < ApplicationController ...@@ -10,6 +10,10 @@ class ProjectsController < ApplicationController
layout :determine_layout layout :determine_layout
def index
redirect_to(current_user ? root_path : explore_root_path)
end
def new def new
@project = Project.new @project = Project.new
end end
...@@ -105,7 +109,7 @@ class ProjectsController < ApplicationController ...@@ -105,7 +109,7 @@ class ProjectsController < ApplicationController
if request.referer.include?('/admin') if request.referer.include?('/admin')
redirect_to admin_namespaces_projects_path redirect_to admin_namespaces_projects_path
else else
redirect_to dashboard_path redirect_to dashboard_projects_path
end end
rescue Projects::DestroyService::DestroyError => ex rescue Projects::DestroyService::DestroyError => ex
redirect_to edit_project_path(@project), alert: ex.message redirect_to edit_project_path(@project), alert: ex.message
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
# #
# For users who haven't customized the setting, we simply delegate to # For users who haven't customized the setting, we simply delegate to
# `DashboardController#show`, which is the default. # `DashboardController#show`, which is the default.
class RootController < DashboardController class RootController < Dashboard::ProjectsController
before_action :redirect_to_custom_dashboard, only: [:show] before_action :redirect_to_custom_dashboard, only: [:index]
def show def index
super super
end end
...@@ -20,6 +20,7 @@ class RootController < DashboardController ...@@ -20,6 +20,7 @@ class RootController < DashboardController
case current_user.dashboard case current_user.dashboard
when 'stars' when 'stars'
flash.keep
redirect_to starred_dashboard_projects_path redirect_to starred_dashboard_projects_path
else else
return return
......
...@@ -24,13 +24,9 @@ class SnippetsController < ApplicationController ...@@ -24,13 +24,9 @@ class SnippetsController < ApplicationController
scope: params[:scope] }). scope: params[:scope] }).
page(params[:page]).per(PER_PAGE) page(params[:page]).per(PER_PAGE)
if @user == current_user render 'index'
render 'current_user_index'
else else
render 'user_index' redirect_to(current_user ? dashboard_snippets_path : explore_snippets_path)
end
else
@snippets = SnippetsFinder.new.execute(current_user, filter: :all).page(params[:page]).per(PER_PAGE)
end end
end end
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- if current_user - if current_user
%ul.nav.nav-pills.event_filter.pull-right %ul.nav.nav-pills.event_filter.pull-right
%li.pull-right %li.pull-right
= link_to dashboard_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do = link_to dashboard_projects_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do
%i.fa.fa-rss %i.fa.fa-rss
= render 'shared/event_filter' = render 'shared/event_filter'
......
%ul.center-top-menu %ul.center-top-menu
= nav_link(page: [dashboard_groups_path]) do = nav_link(page: dashboard_groups_path) do
= link_to dashboard_groups_path, title: 'Your groups', data: {placement: 'right'} do = link_to dashboard_groups_path, title: 'Your groups', data: {placement: 'right'} do
Your Groups Your Groups
= nav_link(page: [explore_groups_path]) do = nav_link(page: explore_groups_path) do
= link_to explore_groups_path, title: 'Explore groups', data: {placement: 'bottom'} do = link_to explore_groups_path, title: 'Explore groups', data: {placement: 'bottom'} do
Explore Groups Explore Groups
%ul.center-top-menu %ul.center-top-menu
= nav_link(path: ['dashboard#show', 'root#show']) do = nav_link(path: ['projects#index', 'root#index']) do
= link_to dashboard_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do = link_to dashboard_projects_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
Your Projects Your Projects
= nav_link(page: starred_dashboard_projects_path) 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
......
%ul.center-top-menu
= nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do
= link_to dashboard_snippets_path, title: 'Your snippets', data: {placement: 'right'} do
Your Snippets
= nav_link(page: explore_snippets_path) do
= link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do
Explore Snippets
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - if current_user
= auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity") = auto_discovery_link_tag(:atom, dashboard_projects_url(format: :atom, private_token: current_user.private_token), title: "All activity")
- page_title "Activity"
- header_title "Activity", activity_dashboard_path - header_title "Activity", activity_dashboard_path
= render 'dashboard/activity_head' = render 'dashboard/activity_head'
%section.activities %section.activities
......
xml.instruct! xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "Activity" xml.title "Activity"
xml.link href: dashboard_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: dashboard_url, rel: "alternate", type: "text/html" xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html"
xml.id dashboard_url xml.id dashboard_projects_url
xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any?
@events.each do |event| @events.each do |event|
......
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - if current_user
= auto_discovery_link_tag(:atom, dashboard_url(format: :atom, private_token: current_user.private_token), title: "All activity") = auto_discovery_link_tag(:atom, dashboard_projects_url(format: :atom, private_token: current_user.private_token), title: "All activity")
- page_title "Projects"
- header_title "Projects", root_path
- header_title "Projects", (current_user ? root_path : explore_root_path)
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- if @last_push - if @last_push
......
- page_title "Starred Projects" - page_title "Starred Projects"
- header_title "Projects", (current_user ? root_path : explore_root_path) - header_title "Projects", projects_path
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- if @projects.any? - if @projects.any?
= render 'dashboard/projects' = render 'projects'
- else - else
%h3 You don't have starred projects yet %h3 You don't have starred projects yet
%p.slead Visit project page and press on star icon and it will appear on this page. %p.slead Visit project page and press on star icon and it will appear on this page.
- page_title "Your Snippets" - page_title "Snippets"
= render 'head' - header_title "Snippets", dashboard_snippets_path
= render 'dashboard/snippets_head'
.gray-content-block .gray-content-block
.pull-right .pull-right
...@@ -11,26 +13,26 @@ ...@@ -11,26 +13,26 @@
%ul.nav.nav-tabs.prepend-top-20 %ul.nav.nav-tabs.prepend-top-20
= nav_tab :scope, nil do = nav_tab :scope, nil do
= link_to user_snippets_path(@user) do = link_to dashboard_snippets_path do
All All
%span.badge %span.badge
= @user.snippets.count = current_user.snippets.count
= nav_tab :scope, 'are_private' do = nav_tab :scope, 'are_private' do
= link_to user_snippets_path(@user, scope: 'are_private') do = link_to dashboard_snippets_path(scope: 'are_private') do
Private Private
%span.badge %span.badge
= @user.snippets.are_private.count = current_user.snippets.are_private.count
= nav_tab :scope, 'are_internal' do = nav_tab :scope, 'are_internal' do
= link_to user_snippets_path(@user, scope: 'are_internal') do = link_to dashboard_snippets_path(scope: 'are_internal') do
Internal Internal
%span.badge %span.badge
= @user.snippets.are_internal.count = current_user.snippets.are_internal.count
= nav_tab :scope, 'are_public' do = nav_tab :scope, 'are_public' do
= link_to user_snippets_path(@user, scope: 'are_public') do = link_to dashboard_snippets_path(scope: 'are_public') do
Public Public
%span.badge %span.badge
= @user.snippets.are_public.count = current_user.snippets.are_public.count
.my-snippets .my-snippets
= render 'snippets' = render 'snippets/snippets'
.explore-title
%h3
Explore GitLab
%p.lead
Discover projects, groups and snippets. Share your projects with others
%br
- page_title "Groups" - page_title "Groups"
- header_title "Groups", (current_user ? dashboard_groups_path : explore_groups_path) - header_title "Groups", dashboard_groups_path
- if current_user - if current_user
= render 'dashboard/groups_head' = render 'dashboard/groups_head'
- else
= render 'explore/head'
.gray-content-block.clearfix .gray-content-block.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|
......
- page_title "Projects" - page_title "Projects"
- header_title "Projects", root_path
- if current_user - if current_user
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- else
= render 'explore/head'
.gray-content-block.clearfix .gray-content-block.clearfix
= render 'filter' = render 'filter'
= render 'projects', projects: @projects = render 'projects', projects: @projects
......
- page_title "Starred Projects" - page_title "Projects"
- header_title "Projects", root_path
- if current_user - if current_user
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- else
= render 'explore/head'
.explore-trending-block .explore-trending-block
.gray-content-block .gray-content-block
......
- page_title "Trending Projects" - page_title "Projects"
- header_title "Projects", root_path
- if current_user - if current_user
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- else - else
.explore-title = render 'explore/head'
%h3
Explore GitLab
%p.lead
Discover projects and groups. Share your projects with others
%br
.explore-trending-block .explore-trending-block
.gray-content-block .gray-content-block
.pull-right .pull-right
......
- page_title "Snippets"
- header_title "Snippets", snippets_path
- if current_user
= render 'dashboard/snippets_head'
- else
= render 'explore/head'
.gray-content-block
- if current_user
.pull-right
= link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
Add new snippet
.oneline
Public snippets created by you and other users are listed here
= render 'snippets/snippets'
- page_title @file.humanize, *@category.split("/").reverse.map(&:humanize) - page_title @file.humanize, *@category.split("/").reverse.map(&:humanize)
.documentation.wiki .documentation.wiki
= markdown @markdown.gsub('$your_email', current_user.email) = markdown @markdown.gsub('$your_email', current_user.try(:email) || "email@example.com")
...@@ -6,10 +6,14 @@ ...@@ -6,10 +6,14 @@
= brand_header_logo = brand_header_logo
.gitlab-text-container .gitlab-text-container
%h3 GitLab %h3 GitLab
- if defined?(sidebar) && sidebar - if defined?(sidebar) && sidebar
= render "layouts/nav/#{sidebar}" = render "layouts/nav/#{sidebar}"
- elsif current_user - elsif current_user
= render 'layouts/nav/dashboard' = render 'layouts/nav/dashboard'
- else
= render 'layouts/nav/explore'
.collapse-nav .collapse-nav
= render partial: 'layouts/collapse_button' = render partial: 'layouts/collapse_button'
- if current_user - if current_user
......
...@@ -31,5 +31,5 @@ ...@@ -31,5 +31,5 @@
.container .container
.footer-links .footer-links
= link_to "Explore", explore_root_path = link_to "Explore", explore_root_path
= link_to "Documentation", "http://doc.gitlab.com/" = link_to "Help", help_path
= link_to "About GitLab", "https://about.gitlab.com/" = link_to "About GitLab", "https://about.gitlab.com/"
- page_title "Explore" - page_title "Explore"
- if current_user - unless current_user
- unless @header_title
- header_title "Projects", (current_user ? root_path : explore_root_path)
- else
- header_title "Explore GitLab", explore_root_path - 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#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = nav_link(path: ['root#index', '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 = link_to root_path, title: 'Projects', data: {placement: 'right'} do
= icon('home fw') = icon('home fw')
%span %span
Projects Projects
= nav_link(path: 'dashboard#activity') do = nav_link(path: 'dashboard#activity') do
= link_to activity_dashboard_path, title: 'Activity', data: {placement: 'right'} do = link_to activity_dashboard_path, class: 'shortcuts-activity', title: 'Activity', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Activity Activity
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to (current_user ? dashboard_groups_path : explore_groups_path), title: 'Groups', data: {placement: 'right'} do = link_to dashboard_groups_path, title: 'Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
%span %span
Groups Groups
- if current_user
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do = link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw') = icon('clock-o fw')
...@@ -33,7 +32,7 @@ ...@@ -33,7 +32,7 @@
Merge Requests Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count %span.count= current_user.assigned_merge_requests.opened.count
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to (current_user ? user_snippets_path(current_user) : snippets_path), title: 'Your snippets', data: {placement: 'right'} do = link_to dashboard_snippets_path, title: 'Your snippets', data: {placement: 'right'} do
= icon('clipboard fw') = icon('clipboard fw')
%span %span
Snippets Snippets
...@@ -42,10 +41,8 @@ ...@@ -42,10 +41,8 @@
= icon('question-circle fw') = icon('question-circle fw')
%span %span
Help Help
- if current_user
%li.separate-item
= nav_link(controller: :profile) do = nav_link(controller: :profile) do
= link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do = link_to profile_path, title: 'Profile settings', data: {placement: 'bottom'} do
= icon('user fw') = icon('user fw')
%span %span
Profile Settings Profile Settings
%ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects', data: {placement: 'right'} do
= icon('home fw')
%span
Projects
= nav_link(controller: :groups) do
= link_to explore_groups_path, title: 'Groups', data: {placement: 'right'} do
= icon('group fw')
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets', data: {placement: 'right'} do
= icon('clipboard fw')
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help', data: {placement: 'right'} do
= icon('question-circle fw')
%span
Help
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do = link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw') = icon('caret-square-o-left fw')
%span %span
Back to Dashboard Back to dashboard
%li.separate-item %li.separate-item
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do = link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw') = icon('caret-square-o-left fw')
%span %span
Back to Dashboard Back to dashboard
%li.separate-item %li.separate-item
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
= link_to group_path(@project.group), title: 'Back to group', data: {placement: 'right'}, class: 'back-link' do = link_to group_path(@project.group), title: 'Back to group', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw') = icon('caret-square-o-left fw')
%span %span
Back to Group Back to group
- else - else
= nav_link do = nav_link do
= link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do = link_to root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw') = icon('caret-square-o-left fw')
%span %span
Back to Dashboard Back to dashboard
%li.separate-item %li.separate-item
......
- page_title 'Snippets' - header_title "Snippets", snippets_path
- if current_user
- header_title "Snippets", user_snippets_path(current_user)
- else
- header_title 'Snippets', snippets_path
- sidebar "dashboard"
= render template: "layouts/application" = render template: "layouts/application"
- page_title "Activity"
= render 'projects/activity' = render 'projects/activity'
%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
- page_title "Public Snippets" - page_title "By #{@user.name}", "Snippets"
- if current_user
= render 'head' %ol.breadcrumb
%li
.gray-content-block = link_to snippets_path do
- if current_user Snippets
.pull-right %li
= link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do = @user.name
Add new snippet .pull-right.hidden-xs
= link_to user_path(@user) do
.oneline #{@user.name} profile page
Public snippets created by you and other users are listed here
= render 'snippets' = render 'snippets'
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
.back-link .back-link
- if @snippet.author == current_user - if @snippet.author == current_user
= link_to user_snippets_path(current_user) do = link_to dashboard_snippets_path do
&larr; your snippets &larr; your snippets
- else - else
= link_to snippets_path do = link_to explore_snippets_path do
&larr; explore snippets &larr; explore snippets
.file-holder .file-holder
......
- page_title "Snippets", @user.name
%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'
...@@ -143,6 +143,7 @@ Gitlab::Application.routes.draw do ...@@ -143,6 +143,7 @@ Gitlab::Application.routes.draw do
end end
resources :groups, only: [:index] resources :groups, only: [:index]
resources :snippets, only: [:index]
root to: 'projects#trending' root to: 'projects#trending'
end end
...@@ -263,24 +264,25 @@ Gitlab::Application.routes.draw do ...@@ -263,24 +264,25 @@ Gitlab::Application.routes.draw do
# #
# Dashboard Area # Dashboard Area
# #
resource :dashboard, controller: 'dashboard', only: [:show] do resource :dashboard, controller: 'dashboard', only: [] do
member do
get :issues get :issues
get :merge_requests get :merge_requests
get :activity get :activity
end
scope module: :dashboard do scope module: :dashboard do
resources :milestones, only: [:index, :show] resources :milestones, only: [:index, :show]
resources :groups, only: [:index] resources :groups, only: [:index]
resources :snippets, only: [:index]
resources :projects, only: [] do resources :projects, only: [:index] do
collection do collection do
get :starred get :starred
end end
end end
end end
root to: "dashboard/projects#index"
end end
# #
...@@ -304,7 +306,7 @@ Gitlab::Application.routes.draw do ...@@ -304,7 +306,7 @@ Gitlab::Application.routes.draw do
end end
end end
resources :projects, constraints: { id: /[^\/]+/ }, only: [:new, :create] resources :projects, constraints: { id: /[^\/]+/ }, only: [:index, :new, :create]
devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations } devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations }
...@@ -312,7 +314,7 @@ Gitlab::Application.routes.draw do ...@@ -312,7 +314,7 @@ Gitlab::Application.routes.draw do
get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
end end
root to: "root#show" root to: "root#index"
# #
# Project Area # Project Area
......
...@@ -6,7 +6,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -6,7 +6,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
include Select2Helper include Select2Helper
step 'I should see back to dashboard button' do step 'I should see back to dashboard button' do
expect(page).to have_content 'Back to Dashboard' expect(page).to have_content 'Back to dashboard'
end end
step 'gitlab user "Mike"' do step 'gitlab user "Mike"' do
......
...@@ -63,7 +63,7 @@ class Spinach::Features::Invites < Spinach::FeatureSteps ...@@ -63,7 +63,7 @@ class Spinach::Features::Invites < Spinach::FeatureSteps
end end
step 'I should be redirected to the dashboard' do step 'I should be redirected to the dashboard' do
expect(current_path).to eq(dashboard_path) expect(current_path).to eq(dashboard_projects_path)
end end
step 'I should see a notice telling me I have declined' do step 'I should see a notice telling me I have declined' do
......
...@@ -124,10 +124,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -124,10 +124,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end end
step 'I should see back to dashboard button' do step 'I should see back to dashboard button' do
expect(page).to have_content 'Back to Dashboard' expect(page).to have_content 'Back to dashboard'
end end
step 'I should see back to group button' do step 'I should see back to group button' do
expect(page).to have_content 'Back to Group' expect(page).to have_content 'Back to group'
end end
end end
...@@ -68,7 +68,7 @@ module SharedPaths ...@@ -68,7 +68,7 @@ module SharedPaths
# ---------------------------------------- # ----------------------------------------
step 'I visit dashboard page' do step 'I visit dashboard page' do
visit dashboard_path visit dashboard_projects_path
end end
step 'I visit dashboard activity page' do step 'I visit dashboard activity page' do
...@@ -460,7 +460,7 @@ module SharedPaths ...@@ -460,7 +460,7 @@ module SharedPaths
end end
step 'I visit snippets page' do step 'I visit snippets page' do
visit snippets_path visit explore_snippets_path
end end
step 'I visit new snippet page' do step 'I visit new snippet page' do
......
...@@ -4,7 +4,7 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps ...@@ -4,7 +4,7 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
include SharedSnippet include SharedSnippet
step 'I visit my snippets page' do step 'I visit my snippets page' do
visit user_snippets_path(current_user) visit dashboard_snippets_path
end end
step 'I should see "Personal snippet one" in snippets' do step 'I should see "Personal snippet one" in snippets' do
......
require 'spec_helper' require 'spec_helper'
describe RootController do describe RootController do
describe 'GET show' do describe 'GET index' do
context 'with a user' do context 'with a user' do
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -16,15 +16,15 @@ describe RootController do ...@@ -16,15 +16,15 @@ describe RootController do
end end
it 'redirects to their specified dashboard' do it 'redirects to their specified dashboard' do
get :show get :index
expect(response).to redirect_to starred_dashboard_projects_path expect(response).to redirect_to starred_dashboard_projects_path
end end
end end
context 'who uses the default dashboard setting' do context 'who uses the default dashboard setting' do
it 'renders the default dashboard' do it 'renders the default dashboard' do
get :show get :index
expect(response).to render_template 'dashboard/show' expect(response).to render_template 'dashboard/projects/index'
end end
end end
end end
......
...@@ -6,7 +6,7 @@ describe "Dashboard Feed", feature: true do ...@@ -6,7 +6,7 @@ describe "Dashboard Feed", feature: true do
context "projects atom feed via private token" do context "projects atom feed via private token" do
it "should render projects atom feed" do it "should render projects atom feed" do
visit dashboard_path(:atom, private_token: user.private_token) visit dashboard_projects_path(:atom, private_token: user.private_token)
expect(body).to have_selector('feed title') expect(body).to have_selector('feed title')
end end
end end
...@@ -20,7 +20,7 @@ describe "Dashboard Feed", feature: true do ...@@ -20,7 +20,7 @@ describe "Dashboard Feed", feature: true do
project.team << [user, :master] project.team << [user, :master]
issue_event(issue, user) issue_event(issue, user)
note_event(note, user) note_event(note, user)
visit dashboard_path(:atom, private_token: user.private_token) visit dashboard_projects_path(:atom, private_token: user.private_token)
end end
it "should have issue opened event" do it "should have issue opened event" do
......
...@@ -70,7 +70,7 @@ describe 'Profile > Preferences', feature: true do ...@@ -70,7 +70,7 @@ describe 'Profile > Preferences', feature: true do
expect(page.current_path).to eq starred_dashboard_projects_path expect(page.current_path).to eq starred_dashboard_projects_path
click_link 'Your Projects' click_link 'Your Projects'
expect(page.current_path).to eq dashboard_path expect(page.current_path).to eq dashboard_projects_path
end end
end end
......
...@@ -4,7 +4,7 @@ describe "Dashboard access", feature: true do ...@@ -4,7 +4,7 @@ describe "Dashboard access", feature: true do
include AccessMatchers include AccessMatchers
describe "GET /dashboard" do describe "GET /dashboard" do
subject { dashboard_path } subject { dashboard_projects_path }
it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :admin }
it { is_expected.to be_allowed_for :user } it { is_expected.to be_allowed_for :user }
...@@ -40,7 +40,7 @@ describe "Dashboard access", feature: true do ...@@ -40,7 +40,7 @@ describe "Dashboard access", feature: true do
it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :admin }
it { is_expected.to be_allowed_for :user } it { is_expected.to be_allowed_for :user }
it { is_expected.to be_denied_for :visitor } it { is_expected.to be_allowed_for :visitor }
end end
describe "GET /projects/new" do describe "GET /projects/new" do
......
...@@ -206,7 +206,7 @@ end ...@@ -206,7 +206,7 @@ end
# dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests # dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests
describe DashboardController, "routing" do describe DashboardController, "routing" do
it "to #index" do it "to #index" do
expect(get("/dashboard")).to route_to('dashboard#show') expect(get("/dashboard")).to route_to('dashboard/projects#index')
end end
it "to #issues" do it "to #issues" do
...@@ -220,8 +220,8 @@ end ...@@ -220,8 +220,8 @@ end
# root / root#show # root / root#show
describe RootController, 'routing' do describe RootController, 'routing' do
it 'to #show' do it 'to #index' do
expect(get('/')).to route_to('root#show') expect(get('/')).to route_to('root#index')
end end
end end
......
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