Commit bc63865f82546fd7c1be86dd9574648922a9abb3

Authored by AntonioTerceiro
1 parent 94b55416

ActionItem296: removing sideboxes from header/footer edit

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2358 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/application.rb
@@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base @@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base
17 !@no_design_blocks 17 !@no_design_blocks
18 end 18 end
19 def uses_design_blocks? 19 def uses_design_blocks?
20 - self.class.uses_design_blocks? 20 + !@no_design_blocks && self.class.uses_design_blocks?
21 end 21 end
22 module UsesDesignBlocksHelper 22 module UsesDesignBlocksHelper
23 def uses_design_blocks? 23 def uses_design_blocks?
app/controllers/my_profile/profile_editor_controller.rb
@@ -50,6 +50,7 @@ class ProfileEditorController < MyProfileController @@ -50,6 +50,7 @@ class ProfileEditorController < MyProfileController
50 end 50 end
51 51
52 def header_footer 52 def header_footer
  53 + @no_design_blocks = true
53 if request.post? 54 if request.post?
54 @profile.update_attributes!(:custom_footer => params[:custom_footer], :custom_header => params[:custom_header]) 55 @profile.update_attributes!(:custom_footer => params[:custom_footer], :custom_header => params[:custom_header])
55 redirect_to :action => 'index' 56 redirect_to :action => 'index'
app/views/profile_editor/header_footer.rhtml
@@ -4,8 +4,10 @@ @@ -4,8 +4,10 @@
4 4
5 <% form_tag do %> 5 <% form_tag do %>
6 <div style='width: 90%; margin: auto;'> 6 <div style='width: 90%; margin: auto;'>
7 - <%= labelled_form_field(_('Content for header '), text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;')) %>  
8 - <%= labelled_form_field(_('Content for footer'), text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;')) %> 7 + <h2><%= _('Content for header ') %></h2>
  8 + <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;') %>
  9 + <h2><%= _('Content for footer') %></h2>
  10 + <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;') %>
9 <% button_bar do %> 11 <% button_bar do %>
10 <%= submit_button(:save, _('Save')) %> 12 <%= submit_button(:save, _('Save')) %>
11 <%= button(:cancel, _('Cancel'), :action => 'index') %> 13 <%= button(:cancel, _('Cancel'), :action => 'index') %>