Soham Maity commited on
Commit
edbc6a4
·
1 Parent(s): 7b9b4fb

feat: add notes management template with display and delete functionality

Browse files
Files changed (1) hide show
  1. app/templates/admin/notes.html +57 -0
app/templates/admin/notes.html ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+
3
+ {% block content %}
4
+ <div class="max-w-7xl mx-auto px-4 sm:px-6">
5
+ <div class="mb-8">
6
+ <a href="{{ url_for('admin.dashboard') }}" class="inline-flex items-center gap-2 font-mono text-sm text-gray-400 hover:text-purple-400 transition mb-6">
7
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
8
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
9
+ </svg>
10
+ Back to Dashboard
11
+ </a>
12
+
13
+ <h1 class="font-display text-4xl sm:text-5xl font-bold tracking-tight mb-4">
14
+ <span class="bg-gradient-to-r from-purple-400 to-pink-500 bg-clip-text text-transparent">
15
+ Manage Notes
16
+ </span>
17
+ </h1>
18
+ </div>
19
+
20
+ <div class="glass rounded-2xl overflow-hidden">
21
+ <div class="overflow-x-auto">
22
+ <table class="w-full">
23
+ <thead class="bg-white/5 border-b border-white/10">
24
+ <tr>
25
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">ID</th>
26
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">Title</th>
27
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">Subject</th>
28
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">Type</th>
29
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">User</th>
30
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">Date</th>
31
+ <th class="px-6 py-4 text-right font-mono text-sm text-gray-400 whitespace-nowrap">Actions</th>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+ {% for note in notes %}
36
+ <tr class="border-b border-white/5 hover:bg-white/5 transition">
37
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note.id }}</td>
38
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap max-w-xs truncate" title="{{ note.title }}">{{ note.title }}</td>
39
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note.subject.name }}</td>
40
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note.note_type.name }}</td>
41
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note.user.name }}</td>
42
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note.created_at.strftime('%Y-%m-%d') }}</td>
43
+ <td class="px-6 py-4 text-right whitespace-nowrap">
44
+ <form method="POST" action="{{ url_for('admin.delete_note', id=note.id) }}" class="inline">
45
+ <button type="submit" onclick="return confirm('Delete this note?')" class="px-4 py-2 bg-red-500/20 border border-red-500/50 rounded-lg font-mono text-sm hover:bg-red-500/30 transition">
46
+ Delete
47
+ </button>
48
+ </form>
49
+ </td>
50
+ </tr>
51
+ {% endfor %}
52
+ </tbody>
53
+ </table>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ {% endblock %}