Last active
December 19, 2015 16:39
-
-
Save leemour/5985418 to your computer and use it in GitHub Desktop.
Rails 4 HTML5 Haml layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- flash.each do |name, msg| | |
- if msg.is_a?(String) | |
%div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} | |
%a.close{"data-dismiss" => "alert"} × | |
= content_tag :div, msg, :id => "flash_#{name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html{:lang => 'ru'} | |
%head | |
%meta{:charset => 'utf-8'} | |
%meta{:name => :viewport, :content => 'width=device-width,initial-scale=1'} | |
%meta{ name: 'description', content: (defined? @page.description ? @page.description : '') }/ | |
%meta{ name: 'keywords', content: (defined? @page.keywords ? @page.keywords : '') }/ | |
%title= full_title(defined? @page.title ? @page.title : '') | |
= favicon_link_tag 'favicon.ico' | |
= stylesheet_link_tag "application", :media => "all" | |
= javascript_include_tag "application", "data-turbolinks-track" => true | |
= csrf_meta_tags | |
= yield(:head) | |
/[if lt IE 9] | |
%script{ :src => '//html5shiv.googlecode.com/svn/trunk/html5.js' } | |
%body{:class => "#{controller_name} #{action_name}"} | |
%header | |
.conatiner-fluid | |
.row-fluid | |
= render 'layouts/navigation' | |
%main#content{:role => "main"} | |
.conatiner-fluid | |
.row-fluid | |
.span12 | |
= render 'layouts/messages' | |
.row-fluid | |
%div.main.span8 | |
= yield | |
%aside.secondary.span4#sidebar | |
= render 'layouts/sidebar' | |
%footer | |
.container-fluid | |
.row-fuild | |
= render 'layouts/footer' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment