selvaneyas commited on
Commit
54ac7ec
·
1 Parent(s): 8e60a97

Update templates/library.html

Browse files
Files changed (1) hide show
  1. templates/library.html +78 -2
templates/library.html CHANGED
@@ -10,16 +10,92 @@
10
  <!--Custom CSS-->
11
  <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
12
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
13
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </head>
15
  <body>
16
  {% include 'components/navbar.html' %}
17
 
18
  <div class="container">
19
- <h1>Library</h1>
20
  <p>Browse our collection of books and resources.</p>
21
  </div>
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <!-- Footer Section -->
24
  <div id="footer-container"></div>
25
  <script src="{{ url_for('static', filename='js/script.js') }}"></script>
 
10
  <!--Custom CSS-->
11
  <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
12
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
13
+ <style>
14
+ body {
15
+ background-color: #f8f9fa;
16
+ }
17
+
18
+ .card {
19
+ max-width: 500px;
20
+ margin: auto;
21
+ border-radius: 15px;
22
+ }
23
+
24
+ h2 {
25
+ color: #007bff;
26
+ font-weight: bold;
27
+ }
28
+
29
+ input, textarea {
30
+ border-radius: 10px;
31
+ }
32
+
33
+ button {
34
+ border-radius: 10px;
35
+ font-size: 16px;
36
+ font-weight: bold;
37
+ }
38
+
39
+ #bookList .book-card {
40
+ background: white;
41
+ border-radius: 10px;
42
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
43
+ padding: 15px;
44
+ text-align: center;
45
+ transition: transform 0.2s;
46
+ }
47
+
48
+ #bookList .book-card:hover {
49
+ transform: scale(1.05);
50
+ }
51
+
52
+ /* PDF Preview */
53
+ #pdfViewer {
54
+ width: 100%;
55
+ height: 600px;
56
+ border-radius: 10px;
57
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
58
+ }
59
+ </style>
60
  </head>
61
  <body>
62
  {% include 'components/navbar.html' %}
63
 
64
  <div class="container">
65
+ <h1>📚 Library</h1>
66
  <p>Browse our collection of books and resources.</p>
67
  </div>
68
 
69
+ <div class="container mt-5">
70
+ <!-- Upload Section (Hidden Initially) -->
71
+ <div id="uploadSection" class="card shadow-lg p-4 mt-4" style="display: none;">
72
+ <h2 class="text-center">Upload a Book</h2>
73
+ <input type="text" id="title" class="form-control my-2" placeholder="Book Title">
74
+ <textarea id="description" class="form-control my-2" placeholder="Book Description"></textarea>
75
+ <input type="file" id="fileUpload" class="form-control my-2" accept=".pdf">
76
+ <button class="btn btn-success w-100" onclick="uploadBook()">Upload</button>
77
+ <button class="btn btn-danger w-100 mt-2" onclick="logoutAdmin()">Logout</button>
78
+ </div>
79
+
80
+ <!-- Book List -->
81
+ <h2 class="mt-5 text-center">📖 Available Books</h2>
82
+ <div id="bookList" class="row mt-3"></div>
83
+
84
+ <!-- PDF Preview Section -->
85
+ <div id="pdfPreviewSection" class="mt-4" style="display: none;">
86
+ <h2 class="text-center">📄 PDF Preview</h2>
87
+ <iframe id="pdfViewer" src="" frameborder="0"></iframe>
88
+ </div>
89
+
90
+ <!-- Admin Login -->
91
+ <div id="adminLogin" class="card shadow-lg p-4">
92
+ <h2 class="text-center">Admin Login</h2>
93
+ <input type="text" id="adminUser" class="form-control my-2" placeholder="Username">
94
+ <input type="password" id="adminPass" class="form-control my-2" placeholder="Password">
95
+ <button class="btn btn-primary w-100" onclick="loginAdmin()">Login</button>
96
+ </div>
97
+ </div>
98
+
99
  <!-- Footer Section -->
100
  <div id="footer-container"></div>
101
  <script src="{{ url_for('static', filename='js/script.js') }}"></script>