From 376bec26de89c3d287560e5fe755deeaffc68d67 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 28 Feb 2012 22:59:36 +0200 Subject: [PATCH] Added dashboard page. Projects page not root from now --- app/assets/images/Gear-UI.PNG | Bin 940 -> 0 bytes app/assets/images/admin.PNG | Bin 0 -> 556 bytes app/assets/stylesheets/common.scss | 30 ++++++++- app/assets/stylesheets/ui_basic.scss | 29 +++++++-- app/controllers/dashboard_controller.rb | 7 +++ app/views/dashboard/_projects_feed.html.haml | 25 +++----- app/views/dashboard/index.html.haml | 59 +++++++++++++++++- app/views/dashboard/issues.html.haml | 4 +- app/views/dashboard/merge_requests.html.haml | 4 +- app/views/layouts/_app_menu.html.haml | 2 +- app/views/layouts/_const_menu_links.html.haml | 2 +- app/views/layouts/_head_panel.html.haml | 6 +- app/views/layouts/application.html.haml | 4 +- app/views/projects/_tile.html.haml | 2 +- app/views/projects/index.html.haml | 4 ++ config/routes.rb | 2 +- 16 files changed, 141 insertions(+), 39 deletions(-) delete mode 100644 app/assets/images/Gear-UI.PNG create mode 100644 app/assets/images/admin.PNG diff --git a/app/assets/images/Gear-UI.PNG b/app/assets/images/Gear-UI.PNG deleted file mode 100644 index 7720f0eb21a3688ff8341a2e9d5d691b624c7566..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 940 zcmV;d15^BoP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyS? z5-S4fgewaG00S&ZL_t(Y$EDU!s8v-I2JqjxJ{1kp_ksptM1z|n8$^xD$jt6tp#8z5 zK@mg^A{$(Yh=j;OL+DMUf^5*FnnZ+=vCb=tdV^?CgZ@DSC5v*D`l5+u`kL&k$K$>4 zS*^*v`|Q2;_wBvb`u3`fu$h?|y=ezD?r~e2;^f`R6$Qp>;+9^?E%K zu`D8P$7}crI||4;Jc$?Z9`1*_u0_O(p?}*tZ6*y{g?)G!lXxg1cH*Vh9!p{G-o1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kleJO#u%*ZO_b3O4zs#%)Y)d+_;{O1SBa|Z}{tOcU0000 current_user.id).opened.order("created_at DESC").limit(10) + + @user = current_user + @issues = current_user.assigned_issues.opened.order("created_at DESC").limit(10) + @issues = @issues.includes(:author, :project) end # Get authored or assigned open merge requests diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 8171f59a60..228efa0848 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -1,17 +1,8 @@ -- @active_projects.first(3).each do |project| - = link_to project do - %h4= project.name - - project.updates(3).each do |update| - %a.project-update{:href => dashboard_feed_path(project, update)} - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32 - %div - = dashboard_feed_title(update) - %span.update-author - %strong= update.author_name - authored - = time_ago_in_words(update.created_at) - ago - .right - - klass = update.class.to_s.split("::").last.downcase - %span.tag{ :class => klass }= klass - +- @active_projects.first(10).each do |project| + .wll + = link_to project do + %h4 + = project.name + %small + last activity at + = project.last_activity_date_cached.stamp("Aug 25, 2011") diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 3eba2f47bf..9d7cf6c964 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1,3 +1,56 @@ -%h3 Activities -%hr -.news-feed= render "dashboard/projects_feed" +- if current_user.require_ssh_key? + .alert-message.warning + %p + You wont be able to pull/push project code unless you + = link_to new_key_path, :class => "vlink" do + add new key + to your profile + +%div.dashboard_category + %h3 + Projects + %small + ( most recent ) + + %strong.right + = link_to projects_path do + Projects list → + %hr + .row + .dashboard_block + .row + .span9= render "dashboard/projects_feed" + .span3.right + - if current_user.can_create_project? + .alert-message.block-message.warning + You can create up to + = current_user.projects_limit + projects. Click on link below to add a new one + .link_holder + = link_to new_project_path, :class => "" do + New Project ยป + + +- unless @merge_requests.blank? + %div.dashboard_category + %h3 + Merge Requests + %small ( authored or assigned to you ) + %strong.right + = link_to dashboard_merge_requests_path do + Vist merge requests page → + %hr + .row + .dashboard_block= render "dashboard/merge_requests_feed" + +- unless @issues.blank? + %div.dashboard_category + %h3 + Issues + %small ( assigned to you ) + %strong.right + = link_to dashboard_merge_requests_path do + Vist issues page → + %hr + .row + .dashboard_block= render "dashboard/issues_feed" diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 6db447fbee..b9c467a523 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -2,5 +2,5 @@ Issues %small ( assigned to you ) -%hr -= render "dashboard/issues_feed" +%br +.ui-box= render "dashboard/issues_feed" diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 91dd690991..ec1c233c33 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -2,5 +2,5 @@ Merge Requests %small ( authored or assigned to you ) -%hr -= render "dashboard/merge_requests_feed" +%br +.ui-box= render "dashboard/merge_requests_feed" diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml index c42bb3ebe7..27d9b458bc 100644 --- a/app/views/layouts/_app_menu.html.haml +++ b/app/views/layouts/_app_menu.html.haml @@ -1,6 +1,6 @@ %nav.main_menu = render "layouts/const_menu_links" - -#= link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path) || current_page?(root_path)}" + = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" = link_to "Issues", dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" = link_to "Requests", dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}" diff --git a/app/views/layouts/_const_menu_links.html.haml b/app/views/layouts/_const_menu_links.html.haml index c0b971c283..ffd028ec70 100644 --- a/app/views/layouts/_const_menu_links.html.haml +++ b/app/views/layouts/_const_menu_links.html.haml @@ -1 +1 @@ -= link_to "Home", root_path, :class => "home #{"current" if current_page?(projects_path) || current_page?(root_path)}", :title => "Home" += link_to "Home", root_path, :class => "home #{"current" if current_page?(dashboard_path) || current_page?(root_path)}", :title => "Home" diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 1b62ecf45f..e0cc4ab7c0 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -5,7 +5,11 @@ %div.app_logo = link_to root_path, :class => "home", :title => "Home" do = image_tag "logo_tr.png", :width => 50 - %h1 GITLAB + %h1 + GITLAB + + = link_to admin_projects_path, :class => "admin_link", :title => "Admin area" do + = image_tag "admin.PNG", :width => 16 %h1.project_name= title .search= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index f35d3fc435..8a1739f12a 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -7,6 +7,4 @@ .container = render :partial => "layouts/app_menu" .content - .row - .span12= yield - .sidebar= render "layouts/projects_side" + = yield diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml index 6b489303cc..e49aa07623 100644 --- a/app/views/projects/_tile.html.haml +++ b/app/views/projects/_tile.html.haml @@ -1,4 +1,4 @@ -- @projects.in_groups_of(2, false) do |projects| +- @projects.in_groups_of(3, false) do |projects| .row - projects.each_with_index do |project, i| %div.project_tile diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 32c4685fe0..3838c3398a 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -1,6 +1,10 @@ %h3 Projects %small= "( #{current_user.projects.count} )" + - if current_user.can_create_project? + %span.right + = link_to new_project_path, :class => "btn small" do + New Project %hr - unless @projects.empty? %div.content_list= render "tile" diff --git a/config/routes.rb b/config/routes.rb index 0f380095d3..77c2038047 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -123,5 +123,5 @@ Gitlab::Application.routes.draw do end resources :notes, :only => [:index, :create, :destroy] end - root :to => "projects#index" + root :to => "dashboard#index" end