application.html.erb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Pragprog Books Online Store</title>
  5. <%= stylesheet_link_tag "application", media: "all" %>
  6. <%= javascript_include_tag "application" %>
  7. <%= csrf_meta_tags %>
  8. </head>
  9. <body class="<%= controller.controller_name %>">
  10. <div id="banner">
  11. <%= form_tag store_path, class: 'locale' do %>
  12. <%= select_tag 'set_locale',
  13. options_for_select(LANGUAGES, I18n.locale.to_s),
  14. onchange: 'this.form.submit()' %>
  15. <%= submit_tag 'submit' %>
  16. <%= javascript_tag "$('.locale input').hide()" %>
  17. <% end %>
  18. <%= image_tag("logo.png") %>
  19. <%= @page_title || t('.title') %>
  20. </div>
  21. <div id="columns">
  22. <div id="side">
  23. <% if @cart %>
  24. <%= hidden_div_if(@cart.line_items.empty?, id: 'cart') do %>
  25. <%= render @cart %>
  26. <% end %>
  27. <% end %>
  28. <ul>
  29. <li><a href="http://www...."><%= t('.home') %></a></li>
  30. <li><a href="http://www..../faq"><%= t('.questions') %></a></li>
  31. <li><a href="http://www..../news"><%= t('.news') %></a></li>
  32. <li><a href="http://www..../contact"><%= t('.contact') %></a></li>
  33. </ul>
  34. <% if session[:user_id] %>
  35. <ul>
  36. <li><%= link_to 'Orders', orders_path %></li>
  37. <li><%= link_to 'Products', products_path %></li>
  38. <li><%= link_to 'Users', users_path %></li>
  39. </ul>
  40. <%= button_to 'Logout', logout_path, method: :delete %>
  41. <% end %>
  42. </div>
  43. <div id="main">
  44. <%= yield %>
  45. </div>
  46. </div>
  47. </body>
  48. </html>