Class ThemesController
In: app/controllers/my_profile/themes_controller.rb
Parent: MyProfileController

Methods

Public Instance methods

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 36
36:   def add_css
37:     @theme = profile.find_theme(params[:id])
38:     if request.xhr?
39:       render :action => 'add_css', :layout => false
40:     else
41:       @theme.add_css(params[:css])
42:       redirect_to :action => 'edit', :id => @theme.id
43:     end
44:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 61
61:   def add_image
62:     @theme = profile.find_theme(params[:id])
63:     if request.xhr?
64:       render :action => 'add_image', :layout => false
65:     else
66:       @theme.add_image(params[:image].original_filename, params[:image].read)
67:       redirect_to :action => 'edit', :id => @theme.id
68:     end
69:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 46
46:   def css_editor
47:     @theme = profile.find_theme(params[:id])
48:     @css = params[:css]
49: 
50:     @code = @theme.read_css(@css)
51:     render :action => 'css_editor', :layout => false
52:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 30
30:   def edit
31:     @theme = profile.find_theme(params[:id])
32:     @css_files = @theme.css_files
33:     @image_files = @theme.image_files
34:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 11
11:   def index
12:     @themes = Theme.system_themes
13:     @current_theme = profile.theme
14: 
15:     @layout_templates = LayoutTemplate.all
16:     @current_template = profile.layout_template
17:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 19
19:   def new
20:     if !request.xhr?
21:       id = params[:name].to_slug
22:       t = Theme.new(id, :name => params[:name], :owner => profile)
23:       t.save
24:       redirect_to :action => 'index'
25:     else
26:       render :action => 'new', :layout => false
27:     end
28:   end

[Source]

   # File app/controllers/my_profile/themes_controller.rb, line 6
6:   def set
7:     profile.update_attributes!(:theme => params[:id])
8:     redirect_to :action => 'index'
9:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 81
81:   def set_layout_template
82:     profile.layout_template = params[:id]
83:     profile.save!
84:     redirect_to :action => 'index'
85:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 71
71:   def start_test
72:     session[:theme] = params[:id]
73:     redirect_to :controller => 'content_viewer', :profile => profile.identifier, :action => 'view_page'
74:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 76
76:   def stop_test
77:     session[:theme] = nil
78:     redirect_to :action => 'index'
79:   end

[Source]

    # File app/controllers/my_profile/themes_controller.rb, line 55
55:   def update_css
56:     @theme = profile.find_theme(params[:id])
57:     @theme.update_css(params[:css], params[:csscode])
58:     redirect_to :action => 'edit', :id => @theme.id
59:   end

[Validate]