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

feat: add note types management template with add and delete functionality

Browse files
Files changed (1) hide show
  1. app/templates/admin/note_types.html +61 -0
app/templates/admin/note_types.html ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Note Types
16
+ </span>
17
+ </h1>
18
+ </div>
19
+
20
+ <!-- Add Form -->
21
+ <form method="POST" action="{{ url_for('admin.add_note_type') }}" class="glass p-6 rounded-2xl mb-8">
22
+ <div class="flex flex-col sm:flex-row gap-4">
23
+ <input type="text" name="name" placeholder="New note type name" required
24
+ class="flex-1 bg-white/5 border border-white/10 rounded-xl px-4 py-3 font-mono focus:outline-none focus:border-purple-500 transition">
25
+ <button type="submit" class="btn-magnetic glass px-8 py-3 rounded-xl font-mono font-semibold border-2 border-purple-500/50 hover:border-purple-400">
26
+ Add
27
+ </button>
28
+ </div>
29
+ </form>
30
+
31
+ <!-- Note Types List -->
32
+ <div class="glass rounded-2xl overflow-hidden">
33
+ <div class="overflow-x-auto">
34
+ <table class="w-full">
35
+ <thead class="bg-white/5 border-b border-white/10">
36
+ <tr>
37
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">ID</th>
38
+ <th class="px-6 py-4 text-left font-mono text-sm text-gray-400 whitespace-nowrap">Name</th>
39
+ <th class="px-6 py-4 text-right font-mono text-sm text-gray-400 whitespace-nowrap">Actions</th>
40
+ </tr>
41
+ </thead>
42
+ <tbody>
43
+ {% for note_type in note_types %}
44
+ <tr class="border-b border-white/5 hover:bg-white/5 transition">
45
+ <td class="px-6 py-4 font-mono text-sm whitespace-nowrap">{{ note_type.id }}</td>
46
+ <td class="px-6 py-4 font-mono whitespace-nowrap">{{ note_type.name }}</td>
47
+ <td class="px-6 py-4 text-right whitespace-nowrap">
48
+ <form method="POST" action="{{ url_for('admin.delete_note_type', id=note_type.id) }}" class="inline">
49
+ <button type="submit" onclick="return confirm('Delete this note type?')" 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">
50
+ Delete
51
+ </button>
52
+ </form>
53
+ </td>
54
+ </tr>
55
+ {% endfor %}
56
+ </tbody>
57
+ </table>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ {% endblock %}