[Git][noosfero/noosfero][master] 2 commits: Fix plugin compatibility with HTML decoupling

Joenio Costa gitlab at mg.gitlab.com
Tue Mar 15 22:15:49 BRT 2016


Joenio Costa pushed to branch master at Noosfero / noosfero


Commits:
5122d529 by Rafael Reggiani Manzo at 2016-03-15T21:40:01-03:00
Fix plugin compatibility with HTML decoupling

The core has been refactored in order to remove HTML generation from
models. On the other hand there are many plugins relying on such
behaviour.

This provides a failsafe in order to keep them working until the
necessary refactors for each plugin do not get done.

- - - - -
ef962840 by Joenio Costa at 2016-03-15T22:13:34-03:00
avoid error if cache folder already exists on quick-start

- - - - -


2 changed files:

- app/helpers/boxes_helper.rb
- script/quick-start


Changes:

=====================================
app/helpers/boxes_helper.rb
=====================================
--- a/app/helpers/boxes_helper.rb
+++ b/app/helpers/boxes_helper.rb
@@ -108,9 +108,20 @@ module BoxesHelper
   end
 
   def display_block_content(block, main_content = nil)
-    content = block.main? ? wrap_main_content(main_content) : render_block_content(block)
+    # FIXME: these conditionals should be removed after all block footer from plugins methods get refactored into helpers and views. They are a failsafe until all of them are done.
+    content = nil
+    if block.main?
+      content = wrap_main_content(main_content)
+    else
+      if(block.method(:content).owner != Block)
+        content = block.content()
+      else
+        content = render_block_content(block)
+      end
+    end
     result = extract_block_content(content)
-    footer_content = extract_block_content(render_block_footer(block))
+    # FIXME: this ternary conditional should be removed after all block footer from plugins methods get refactored into helpers and views
+    footer_content = extract_block_content(block.method(:footer).owner != Block ? block.footer : render_block_footer(block))
     unless footer_content.blank?
       footer_content = content_tag('div', footer_content, :class => 'block-footer-content' )
     end


=====================================
script/quick-start
=====================================
--- a/script/quick-start
+++ b/script/quick-start
@@ -130,7 +130,7 @@ fi
 # create needed directory
 mkdir -p tmp/pids
 mkdir -p tmp/cache
-mkdir cache
+mkdir -p cache
 
 # use default gitignore rules
 if [ ! -f .gitignore ]; then



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/62f8977239fbdc699d4f6e008edc05844f18d405...ef9628403ffaceb3924178882eeb21af6d27a17b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160316/e43efba5/attachment.html>


More information about the Noosfero-dev mailing list