app/views/layouts/tramway/landing/application.html.haml in tramway-landing-1.2.9 vs app/views/layouts/tramway/landing/application.html.haml in tramway-landing-1.2.10
- old
+ new
@@ -45,18 +45,20 @@
%body
= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/css/mdb.min.css'
= javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/js/mdb.js'
= javascript_include_tag 'https://cdn.rawgit.com/CezarLuiz0/anchor.js/master/dist/anchor.min.js'
= yield :body_content
+ - headers = @blocks.select { |block| block.model.block_type.header? }
+ - footers = @blocks.select { |block| block.model.block_type.footer? }
+ - other_blocks = @blocks - headers - footers
- if @blocks&.any?
-# FIXME
- = render "tramway/landing/blocks/block_types/header", block: @blocks.select { |block| block.model.block_type.header? }.first
+ = render "tramway/landing/blocks/block_types/header", block: headers.first
%main{ class: ('mt-5' if @blocks&.any?) }
.container
- - @blocks.each_with_index do |block, index|
- - if !block.model.block_type.header? && !block.model.block_type.footer?
- = render "tramway/landing/blocks/block_types/#{block.block_type}", block: block
- - if index < array_of_blocks.count - 1
- %hr
+ - other_blocks.each_with_index do |block, index|
+ = render "tramway/landing/blocks/block_types/#{block.model.block_type}", block: block
+ - if index < other_blocks.count - 1
+ %hr
.container-fluid
= yield
- = render "tramway/landing/blocks/block_types/footer", block: @blocks.select { |block| block.model.block_type.footer? }.first
+ = render "tramway/landing/blocks/block_types/footer", block: footers.first