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

Explain on dashboard that limit amount of projects displayed

parent a85c58c7
......@@ -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)
......
= 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)
......@@ -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
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