2011-07-29 20:05:47 +02:00
|
|
|
class PrefsController < ApplicationController
|
|
|
|
|
|
|
|
before_filter :check_current_user,:selected_folder
|
|
|
|
|
2011-08-16 20:05:58 +02:00
|
|
|
before_filter :get_current_folders
|
|
|
|
|
2011-09-03 13:07:40 +02:00
|
|
|
before_filter :get_prefs, :only => [:look,:update_look]
|
2011-07-31 22:45:29 +02:00
|
|
|
|
2011-07-29 20:05:47 +02:00
|
|
|
theme :theme_resolver
|
|
|
|
|
2011-09-03 13:07:40 +02:00
|
|
|
def update_look
|
2011-08-16 20:05:58 +02:00
|
|
|
if params[:prefs]
|
|
|
|
@prefs.update_attributes(params[:prefs])
|
|
|
|
end
|
2011-09-09 22:10:25 +02:00
|
|
|
flash[:notice] = t(:were_saved,:scope=>:prefs)
|
2011-09-03 13:07:40 +02:00
|
|
|
redirect_to :action => 'look'
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_servers
|
|
|
|
|
|
|
|
redirect_to :action => 'servers'
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_identity
|
|
|
|
if params[:user]
|
|
|
|
@current_user.update_attributes(params[:user])
|
|
|
|
end
|
|
|
|
redirect_to :action => 'identity'
|
|
|
|
end
|
|
|
|
|
|
|
|
def look
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def identity
|
|
|
|
@identity = @curent_user
|
|
|
|
end
|
|
|
|
|
|
|
|
def servers
|
|
|
|
@servers = @current_user.servers
|
2011-07-29 20:05:47 +02:00
|
|
|
end
|
|
|
|
|
2011-09-03 13:07:40 +02:00
|
|
|
############################# protected section ##################################
|
2011-08-16 20:05:58 +02:00
|
|
|
|
|
|
|
def get_prefs
|
|
|
|
@prefs = @current_user.prefs
|
|
|
|
end
|
2011-07-29 20:05:47 +02:00
|
|
|
end
|