summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-01-15 07:30:36 +0000
committerPhil Hughes <me@iamphill.com>2016-01-30 16:01:49 +0000
commit14394e8bad388dcb331f16353af46755740b216a (patch)
tree64cb9a78766bc139f81c8bf8d0f4e46be9f1a225
parent9040010481e6ab9b1d9ee2d0699dc99d1109f2f2 (diff)
downloadgitlab-ce-14394e8bad388dcb331f16353af46755740b216a.tar.gz
pulls in all user projects
-rw-r--r--app/assets/stylesheets/framework/header.scss8
-rw-r--r--app/helpers/projects_helper.rb13
2 files changed, 13 insertions, 8 deletions
diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss
index 0789d8133f9..c71c1cbae34 100644
--- a/app/assets/stylesheets/framework/header.scss
+++ b/app/assets/stylesheets/framework/header.scss
@@ -92,8 +92,16 @@ header {
display: inline-block;
}
+ .dropdown-menu {
+ max-height: 300px;
+ overflow: auto;
+ }
+
.dropdown-toggle-caret {
+ position: relative;
+ top: -2px;
margin-left: 5px;
+ font-size: 10px;
}
.dropdown-item {
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 5afbdb332cc..238bbbbe0a5 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -54,22 +54,19 @@ module ProjectsHelper
link_to(simple_sanitize(owner.name), user_path(owner))
end
- all_projects =
- if project.group
- project.group.projects
- else
- PersonalProjectsFinder.new(project.namespace.owner).execute(current_user)
- end
+ all_projects = current_user.authorized_projects.sorted_by_activity.non_archived
project_link = content_tag :div, {class: "dropdown"} do
output = content_tag :a, {class: "dropdown-toggle", href: "#", data: {toggle: "dropdown"}} do
btnOutput = simple_sanitize(project.name)
- btnOutput += content_tag :span, nil, {class: "caret dropdown-toggle-caret"}
+ btnOutput += content_tag :span, nil, {class: "fa fa-chevron-down dropdown-toggle-caret"}
end
list = all_projects.map do |project|
content_tag :li, {class: "dropdown-item #{"active" if project_id == project.id}"} do
- link_to(simple_sanitize(project.name), project_path(project), {class: "dropdown-link"})
+ link_to project_path(project), {class: "dropdown-link"} do
+ project.owner.name + ' / ' + simple_sanitize(project.name)
+ end
end
end