2021-03-19 17:31:38 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Book store</title>
|
2021-03-21 12:41:21 +01:00
|
|
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
2021-03-19 17:31:38 +02:00
|
|
|
<%= csrf_meta_tags %>
|
|
|
|
<%= csp_meta_tag %>
|
|
|
|
|
|
|
|
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
|
|
|
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
2021-03-21 22:31:58 +01:00
|
|
|
<%= javascript_include_tag 'rails-ujs' %>
|
2021-03-19 17:31:38 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2021-03-21 22:31:58 +01:00
|
|
|
<div class='container'>
|
2021-03-22 01:24:13 +01:00
|
|
|
<div class='card-panel'>
|
|
|
|
<div class='row'>
|
|
|
|
<div class='col s2'>
|
|
|
|
<%= link_to 'Home', '/welcome', method: :get%>
|
2021-03-21 22:31:58 +01:00
|
|
|
</div>
|
2021-03-22 01:24:13 +01:00
|
|
|
|
|
|
|
<div class='col s2'>
|
|
|
|
<%= link_to 'Books', '/books', method: :get%>
|
2021-03-21 22:31:58 +01:00
|
|
|
</div>
|
2021-03-22 01:24:13 +01:00
|
|
|
<% if current_user&.admin? %>
|
|
|
|
<div class='col s2'>
|
|
|
|
<%= link_to 'Authors', '/authors', method: :get%>
|
|
|
|
</div>
|
|
|
|
<div class='col s2'>
|
|
|
|
<%= link_to 'Users', '/users', method: :get%>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if logged_in? %>
|
|
|
|
<div class='col s2'>
|
2021-03-22 02:25:17 +01:00
|
|
|
<%= link_to 'Shopping cart', '/shopping_cart', method: :get%>
|
2021-03-22 01:24:13 +01:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2021-03-21 12:41:21 +01:00
|
|
|
</div>
|
2021-03-21 22:31:58 +01:00
|
|
|
<% flash.each do |type, notice| %>
|
|
|
|
<div class='card-panel teal lighten-5'>
|
|
|
|
<% if notice.is_a? String %>
|
|
|
|
<%= notice %>
|
|
|
|
<% else %>
|
|
|
|
<% notice.each do |msg| %>
|
|
|
|
<div><%= msg %></div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2021-03-19 17:31:38 +02:00
|
|
|
<%= yield %>
|
|
|
|
</body>
|
|
|
|
</html>
|