summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-13 18:24:15 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-13 18:24:15 +0200
commit5f34759ecb630ef410fe1025cf19e37f1dd4615f (patch)
tree1f60ae948caad68dc50092e2e790633b6a697bc0 /app/helpers
parent4f0455c96bc918040de25e03f1a0ff39d9517dc6 (diff)
downloadgitlab-ce-5f34759ecb630ef410fe1025cf19e37f1dd4615f.tar.gz
Allow user to specify content he wants to see on project pageproject-default-view
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/preferences_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index bceff4fd52e..ea774e28ecf 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -42,6 +42,13 @@ module PreferencesHelper
end
end
+ def project_view_choices
+ [
+ ['Readme (default)', :readme],
+ ['Activity view', :activity]
+ ]
+ end
+
def user_application_theme
theme = Gitlab::Themes.by_id(current_user.try(:theme_id))
theme.css_class
@@ -50,4 +57,9 @@ module PreferencesHelper
def user_color_scheme_class
COLOR_SCHEMES[current_user.try(:color_scheme_id)] if defined?(current_user)
end
+
+ def prefer_readme?
+ !current_user ||
+ current_user.project_view == 'readme'
+ end
end