Posted By

czapata on 12/10/09


Tagged

haml sinatra Padrino


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

muzafarova


XHTML Page Template


 / Published in: HAML
 

A 2 column HAML template for use with Sinatra, Padrino, or any other HAML enabled framework/app. This layout consists of a header section, a 2 column content section, and a footer section. It also includes Rack:Flash based notifications.

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. !!! Strict
  3. %html
  4. %head
  5. %title= @page_title
  6. %link{:type=>"text/css", :href=>"/stylesheets/application.css", :rel=>"stylesheet"}
  7. %script{:type=>"text/javascript", :src=>"public/javascripts/jquery.js"}
  8. %script
  9. $('document').ready(function() { $('.flash').fadeTo(4000,0); })
  10. %body
  11. #top
  12. #header
  13. %h1 Your App Name
  14. #content
  15. #leftCol
  16. -_msg = ''
  17. -if flash.has?(:info)
  18. -_class = 'info'
  19. -_msg = flash[:info]
  20. -elsif flash.has?(:notice)
  21. -_class = 'notice'
  22. -_msg = flash[:notice]
  23. -elsif flash.has?(:error)
  24. -_class = 'error'
  25. -_msg = flash[:error]
  26.  
  27. %div.flash{:class=>_class}
  28. %p
  29. =_msg
  30. = yield
  31. #rightCol Right Col Content
  32. #footer
  33. %p Copyright &copy; 2009 yourcompany.com

Report this snippet  

You need to login to post a comment.