summaryrefslogtreecommitdiff
path: root/app/controllers/projects/application_controller.rb
diff options
context:
space:
mode:
authorkkm <kkm@smartaction.com>2015-10-22 18:52:17 -0700
committerRémy Coutable <remy@rymai.me>2016-02-05 15:40:44 +0100
commitcf1349adb7cba2e791a1f8d59e3a6a976b54e071 (patch)
treedb5e22ac1f105a5c1bb91cc5e2f5456bbf34ea01 /app/controllers/projects/application_controller.rb
parent9afcacb3a4f50d45d19b7222edbe0902daa35bb4 (diff)
downloadgitlab-ce-cf1349adb7cba2e791a1f8d59e3a6a976b54e071.tar.gz
Remember user's inline/tabular diff view preference in a cookie
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r--app/controllers/projects/application_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index dd32d509191..9096910b82c 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -26,6 +26,13 @@ class Projects::ApplicationController < ApplicationController
end
end
+ protected
+
+ def apply_diff_view_cookie!
+ view = params[:view] || cookies[:diff_view]
+ cookies.permanent[:diff_view] = params[:view] = view if view
+ end
+
private
def builds_enabled