fixed/fluid layout switch
This commit is contained in:
parent
3ba392b3cb
commit
a9639776d7
8 changed files with 47 additions and 32 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue