fixed/fluid layout switch

This commit is contained in:
Dmitriy Zaporozhets 2011-11-04 00:37:02 +02:00
parent 3ba392b3cb
commit a9639776d7
8 changed files with 47 additions and 32 deletions

View file

@ -1,5 +1,7 @@
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :view_style
protect_from_forgery
helper_method :abilities, :can?
@ -73,4 +75,12 @@ class ApplicationController < ActionController::Base
def require_non_empty_project
redirect_to @project unless @project.repo_exists?
end
def view_style
if params[:view_style] == "collapsed"
cookies[:view_style] = "collapsed"
elsif params[:view_style] == "fluid"
cookies[:view_style] = ""
end
end
end