summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-04 10:51:35 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-04 10:51:35 +0300
commitd88332709cfa42d7f1ccd9ab6bc7622b970ef9de (patch)
tree7c48e0aecc07f40bd949e5f91449339ab7c3dbea
parentc626ec3746f0346a4a90ebf6a0860583b79dd250 (diff)
downloadgitlab-ce-d88332709cfa42d7f1ccd9ab6bc7622b970ef9de.tar.gz
Fixed group issues/mr. Also speedup project list of admin area
-rw-r--r--app/controllers/groups_controller.rb6
-rw-r--r--app/roles/issue_commonality.rb1
-rw-r--r--app/views/admin/projects/index.html.haml2
-rw-r--r--app/views/admin/projects/show.html.haml9
-rw-r--r--app/views/layouts/group.html.haml4
5 files changed, 16 insertions, 6 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 4a05434c783..c76e5c4c0bd 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -21,13 +21,15 @@ class GroupsController < ApplicationController
# Get authored or assigned open merge requests
def merge_requests
- @merge_requests = current_user.cared_merge_requests.order("created_at DESC").page(params[:page]).per(20)
+ @merge_requests = current_user.cared_merge_requests
+ @merge_requests = @merge_requests.of_group(@group).order("created_at DESC").page(params[:page]).per(20)
end
# Get only assigned issues
def issues
@user = current_user
- @issues = current_user.assigned_issues.opened.order("created_at DESC").page(params[:page]).per(20)
+ @issues = current_user.assigned_issues.opened
+ @issues = @issues.of_group(@group).order("created_at DESC").page(params[:page]).per(20)
@issues = @issues.includes(:author, :project)
respond_to do |format|
diff --git a/app/roles/issue_commonality.rb b/app/roles/issue_commonality.rb
index 55b46ec0c89..ab6f89ff0b8 100644
--- a/app/roles/issue_commonality.rb
+++ b/app/roles/issue_commonality.rb
@@ -18,6 +18,7 @@ module IssueCommonality
scope :opened, where(closed: false)
scope :closed, where(closed: true)
+ scope :of_group, ->(group) { where(project_id: group.project_ids) }
scope :assigned, lambda { |u| where(assignee_id: u.id)}
delegate :name,
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index 13b0b44acd6..3335fce0078 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -12,7 +12,6 @@
%th Name
%th Path
%th Team Members
- %th Post Receive
%th Last Commit
%th Edit
%th.cred Danger Zone!
@@ -22,7 +21,6 @@
%td= link_to project.name, [:admin, project]
%td= project.path
%td= project.users_projects.count
- %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true
%td= last_commit(project)
%td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
%td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index f16a0211a14..f85b6e4b865 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -5,6 +5,15 @@
%i.icon-edit
Edit
+- if !@admin_project.has_post_receive_file? && @admin_project.commit
+ %br
+ .alert.alert-error
+ %span
+ %strong Important!
+ Project has commits but missing post-receive file.
+ %br
+ If you exported project manually - copy post-receive hook to bare repository
+
%br
%table.zebra-striped
%thead
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index e4277eff668..985200e2539 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -11,11 +11,11 @@
= nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do
Issues
- %span.count= current_user.assigned_issues.opened.count
+ %span.count= current_user.assigned_issues.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do
Merge Requests
- %span.count= current_user.cared_merge_requests.count
+ %span.count= current_user.cared_merge_requests.of_group(@group).count
= nav_link(path: 'groups#search') do
= link_to "Search", search_group_path(@group)
= nav_link(path: 'groups#people') do