This repository was archived by the owner on Jul 21, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-book.html
More file actions
82 lines (72 loc) · 3.61 KB
/
Copy pathadd-book.html
File metadata and controls
82 lines (72 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Book</title>
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
xintegrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body class="bg-light">
<!-- SAME Navbar as index.html for consistent navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="/">Book Database</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<!-- This link is now active -->
<a class="nav-link active" aria-current="page" href="/add-book">Add New Book</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<div id="content" class="container mt-4">
<div class="row justify-content-center">
<div class="col-md-8">
<!-- Form is now styled inside a card -->
<div class="card shadow-sm">
<div class="card-body p-4">
<h1 class="text-center mb-4">Create New Book</h1>
<!--
This form will POST to /add-book.
The server will respond with hx-redirect,
so no hx-target or hx-swap is needed.
-->
<form hx-post="/add-book">
<div class="mb-3">
<label for="name" class="form-label">Book Name:</label>
<input type="text" id="name" name="name" class="form-control" required />
</div>
<div class="mb-3">
<label for="author" class="form-label">Author:</label>
<input type="text" id="author" name="author" class="form-control" required />
</div>
<div class="mb-3">
<label for="isbn" class="form-label">ISBN:</label>
<input type="text" id="isbn" name="isbn" class="form-control" />
</div>
<hr class="my-4">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<input type="reset" value="Reset" class="btn btn-secondary me-md-2">
<button id="submit" type="submit" class="btn btn-success">
Create New Book
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
xintegrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
</body>
</html>