summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/dashboard_controller.rb6
-rw-r--r--app/views/dashboard/_project.html.haml12
-rw-r--r--app/views/dashboard/_projects.html.haml23
3 files changed, 26 insertions, 15 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 33b2a5cd7e7..ac319384434 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -5,10 +5,14 @@ class DashboardController < ApplicationController
before_filter :event_filter, only: :show
def show
+ # Fetch only 30 projects.
+ # If user needs more - point to Dashboard#projects page
+ @projects_limit = 30
+
@groups = current_user.authorized_groups.sort_by(&:human_name)
@has_authorized_projects = @projects.count > 0
@projects_count = @projects.count
- @projects = @projects.limit(20)
+ @projects = @projects.limit(@projects_limit)
@events = Event.in_projects(current_user.authorized_projects.pluck(:id))
@events = @event_filter.apply_filter(@events)
diff --git a/app/views/dashboard/_project.html.haml b/app/views/dashboard/_project.html.haml
new file mode 100644
index 00000000000..50b833f3d82
--- /dev/null
+++ b/app/views/dashboard/_project.html.haml
@@ -0,0 +1,12 @@
+= link_to project_path(project), class: dom_class(project) do
+ %span.namespace-name
+ - if project.namespace
+ = project.namespace.human_name
+ \/
+ %span.project-name.filter-title
+ = truncate(project.name, length: 25)
+ %span.arrow
+ %i.icon-angle-right
+ %span.last-activity
+ %span Last activity:
+ %span.date= project_last_activity(project)
diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml
index 90b843de016..b79b27fc95a 100644
--- a/app/views/dashboard/_projects.html.haml
+++ b/app/views/dashboard/_projects.html.haml
@@ -10,21 +10,16 @@
%ul.well-list.dash-list
- projects.each do |project|
%li.project-row
- = link_to project_path(project), class: dom_class(project) do
- %span.namespace-name
- - if project.namespace
- = project.namespace.human_name
- \/
- %span.project-name.filter-title
- = truncate(project.name, length: 25)
- %span.arrow
- %i.icon-angle-right
- %span.last-activity
- %span Last activity:
- %span.date= project_last_activity(project)
+ = render "project", project: project
+
- if projects.blank?
%li
%h3.nothing_here_message There are no projects here.
- - if @projects_count > 20
+ - if @projects_count > @projects_limit
%li.bottom
- %strong= link_to "show all projects", projects_dashboard_path
+ %span.light
+ #{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed.
+ .pull-right.append-right-10
+ = link_to projects_dashboard_path do
+ Show all
+ %i.icon-angle-right