Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit ed936fff authored by 65160394's avatar 65160394
Browse files

Project Round 7

parent 1fc9f413
Branches
No related tags found
No related merge requests found
...@@ -42,17 +42,9 @@ nav a:hover { ...@@ -42,17 +42,9 @@ nav a:hover {
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
} }
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
background-color: #4c4cd9;
color: white;
}
.login-btn { .login-btn {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
background-color: transparent; background-color: transparent;
......
...@@ -12,25 +12,19 @@ ...@@ -12,25 +12,19 @@
<header> <header>
<h1>Welcome to JourneyHub</h1> <h1>Welcome to JourneyHub</h1>
<nav> <nav>
<div class="header">
<% if (session.userId) { %> <% if (session.userId) { %>
<a href="/create" class="btn-create">Create Tour</a> <a href="/create" class="btn-create">Create Tour</a>
<% } %> <% } %>
<form action="/search" method="GET" class="search-container"> <form action="/search" method="GET" class="search-container">
<input type="text" name="query" placeholder="Search for tours..." required> <input type="text" name="query" placeholder="Search for tours..." required>
<button type="submit">Search</button> <button type="submit">Search</button>
</form> </form>
<% if (session && session.userId) { %> <!-- ตรวจสอบว่า userId อยู่ใน session หรือไม่ -->
<div class="navbar"> <a><%= session.userName %></a> <!-- แสดงชื่อผู้ใช้ -->
<% if (session && session.userId) { %>
<a><%= session.userName %></a>
<a href="/logout">Logout</a> <a href="/logout">Logout</a>
<% } else { %> <% } else { %>
<a href="/login" class="login-btn">Login</a> <a href="/login" class="login-btn">Login</a> <!-- ถ้ายังไม่ได้ login -->
<% } %> <% } %>
</div>
</div>
</nav> </nav>
</header> </header>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment