Sha256: 26278233bdd73dafb8b59bf4ae69cbd997293dcef5058e8db5e21021080f6e49

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

run 'mkdir app/views/shared'

create_file 'app/views/shared/_header.html.haml' do
<<-FILE
%header#main_header
  %h1= link_to '#{app_name.humanize}', root_path
= render 'shared/messages'
%nav#main_nav
  %ul
    %li= link_to 'Home', root_path
FILE
end

create_file 'app/views/shared/_messages.html.haml' do
<<-FILE
- if flash[:notice]
  %div#messenger{:class => "flasher"}= flash[:notice]
- if flash[:error]
  %div#error{:class => "flasher"}= flash[:error]
FILE
end

create_file 'app/views/shared/_footer.html.haml' do
<<-FILE
%footer#main_footer
  %a{:href => "http://quickleft.com"}
    #{app_name.humanize}
FILE
end

create_file 'app/views/shared/_end_scripts.html.haml' do
<<-FILE
= javascript_include_tag :defaults
FILE
end

run 'rm app/views/layouts/application.html.erb'
create_file 'app/views/layouts/application.html.haml' do
<<-FILE
!!! 5
%html
  %head
    %meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8'}
    %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
    %title 
      #{app_name.humanize}
      = yield(:title)
    %meta{:name => 'description', :content => ''}
    %meta{:name => 'author', :content => ''}
    %meta{:name => 'viewport', :content => 'width=device-width; initial-scale=1.0'}
    = csrf_meta_tag
    %link{:rel => "shortcut icon", :href => "/images/favicon.ico", :type => "image/x-icon"}
    %link{:rel => "apple-touch-icon", :href => "/images/ati.png"}
    /[if lt IE 9]
      %script{:type => "text/javascript", :src  => "/javascripts/shiv.js"}
    = stylesheet_link_tag :all
    = yield(:head)
    /[if IE 7]
      = stylesheet_link_tag 'ie7', :media => 'all'
    /[if IE 8]
      = stylesheet_link_tag 'ie8', :media => 'all'
  %body
    #container
      = render :partial => "shared/header"
      %section#content
        = yield
      #pusher
    = render :partial => "shared/footer"
    = render :partial => "shared/end_scripts"
FILE
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prologue-0.1.0 templates/application_layout.rb