diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 13d8000873bc6aacdec5b19861e4dee82e879b12..f320e819e26d5f6c091f831c5f6a4016e4ff5095 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -2,9 +2,9 @@ class DashboardController < ApplicationController respond_to :html before_filter :load_projects - before_filter :event_filter, only: :index + before_filter :event_filter, only: :show - def index + def show @groups = current_user.authorized_groups @has_authorized_projects = @projects.count > 0 @teams = current_user.authorized_teams diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 0baa5b4108ee3b049c944d375ac18102252e79c9..c759dffa16e1fcd501ad348dfc53509fdd594fa0 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -9,9 +9,9 @@ module DashboardHelper case entity when 'issue' then - dashboard_issues_path(options) + issues_dashboard_path(options) when 'merge_request' - dashboard_merge_requests_path(options) + merge_requests_dashboard_path(options) end end diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml index d7273fdca34542188577583bef1a599ec0b5cf80..f2acd2b0b0c66ba636447bfcb69769a598d358a0 100644 --- a/app/views/dashboard/_projects.html.haml +++ b/app/views/dashboard/_projects.html.haml @@ -28,4 +28,4 @@ %h3.nothing_here_message There are no projects here. - if @projects_count > 20 %li.bottom - %strong= link_to "show all projects", dashboard_projects_path + %strong= link_to "show all projects", projects_dashboard_path diff --git a/app/views/dashboard/issues.atom.builder b/app/views/dashboard/issues.atom.builder index 28bdc5ed814e8083c300f63d9c2d9d45403f3f11..0f0f3466e92dce54addf87855d1a39f993673f1c 100644 --- a/app/views/dashboard/issues.atom.builder +++ b/app/views/dashboard/issues.atom.builder @@ -1,9 +1,9 @@ xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.title "#{current_user.name} issues" - xml.link :href => dashboard_issues_url(:atom, :private_token => current_user.private_token), :rel => "self", :type => "application/atom+xml" - xml.link :href => dashboard_issues_url(:private_token => current_user.private_token), :rel => "alternate", :type => "text/html" - xml.id dashboard_issues_url(:private_token => current_user.private_token) + xml.link :href => issues_dashboard_url(:atom, :private_token => current_user.private_token), :rel => "self", :type => "application/atom+xml" + xml.link :href => issues_dashboard_url(:private_token => current_user.private_token), :rel => "alternate", :type => "text/html" + xml.id issues_dashboard_url(:private_token => current_user.private_token) xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? @issues.each do |issue| diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index cfbb332a91a2c8621e2013caecd69194f2294f12..e6c710e68e990a268ca8ce0b70ce5826a1a833ac 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -8,19 +8,20 @@ %i.icon-plus New Project + %hr .row .span3 %ul.nav.nav-pills.nav-stacked = nav_tab :scope, nil do - = link_to "All", dashboard_projects_path + = link_to "All", projects_dashboard_path = nav_tab :scope, 'personal' do - = link_to "Personal", dashboard_projects_path(scope: 'personal') + = link_to "Personal", projects_dashboard_path(scope: 'personal') = nav_tab :scope, 'joined' do - = link_to "Joined", dashboard_projects_path(scope: 'joined') + = link_to "Joined", projects_dashboard_path(scope: 'joined') .span9 - = form_tag dashboard_projects_path, method: 'get' do + = form_tag projects_dashboard_path, method: 'get' do %fieldset.dashboard-search-filter = hidden_field_tag "scope", params[:scope] = search_field_tag "search", params[:search], { placeholder: 'Search', class: 'left input-xxlarge' } @@ -29,16 +30,25 @@ %ul.well-list - @projects.each do |project| - %li - = link_to project_path(project), class: dom_class(project) do - - if project.namespace - = project.namespace.human_name - \/ - %strong.well-title - = truncate(project.name, length: 25) - %span.right.light + %li.clearfix + .left + = link_to project_path(project), class: dom_class(project) do + - if project.namespace + = project.namespace.human_name + \/ + %strong.well-title + = truncate(project.name, length: 25) + %br + %small.light %strong Last activity: %span= project_last_activity(project) + .right.light + - if project.owner == current_user + %i.icon-wrench + - tm = project.team.get_tm(current_user.id) + - if tm + = tm.project_access_human + - if @projects.blank? %li %h3.nothing_here_message There are no projects here. diff --git a/app/views/dashboard/index.atom.builder b/app/views/dashboard/show.atom.builder similarity index 100% rename from app/views/dashboard/index.atom.builder rename to app/views/dashboard/show.atom.builder diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/show.html.haml similarity index 100% rename from app/views/dashboard/index.html.haml rename to app/views/dashboard/show.html.haml diff --git a/app/views/dashboard/index.js.haml b/app/views/dashboard/show.js.haml similarity index 100% rename from app/views/dashboard/index.js.haml rename to app/views/dashboard/show.js.haml diff --git a/app/views/groups/issues.atom.builder b/app/views/groups/issues.atom.builder index 5bd07bcd89ff2352c63d43feb9c3d71cdad6e495..701747bdbc3242cfd894e95ed4666dc4b0331c16 100644 --- a/app/views/groups/issues.atom.builder +++ b/app/views/groups/issues.atom.builder @@ -1,9 +1,9 @@ xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.title "#{@user.name} issues" - xml.link :href => dashboard_issues_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml" - xml.link :href => dashboard_issues_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html" - xml.id dashboard_issues_url(:private_token => @user.private_token) + xml.link :href => issues_dashboard_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml" + xml.link :href => issues_dashboard_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html" + xml.id issues_dashboard_url(:private_token => @user.private_token) xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? @issues.each do |issue| diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0a83be3fd2e42fa3b73402f3c7dfaf90446579a5..261a8608ca42c907418762fe9c36949b56075dcc 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,17 +6,17 @@ = render "layouts/head_panel", title: "Dashboard" .container %ul.main_menu - = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do + = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do = link_to "Home", root_path, title: "Home" = nav_link(path: 'dashboard#projects') do - = link_to dashboard_projects_path do + = link_to projects_dashboard_path do Projects = nav_link(path: 'dashboard#issues') do - = link_to dashboard_issues_path do + = link_to issues_dashboard_path do Issues %span.count= current_user.assigned_issues.opened.count = nav_link(path: 'dashboard#merge_requests') do - = link_to dashboard_merge_requests_path do + = link_to merge_requests_dashboard_path do Merge Requests %span.count= current_user.cared_merge_requests.opened.count = nav_link(path: 'search#show') do diff --git a/config/routes.rb b/config/routes.rb index 6bbcf49ab5ced302d7434dbda5ef2611c6a620c0..7ffa081ac326b05b069e938fb61f344f9a846f6d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -118,10 +118,13 @@ Gitlab::Application.routes.draw do # # Dashboard Area # - get "dashboard" => "dashboard#index" - get "dashboard/projects" => "dashboard#projects" - get "dashboard/issues" => "dashboard#issues" - get "dashboard/merge_requests" => "dashboard#merge_requests" + resource :dashboard, controller: "dashboard" do + member do + get :projects + get :issues + get :merge_requests + end + end # # Groups Area @@ -285,5 +288,5 @@ Gitlab::Application.routes.draw do end end - root to: "dashboard#index" + root to: "dashboard#show" end