Commit 96cb988ce7ea4ca43cb5fc3f233db8cd54a52ede

Authored by Victor Costa
1 parent 9c4dd907

Fix merge with next

app/helpers/box_organizer_helper.rb
@@ -10,9 +10,9 @@ module BoxOrganizerHelper @@ -10,9 +10,9 @@ module BoxOrganizerHelper
10 elsif plugin && File.exists?(File.join(Rails.root, 'public', plugin.public_path, 'images', block.icon_path)) 10 elsif plugin && File.exists?(File.join(Rails.root, 'public', plugin.public_path, 'images', block.icon_path))
11 image_path = File.join('/', plugin.public_path, 'images', block.icon_path) 11 image_path = File.join('/', plugin.public_path, 'images', block.icon_path)
12 elsif File.exists?(File.join(Rails.root, 'public', 'images', block.icon_path)) 12 elsif File.exists?(File.join(Rails.root, 'public', 'images', block.icon_path))
13 - image_path = block.icon_path 13 + image_path = File.join('images', block.icon_path)
14 else 14 else
15 - image_path = block.default_icon_path 15 + image_path = File.join('images', block.default_icon_path)
16 end 16 end
17 17
18 image_tag(image_path, height: '48', width: '48', class: 'block-type-icon', alt: '' ) 18 image_tag(image_path, height: '48', width: '48', class: 'block-type-icon', alt: '' )
@@ -33,7 +33,7 @@ module BoxOrganizerHelper @@ -33,7 +33,7 @@ module BoxOrganizerHelper
33 images_path = Dir.glob(File.join(Rails.root, 'public', 'images', block.preview_path, '*')) if images_path.empty? 33 images_path = Dir.glob(File.join(Rails.root, 'public', 'images', block.preview_path, '*')) if images_path.empty?
34 images_path = images_path.map{|path| path.gsub(File.join(Rails.root, 'public'), '') } unless images_path.empty? 34 images_path = images_path.map{|path| path.gsub(File.join(Rails.root, 'public'), '') } unless images_path.empty?
35 35
36 - images_path = 1.upto(3).map{block.default_preview_path} if images_path.empty? 36 + images_path = 1.upto(3).map{File.join('images', block.default_preview_path)} if images_path.empty?
37 37
38 content_tag(:ul, 38 content_tag(:ul,
39 images_path.map do |preview| 39 images_path.map do |preview|
app/helpers/layout_helper.rb
@@ -28,7 +28,7 @@ module LayoutHelper @@ -28,7 +28,7 @@ module LayoutHelper
28 end 28 end
29 29
30 def noosfero_javascript 30 def noosfero_javascript
31 - plugins_javascripts = @plugins.flat_map{ |plugin| plugin.js_files.map{ |js| plugin.class.public_path(js, true) } }.flatten 31 + plugins_javascripts = @plugins.flat_map{ |plugin| Array.wrap(plugin.js_files).map{ |js| plugin.class.public_path(js, true) } }.flatten
32 32
33 output = '' 33 output = ''
34 output += render 'layouts/javascript' 34 output += render 'layouts/javascript'
public/javascripts/application.js
@@ -27,6 +27,9 @@ @@ -27,6 +27,9 @@
27 *= require manage-products.js 27 *= require manage-products.js
28 *= require catalog.js 28 *= require catalog.js
29 *= require autogrow.js 29 *= require autogrow.js
  30 +*= require slick.js
  31 +*= require select-or-die/_src/selectordie.js
  32 +*= require block-store.js
30 */ 33 */
31 34
32 // scope for noosfero stuff 35 // scope for noosfero stuff
public/javascripts/block_store.js
@@ -1,51 +0,0 @@ @@ -1,51 +0,0 @@
1 -jQuery(document).ready(function () {  
2 - jQuery("#block-types-navigation a.previous").hide();  
3 - jQuery('.block-types-group').first().show( 'slide', { direction : 'down' }, 1000, function() {  
4 - jQuery('.block-types-group').first().addClass('active');  
5 - jQuery(".block-types-group.active + .block-types-group").addClass('next');  
6 - jQuery('#block-types-navigation a.previous').click(PreviousSlide);  
7 - jQuery('#block-types-navigation a.next').click(NextSlide);  
8 - });  
9 -  
10 - firstBlockTypesGroup = jQuery(".block-types-group").first();  
11 - lastBlockTypesGroup = jQuery(".block-types-group").last();  
12 -});  
13 -  
14 -function NextSlide() {  
15 - activeBlockTypesGroup = jQuery(".block-types-group.active");  
16 - nextBlockTypesGroup = jQuery(".block-types-group.next").first();  
17 -  
18 - activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000);  
19 - nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000, function() {  
20 - activeBlockTypesGroup.removeClass('active');  
21 - activeBlockTypesGroup.addClass('prev');  
22 - nextBlockTypesGroup.removeClass('next');  
23 - nextBlockTypesGroup.addClass('active');  
24 - jQuery(".block-types-group.active + .block-types-group").addClass('next');  
25 - activeBlockTypesGroup = jQuery(".block-types-group.active");  
26 - jQuery("#block-types-navigation a.previous").show();  
27 -  
28 - if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) {  
29 - jQuery("#block-types-navigation a.next").hide();  
30 - }  
31 - });  
32 -}  
33 -  
34 -function PreviousSlide() {  
35 - activeBlockTypesGroup = jQuery(".block-types-group.active");  
36 - previousBlockTypesGroup = jQuery(".block-types-group.prev").last();  
37 -  
38 - activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 );  
39 - previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000, function() {  
40 - activeBlockTypesGroup.removeClass('active');  
41 - activeBlockTypesGroup.addClass('next');  
42 - previousBlockTypesGroup.removeClass('prev');  
43 - previousBlockTypesGroup.addClass('active');  
44 - activeBlockTypesGroup = jQuery(".block-types-group.active");  
45 - jQuery("#block-types-navigation a.next").show();  
46 -  
47 - if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) {  
48 - jQuery("#block-types-navigation a.previous").hide();  
49 - }  
50 - });  
51 -}  
public/stylesheets/application.css
@@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
14 * views specifics 14 * views specifics
15 *= require chat 15 *= require chat
16 *= require search 16 *= require search
  17 + *= require block-store
17 */ 18 */
18 19
19 /* browser fixes */ 20 /* browser fixes */