summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-01-15 11:08:12 +0000
committerPhil Hughes <me@iamphill.com>2016-01-30 16:01:49 +0000
commit60139345403fe2ddeed27a49582800b365606e2c (patch)
treea12fc6af15077d5253495b5ff2c3a7067fe5648a
parenta5267d0fbdc3e67d7d7cf3445fd1470676accc7a (diff)
downloadgitlab-ce-60139345403fe2ddeed27a49582800b365606e2c.tar.gz
fixes issue when user is not logged in but viewing public project
-rw-r--r--app/helpers/projects_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index c175de94361..6c66d0f7251 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -54,13 +54,15 @@ module ProjectsHelper
link_to(simple_sanitize(owner.name), user_path(owner))
end
- all_projects = current_user.authorized_projects.sorted_by_activity.non_archived
+ all_projects = current_user.authorized_projects.sorted_by_activity.non_archived if current_user
- project_link = link_to project_path(project), {class: "project-item-select-holder js-projects-dropdown-toggle"} do
+ project_link = link_to project_path(project), {class: "project-item-select-holder #{"js-projects-dropdown-toggle" if current_user}"} do
link_output = simple_sanitize(project.name)
- link_output += content_tag :span, nil, {class: "fa fa-chevron-down dropdown-toggle-caret"}
+ link_output += content_tag :span, nil, {class: "fa fa-chevron-down dropdown-toggle-caret"} if current_user
- link_output += project_select_tag :project_path, class: "project-item-select js-projects-dropdown", data: { include_groups: false }
+ link_output += project_select_tag :project_path, class: "project-item-select js-projects-dropdown", data: { include_groups: false } if current_user
+
+ link_output
end
full_title = namespace_link + ' / ' + project_link