Guest User

Untitled

a guest
May 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #layout with very simple styling
  2. file "app/views/layouts/application.haml", <<-HAML
  3. !!! 5
  4. %html
  5. %head
  6. %title
  7. New Rails App!
  8. = stylesheet_link_tag :all
  9. = csrf_meta_tag
  10.  
  11. %body
  12. #container
  13. #user_navigation
  14. - if user_signed_in?
  15. == Signed in as \#{ current_user.email }. \#{ link_to "Sign out", destroy_user_session_path }
  16. - else
  17. == \#{link_to "Sign in", new_user_session_path } or \#{ link_to "sign up", new_user_registration_path }
  18. - flash.each do |name, msg|
  19. = content_tag :div, msg, :id => "flash_\#{name}"
  20.  
  21. #content
  22. = yield
  23. HAML
  24.  
  25. #and stylesheet
  26. file 'public/stylesheets/style.css', <<-CSS
  27. body {
  28. font-size: 13px;
  29. font-family: Consolas, 'Lucida Console', Monaco, monospace;
  30. background: #efefef;
  31. }
  32.  
  33. #container {
  34. width: 940px;
  35. padding: 10px;
  36. margin: 11px auto;
  37. background: #fff;
  38. }
  39.  
  40. #user_navigation {
  41. text-align: left;
  42. }
  43.  
  44. #flash_notice, #flash_alert {
  45. margin: 10px;
  46. padding: 10px;
  47. text-align: center;
  48. }
  49.  
  50. #flash_notice {
  51. background-color: #79e077;
  52. border: 1px solid #049f00;
  53.  
  54. }
  55.  
  56. #flash_alert {
  57. background-color: #fd8588;
  58. border: 1px solid #d40404;
  59. }
  60. CSS
Add Comment
Please, Sign In to add comment