diff options
author | Cristian Bica <cristian.bica@gmail.com> | 2015-10-01 17:05:20 +0300 |
---|---|---|
committer | Cristian Bica <cristian.bica@gmail.com> | 2015-10-01 17:05:20 +0300 |
commit | c5280434399ee489eebda254b2d246252df68f2b (patch) | |
tree | 4a208c29c40202d5341534e5f822aea120d3a2b1 /app/helpers/preferences_helper.rb | |
parent | 2e8a3e3996f47a5b436bce9a6bbb61ca0a351cab (diff) | |
download | gitlab-ce-c5280434399ee489eebda254b2d246252df68f2b.tar.gz |
Allow users to select the Files view as default project view
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r-- | app/helpers/preferences_helper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb index 1b1f4162df4..f888c4a829b 100644 --- a/app/helpers/preferences_helper.rb +++ b/app/helpers/preferences_helper.rb @@ -27,7 +27,8 @@ module PreferencesHelper def project_view_choices [ ['Readme (default)', :readme], - ['Activity view', :activity] + ['Activity view', :activity], + ['Files view', :files] ] end @@ -43,4 +44,9 @@ module PreferencesHelper !current_user || current_user.project_view == 'readme' end + + def current_user_default_project_view + (current_user && current_user.project_view) || + 'readme' + end end |