Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-18 18:57:01 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-18 18:57:01 +0400
commit2e5ed4ad5173ef52c9b8e341cede153c8dee013d (patch)
tree2d008753eae2830c108a45a5d84b115353d0adba /app
parentd702d744aa2501c98d6a69a5fb0296a756a893e4 (diff)
dashboard
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb34
1 files changed, 19 insertions, 15 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 7469b05b0be..6bcc14b5b20 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -6,7 +6,7 @@ class ProjectsController < ApplicationController
before_filter :authorize_read_project!, :except => [:index, :new, :create]
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
- before_filter :require_non_empty_project, :only => [:blob, :tree, :show]
+ before_filter :require_non_empty_project, :only => [:blob, :tree]
def index
@projects = current_user.projects.all
@@ -60,21 +60,25 @@ class ProjectsController < ApplicationController
end
def show
- @date = case params[:view]
- when "week" then Date.today - 7.days
- else Date.today
- end
-
- @heads = @project.repo.heads
- @commits = @heads.map do |h|
- @project.repo.log(h.name, nil, :since => @date - 1.day)
- end.flatten.uniq { |c| c.id }
-
- @commits.sort! do |x, y|
- y.committed_date <=> x.committed_date
- end
+ if @project.repo_exists?
+ @date = case params[:view]
+ when "week" then Date.today - 7.days
+ else Date.today
+ end
+
+ @heads = @project.repo.heads
+ @commits = @heads.map do |h|
+ @project.repo.log(h.name, nil, :since => @date - 1.day)
+ end.flatten.uniq { |c| c.id }
+
+ @commits.sort! do |x, y|
+ y.committed_date <=> x.committed_date
+ end
- @messages = project.notes.since(@date).limit(40).order("created_at DESC")
+ @messages = project.notes.since(@date).limit(40).order("created_at DESC")
+ else
+ return render "projects/empty"
+ end
end
#