Spaces:
Paused

NotesHub / templates /search.html
Ragulselvakumar's picture
Add notes search page
9521fe8 verified
Raw History Blame Contribute Delete
4.67 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NotesHub - Search Notes</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f5f7fb;
margin: 0;
}
.container {
width: 700px;
max-width: 90%;
margin: 40px auto;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 3px 12px #ccc;
}
h2 {
text-align: center;
color: #243b55;
}
form {
margin: 25px 0;
}
input, select {
width: 100%;
padding: 12px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 12px;
background: #2f80ed;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
.note {
border: 1px solid #ddd;
padding: 18px;
margin-top: 15px;
border-radius: 8px;
}
.note h3 {
color: #243b55;
}
.download {
display: inline-block;
background: #2f80ed;
color: white;
padding: 9px 15px;
text-decoration: none;
border-radius: 5px;
margin-top: 8px;
}
.back {
text-align: center;
margin-top: 20px;
}
.back a {
color: #2f80ed;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<h2>πŸ” Search College Notes</h2>
<form action="/search" method="GET">
<input
type="text"
name="subject"
placeholder="Enter Subject Name"
>
<select name="department">
<option value="">Select Department</option>
<option value="Computer Science">Computer Science</option>
<option value="Information Technology">Information Technology</option>
<option value="Electronics">Electronics</option>
<option value="Mechanical">Mechanical</option>
<option value="Civil">Civil</option>
</select>
<select name="semester">
<option value="">Select Semester</option>
<option value="Semester 1">Semester 1</option>
<option value="Semester 2">Semester 2</option>
<option value="Semester 3">Semester 3</option>
<option value="Semester 4">Semester 4</option>
<option value="Semester 5">Semester 5</option>
<option value="Semester 6">Semester 6</option>
<option value="Semester 7">Semester 7</option>
<option value="Semester 8">Semester 8</option>
</select>
<select name="unit">
<option value="">Select Unit</option>
<option value="Unit 1">Unit 1</option>
<option value="Unit 2">Unit 2</option>
<option value="Unit 3">Unit 3</option>
<option value="Unit 4">Unit 4</option>
<option value="Unit 5">Unit 5</option>
</select>
<button type="submit">
πŸ” Search Notes
</button>
</form>
{% if notes %}
<h3>Search Results</h3>
{% for note in notes %}
<div class="note">
<h3>πŸ“„ {{ note["title"] }}</h3>
<p>
<b>Department:</b>
{{ note["department"] }}
</p>
<p>
<b>Semester:</b>
{{ note["semester"] }}
</p>
<p>
<b>Subject:</b>
{{ note["subject"] }}
</p>
<p>
<b>Unit:</b>
{{ note["unit"] }}
</p>
<a
href="/download/{{ note['filename'] }}"
class="download"
>
⬇️ Download PDF
</a>
</div>
{% endfor %}
{% else %}
<p style="text-align:center;">
No notes found. Try another search.
</p>
{% endif %}
<div class="back">
<a href="/">← Back to Home</a>
</div>
</div>
</body>
</html>