Commit cb589d231aaa9f4cf7a10c41d6fd1ebe34428173
1 parent
f8f76fdb
Exists in
spb-stable
and in
3 other branches
Fix public project search
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
app/controllers/search_controller.rb
@@ -15,7 +15,7 @@ class SearchController < ApplicationController | @@ -15,7 +15,7 @@ class SearchController < ApplicationController | ||
15 | @total_results = @projects.count + @merge_requests.count + @issues.count + @wiki_pages.count + @blobs.total_count | 15 | @total_results = @projects.count + @merge_requests.count + @issues.count + @wiki_pages.count + @blobs.total_count |
16 | end | 16 | end |
17 | 17 | ||
18 | - private | 18 | + private |
19 | 19 | ||
20 | def find_project_ids(group_id, project_id) | 20 | def find_project_ids(group_id, project_id) |
21 | project_ids = current_user.authorized_projects.map(&:id) | 21 | project_ids = current_user.authorized_projects.map(&:id) |
@@ -26,7 +26,7 @@ class SearchController < ApplicationController | @@ -26,7 +26,7 @@ class SearchController < ApplicationController | ||
26 | project_ids.select! { |id| group_project_ids.include?(id) } | 26 | project_ids.select! { |id| group_project_ids.include?(id) } |
27 | elsif project_id.present? | 27 | elsif project_id.present? |
28 | @project = Project.find(project_id) | 28 | @project = Project.find(project_id) |
29 | - project_ids = @project.public ? [@project.id] : project_ids.select { |id| id == project_id.to_i } | 29 | + project_ids = @project.public? ? [@project.id] : project_ids.select { |id| id == project_id.to_i } |
30 | end | 30 | end |
31 | project_ids | 31 | project_ids |
32 | end | 32 | end |
app/views/admin/projects/show.html.haml
@@ -79,13 +79,14 @@ | @@ -79,13 +79,14 @@ | ||
79 | .title | 79 | .title |
80 | Transfer project | 80 | Transfer project |
81 | .body | 81 | .body |
82 | - = form_for @project, url: transfer_admin_project_path(@project), method: :put do |f| | 82 | + = form_for @project, url: transfer_admin_project_path(@project), method: :put, html: { class: 'form-horizontal' } do |f| |
83 | .form-group | 83 | .form-group |
84 | - = f.label :namespace_id, "Namespace" | 84 | + = f.label :namespace_id, "Namespace", class: 'control-label' |
85 | .col-sm-10 | 85 | .col-sm-10 |
86 | = namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large' | 86 | = namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large' |
87 | 87 | ||
88 | .form-group | 88 | .form-group |
89 | + .col-sm-2 | ||
89 | .col-sm-10 | 90 | .col-sm-10 |
90 | = f.submit 'Transfer', class: 'btn btn-primary' | 91 | = f.submit 'Transfer', class: 'btn btn-primary' |
91 | 92 |