summaryrefslogtreecommitdiff
path: root/app/helpers/preferences_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-06 17:52:15 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-10 21:28:41 +0300
commite585b77730b2a38173453bb5e437628fe6eb9844 (patch)
treedc17cbc02181b3fe8d987ba79226d05a4d4d650c /app/helpers/preferences_helper.rb
parent0b5a8a34e0b7851957b976a8151a7d6acf8b9f69 (diff)
downloadgitlab-ce-e585b77730b2a38173453bb5e437628fe6eb9844.tar.gz
Change project view default for existing users and anonymous visitors to files+readmedz-fix-project-view
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r--app/helpers/preferences_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index 243ef39ef61..de959f13713 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -63,6 +63,10 @@ module PreferencesHelper
end
def anonymous_project_view
- @project.empty_repo? || !can?(current_user, :download_code, @project) ? 'activity' : 'readme'
+ if !@project.empty_repo? && can?(current_user, :download_code, @project)
+ 'files'
+ else
+ 'activity'
+ end
end
end