Skip to content
Snippets Groups Projects
Commit 1d601616 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Pagination and better perfomance for projects page.

parent 60bf502b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -668,12 +668,15 @@ p.time {
}
}
}
.bottom {
padding:10px;
}
}
 
.btn {
&.very_small {
font-size:11px;
padding:4px;
padding:2px 6px;
margin:2px;
}
}
Loading
Loading
Loading
Loading
@@ -103,6 +103,11 @@ $hover: #FDF5D9;
*/
@import "sections/issues.scss";
 
/**
* Styles related to projects
*/
@import "sections/projects.scss";
/**
* This scss file redefine chozen selectbox styles for
* project Branch/Tag select element
Loading
Loading
.projects {
@extend .row;
.activities {
}
.side {
@extend .span4;
@extend .right;
.projects_box {
@extend .leftbar;
@extend .ui-box;
}
}
}
Loading
Loading
@@ -43,8 +43,8 @@ class CommitsController < ApplicationController
end
 
def compare
first = project.commit(params[:to])
last = project.commit(params[:from])
first = project.commit(params[:to].try(:strip))
last = project.commit(params[:from].try(:strip))
 
@diffs = []
@commits = []
Loading
Loading
Loading
Loading
@@ -11,9 +11,9 @@ class ProjectsController < ApplicationController
before_filter :require_non_empty_project, :only => [:blob, :tree, :graph]
 
def index
@projects = current_user.projects
@projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20)
@projects = current_user.projects.includes(:events).order("events.created_at DESC")
@projects = @projects.page(params[:page]).per(40)
@events = Event.where(:project_id => current_user.projects.map(&:id)).recent.limit(20)
end
 
def new
Loading
Loading
- if @projects.any?
.row
.span8
.projects
.activities.span8
- if current_user.require_ssh_key?
.alert.alert-error.padded
%span
Loading
Loading
@@ -14,24 +14,24 @@
- else
.padded
%strong.cgray Projects activity will be displayed here
.span4.right
%div.leftbar.ui-box
.side
.projects_box
%h5
Projects
%small
(#{@projects.count})
(#{@projects.total_count})
- if current_user.can_create_project?
%span.right
= link_to new_project_path, :class => "btn very_small info" do
New Project
.content_list
- @projects.each do |project|
= link_to project_path(project), :class => dom_class(project) do
%h4
%span.ico.project
= truncate(project.name, :length => 25)
%span.right
&rarr;
- @projects.each do |project|
= link_to project_path(project), :class => dom_class(project) do
%h4
%span.ico.project
= truncate(project.name, :length => 25)
%span.right
&rarr;
.bottom= paginate @projects, :theme => "gitlab"
 
- else
%h3 Nothing here
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment