Commit d88332709cfa42d7f1ccd9ab6bc7622b970ef9de
1 parent
c626ec37
Exists in
master
and in
4 other branches
Fixed group issues/mr. Also speedup project list of admin area
Showing
5 changed files
with
16 additions
and
6 deletions
Show diff stats
app/controllers/groups_controller.rb
... | ... | @@ -21,13 +21,15 @@ class GroupsController < ApplicationController |
21 | 21 | |
22 | 22 | # Get authored or assigned open merge requests |
23 | 23 | def merge_requests |
24 | - @merge_requests = current_user.cared_merge_requests.order("created_at DESC").page(params[:page]).per(20) | |
24 | + @merge_requests = current_user.cared_merge_requests | |
25 | + @merge_requests = @merge_requests.of_group(@group).order("created_at DESC").page(params[:page]).per(20) | |
25 | 26 | end |
26 | 27 | |
27 | 28 | # Get only assigned issues |
28 | 29 | def issues |
29 | 30 | @user = current_user |
30 | - @issues = current_user.assigned_issues.opened.order("created_at DESC").page(params[:page]).per(20) | |
31 | + @issues = current_user.assigned_issues.opened | |
32 | + @issues = @issues.of_group(@group).order("created_at DESC").page(params[:page]).per(20) | |
31 | 33 | @issues = @issues.includes(:author, :project) |
32 | 34 | |
33 | 35 | respond_to do |format| | ... | ... |
app/roles/issue_commonality.rb
... | ... | @@ -18,6 +18,7 @@ module IssueCommonality |
18 | 18 | |
19 | 19 | scope :opened, where(closed: false) |
20 | 20 | scope :closed, where(closed: true) |
21 | + scope :of_group, ->(group) { where(project_id: group.project_ids) } | |
21 | 22 | scope :assigned, lambda { |u| where(assignee_id: u.id)} |
22 | 23 | |
23 | 24 | delegate :name, | ... | ... |
app/views/admin/projects/index.html.haml
... | ... | @@ -12,7 +12,6 @@ |
12 | 12 | %th Name |
13 | 13 | %th Path |
14 | 14 | %th Team Members |
15 | - %th Post Receive | |
16 | 15 | %th Last Commit |
17 | 16 | %th Edit |
18 | 17 | %th.cred Danger Zone! |
... | ... | @@ -22,7 +21,6 @@ |
22 | 21 | %td= link_to project.name, [:admin, project] |
23 | 22 | %td= project.path |
24 | 23 | %td= project.users_projects.count |
25 | - %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true | |
26 | 24 | %td= last_commit(project) |
27 | 25 | %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" |
28 | 26 | %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" | ... | ... |
app/views/admin/projects/show.html.haml
... | ... | @@ -5,6 +5,15 @@ |
5 | 5 | %i.icon-edit |
6 | 6 | Edit |
7 | 7 | |
8 | +- if !@admin_project.has_post_receive_file? && @admin_project.commit | |
9 | + %br | |
10 | + .alert.alert-error | |
11 | + %span | |
12 | + %strong Important! | |
13 | + Project has commits but missing post-receive file. | |
14 | + %br | |
15 | + If you exported project manually - copy post-receive hook to bare repository | |
16 | + | |
8 | 17 | %br |
9 | 18 | %table.zebra-striped |
10 | 19 | %thead | ... | ... |
app/views/layouts/group.html.haml
... | ... | @@ -11,11 +11,11 @@ |
11 | 11 | = nav_link(path: 'groups#issues') do |
12 | 12 | = link_to issues_group_path(@group) do |
13 | 13 | Issues |
14 | - %span.count= current_user.assigned_issues.opened.count | |
14 | + %span.count= current_user.assigned_issues.opened.of_group(@group).count | |
15 | 15 | = nav_link(path: 'groups#merge_requests') do |
16 | 16 | = link_to merge_requests_group_path(@group) do |
17 | 17 | Merge Requests |
18 | - %span.count= current_user.cared_merge_requests.count | |
18 | + %span.count= current_user.cared_merge_requests.of_group(@group).count | |
19 | 19 | = nav_link(path: 'groups#search') do |
20 | 20 | = link_to "Search", search_group_path(@group) |
21 | 21 | = nav_link(path: 'groups#people') do | ... | ... |