Add app menu with sign in/out links

This commit is contained in:
2023-04-02 00:54:18 +02:00
parent 66f098f479
commit c72144ff22
4 changed files with 37 additions and 34 deletions

View File

@@ -13,3 +13,24 @@
*= require_tree .
*= require_self
*/
.app-menu {
height: 2.1em;
}
.app-menu a {
color: black;
float: right;
font-size: 0.9em;
padding: 0.6em;
}
.app-menu a:hover {
background-color: #009ade;
border-radius: 0.2em;
color: white;
cursor: pointer;
text-decoration: none;
}
a:not(:hover) {
text-decoration: none;
}

View File

@@ -11,6 +11,20 @@
</head>
<body>
<div class="app-menu">
<%= link_to_if user_signed_in?, t(:sign_out), destroy_user_session_path,
data: { turbo_method: :delete } do
link_to t(:sign_in), new_user_session_path
end %>
</div>
<% if flash[:notice] %>
<div style="border: green"><%= flash[:notice] %></div>
<% end %>
<% if flash[:alert] %>
<div style="border: red"><%= flash[:alert] %></div>
<% end %>
<%= yield %>
</body>
</html>

View File

@@ -1,5 +1,3 @@
<p style="color: green"><%= notice %></p>
<h1>Users</h1>
<div id="users">