-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.html
More file actions
747 lines (688 loc) · 42.6 KB
/
program.html
File metadata and controls
747 lines (688 loc) · 42.6 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<title>Program | Onboarding</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/styles.css">
<link rel="stylesheet" href="/css/variables.css">
<link rel="stylesheet" href="/css/base.css">
<link rel="stylesheet" href="/css/layout.css">
<link rel="stylesheet" href="/css/components.css">
<link rel="stylesheet" href="/css/animations.css">
<link rel="stylesheet" href="/css/program.css">
<link rel="stylesheet" href="/css/navbar.css">
<link rel="stylesheet" href="/css/sidebar.css">
<link rel="stylesheet" href="/css/activity-feed.css">
<link rel="stylesheet" href="/css/hacker-console.css">
<script type="module" src="/js/app-program.js"></script>
</head>
<body>
<div class="app-layout" x-data="programPage" x-cloak>
<main class="main-content">
<div class="alert" :class="alert.type" x-show="alert.show" x-cloak x-transition>
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path x-show="alert.type === 'success'" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
<path x-show="alert.type === 'error'" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
<span x-text="alert.message"></span>
</div>
<div class="page-header">
<div>
<h1 class="page-title">Program</h1>
<p class="page-subtitle">Onboarding program structure and tasks</p>
</div>
<div class="header-actions" x-show="isAdminUser">
<button class="btn-secondary-sm" @click="openCategoriesModal">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
</svg>
Categories
</button>
<button class="btn-secondary-sm" @click="openStatusesModal">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
Statuses
</button>
<button class="btn-add" @click="showAddWeekModal = true">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
Add Week
</button>
</div>
</div>
<div class="program-stats">
<div class="stat-card">
<div class="stat-value" x-text="$store.app.weeks.length">0</div>
<div class="stat-label">Weeks</div>
</div>
<div class="stat-card">
<div class="stat-value" x-text="$store.app.tasks.length">0</div>
<div class="stat-label">Total Tasks</div>
</div>
<div class="stat-card">
<div class="stat-value" x-text="getEstimatedDuration()">0</div>
<div class="stat-label">Days Program</div>
</div>
</div>
<template x-if="$store.app.weeks.length === 0">
<div class="empty-state">
<svg class="empty-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<h2 class="empty-title">No program yet</h2>
<p class="empty-text">The program hasn't been set up. Contact an admin to add weeks and tasks.</p>
</div>
</template>
<div class="weeks-container" x-show="$store.app.weeks.length > 0">
<template x-for="week in $store.app.weeks" :key="week.id">
<div class="week-card" :class="{ 'expanded': expandedWeek === week.id }">
<div class="week-header" @click="toggleWeek(week.id)">
<div class="week-number" x-text="week.week_number"></div>
<div class="week-info">
<div class="week-title" x-text="week.title"></div>
<div class="week-description" x-text="week.description || 'No description'"></div>
</div>
<div class="week-meta">
<div class="task-count">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
</svg>
<span x-text="taskCountLabel(week.id)"></span>
</div>
<div class="actions" x-show="isAdminUser" @click.stop>
<button class="btn-icon" @click="openAddTaskModal(week)" title="Add Task">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
</button>
<button class="btn-icon" @click="editWeek(week)" title="Edit Week">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</button>
<button class="btn-icon danger" @click="confirmDeleteWeek(week)" title="Delete Week">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</div>
<svg class="expand-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
</svg>
</div>
</div>
<div class="tasks-container" x-show="expandedWeek === week.id" x-collapse>
<template x-if="getTasksForWeek(week.id).length === 0">
<div class="empty-tasks">No tasks in this week yet</div>
</template>
<template x-for="task in getTasksForWeek(week.id)" :key="task.id">
<div class="task-item">
<div class="task-icon" :style="categoryIconStyle(getCategory(task.category_id).color)">
<svg x-show="getCategory(task.category_id).icon === 'book'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<svg x-show="getCategory(task.category_id).icon === 'code'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
<svg x-show="getCategory(task.category_id).icon === 'folder'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
</svg>
<svg x-show="getCategory(task.category_id).icon === 'clipboard'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
</svg>
</div>
<div class="task-info">
<div class="task-title" x-text="task.title"></div>
<div class="task-description" x-text="formatDescription(task.description)" x-show="task.description"></div>
</div>
<span class="day-badge" x-text="dayLabel(task.day_number)"></span>
<span class="task-category" :style="categoryBadgeStyle(getCategory(task.category_id).color)" x-text="getCategory(task.category_id).label"></span>
<div class="task-actions" x-show="isAdminUser">
<button class="btn-icon" @click="editTask(task)" title="Edit Task">
<svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</button>
<button class="btn-icon danger" @click="confirmDeleteTask(task)" title="Delete Task">
<svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</main>
<div class="modal-overlay" x-show="showAddWeekModal" x-cloak @click.self="showAddWeekModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Add New Week</h2>
<button class="modal-close" @click="showAddWeekModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<form @submit.prevent="addWeek">
<div class="form-group">
<label class="form-label" for="newWeekNumber">Week Number</label>
<input type="number" id="newWeekNumber" name="week_number" class="form-input" x-model="newWeekNumber" required min="1" placeholder="e.g., 1">
</div>
<div class="form-group">
<label class="form-label" for="newWeekTitle">Title</label>
<input type="text" id="newWeekTitle" name="title" class="form-input" x-model="newWeekTitle" required placeholder="Week title">
</div>
<div class="form-group">
<label class="form-label" for="newWeekDescription">Description (Optional)</label>
<input type="text" id="newWeekDescription" name="description" class="form-input" x-model="newWeekDescription" placeholder="Brief description">
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showAddWeekModal = false">Cancel</button>
<button type="submit" class="btn-primary">Create Week</button>
</div>
</form>
</div>
</div>
<div class="modal-overlay" x-show="showEditWeekModal" x-cloak @click.self="showEditWeekModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Edit Week</h2>
<button class="modal-close" @click="showEditWeekModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<template x-if="editingWeek">
<form @submit.prevent="saveWeek">
<div class="form-group">
<label class="form-label" for="editWeekNumber">Week Number</label>
<input type="number" id="editWeekNumber" name="week_number" class="form-input" x-model="editingWeekNumber" required min="1">
</div>
<div class="form-group">
<label class="form-label" for="editWeekTitle">Title</label>
<input type="text" id="editWeekTitle" name="title" class="form-input" x-model="editingWeekTitle" required>
</div>
<div class="form-group">
<label class="form-label" for="editWeekDescription">Description</label>
<input type="text" id="editWeekDescription" name="description" class="form-input" x-model="editingWeekDescription">
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showEditWeekModal = false">Cancel</button>
<button type="submit" class="btn-primary">Save Changes</button>
</div>
</form>
</template>
</div>
</div>
<div class="modal-overlay" x-show="showAddTaskModal" x-cloak @click.self="showAddTaskModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Add Task to Week <span x-text="getSelectedWeekNumber()"></span></h2>
<button class="modal-close" @click="showAddTaskModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<form @submit.prevent="addTask">
<div class="form-group">
<label class="form-label" for="newTaskTitle">Task Title</label>
<input type="text" id="newTaskTitle" name="title" class="form-input" x-model="newTaskTitle" required placeholder="Enter task title">
</div>
<div class="form-group">
<label class="form-label" for="newTaskDescription">Description (Optional)</label>
<textarea id="newTaskDescription" name="description" class="form-input form-textarea" x-model="newTaskDescription" placeholder="Task description" rows="3"></textarea>
</div>
<div class="form-group">
<label class="form-label" for="newTaskCategoryId">Category</label>
<select id="newTaskCategoryId" name="category_id" class="form-select" x-model="newTaskCategoryId">
<template x-for="cat in $store.app.categories" :key="cat.id">
<option :value="cat.id" x-text="cat.label"></option>
</template>
</select>
</div>
<div class="form-group">
<label class="form-label" for="newTaskDayNumber">Day</label>
<select id="newTaskDayNumber" name="day_number" class="form-select" x-model="newTaskDayNumber">
<option value="1">Day 1</option>
<option value="2">Day 2</option>
<option value="3">Day 3</option>
<option value="4">Day 4</option>
<option value="5">Day 5</option>
<option value="6">Day 6</option>
<option value="7">Day 7</option>
</select>
</div>
<div class="form-group">
<label class="form-label" for="newTaskOrderIndex">Order</label>
<select id="newTaskOrderIndex" name="order_index" class="form-select" x-model="newTaskOrderIndex">
<option :value="getNextOrderIndex(getSelectedWeekId())">Add at end</option>
<template x-for="(task, idx) in getTasksForWeek(getSelectedWeekId())" :key="task.id">
<option :value="task.order_index" x-text="beforeTaskLabel(task.title)"></option>
</template>
</select>
<p class="form-help">Choose where to insert this task in the week</p>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showAddTaskModal = false">Cancel</button>
<button type="submit" class="btn-primary">Create Task</button>
</div>
</form>
</div>
</div>
<div class="modal-overlay" x-show="showEditTaskModal" x-cloak @click.self="showEditTaskModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Edit Task</h2>
<button class="modal-close" @click="showEditTaskModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<template x-if="editingTask">
<form @submit.prevent="saveTask">
<div class="form-group">
<label class="form-label" for="editTaskTitle">Task Title</label>
<input type="text" id="editTaskTitle" name="title" class="form-input" x-model="editingTaskTitle" required>
</div>
<div class="form-group">
<label class="form-label" for="editTaskDescription">Description</label>
<textarea id="editTaskDescription" name="description" class="form-input form-textarea" x-model="editingTaskDescription" rows="4"></textarea>
</div>
<div class="form-group">
<label class="form-label" for="editTaskCategoryId">Category</label>
<select id="editTaskCategoryId" name="category_id" class="form-select" x-model="editingTaskCategoryId">
<template x-for="cat in $store.app.categories" :key="cat.id">
<option :value="cat.id" :selected="cat.id === editingTaskCategoryId" x-text="cat.label"></option>
</template>
</select>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label" for="editTaskWeekId">Week</label>
<select id="editTaskWeekId" name="week_id" class="form-select" x-model="editingTaskWeekId">
<template x-for="week in $store.app.weeks" :key="week.id">
<option :value="week.id" :selected="week.id === editingTaskWeekId" x-text="weekLabel(week.week_number)"></option>
</template>
</select>
</div>
<div class="form-group">
<label class="form-label" for="editTaskDayNumber">Day</label>
<select id="editTaskDayNumber" name="day_number" class="form-select" x-model="editingTaskDayNumber">
<option value="1" :selected="editingTaskDayNumber == 1">Day 1</option>
<option value="2" :selected="editingTaskDayNumber == 2">Day 2</option>
<option value="3" :selected="editingTaskDayNumber == 3">Day 3</option>
<option value="4" :selected="editingTaskDayNumber == 4">Day 4</option>
<option value="5" :selected="editingTaskDayNumber == 5">Day 5</option>
<option value="6" :selected="editingTaskDayNumber == 6">Day 6</option>
<option value="7" :selected="editingTaskDayNumber == 7">Day 7</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="editTaskOrderIndex">Order</label>
<select id="editTaskOrderIndex" name="order_index" class="form-select" x-model="editingTaskOrderIndex">
<template x-for="task in getTasksForWeek(getEditingTaskWeekId())" :key="task.id">
<option :value="task.order_index" :selected="task.order_index === editingTaskOrderIndex" x-text="taskPositionLabel(task)"></option>
</template>
</select>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showEditTaskModal = false">Cancel</button>
<button type="submit" class="btn-primary">Save Changes</button>
</div>
</form>
</template>
</div>
</div>
<div class="modal-overlay" x-show="showDeleteModal" x-cloak @click.self="showDeleteModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Confirm Delete</h2>
<button class="modal-close" @click="showDeleteModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<p style="color: rgba(255,255,255,0.7); margin-bottom: 1.5rem;">
Are you sure you want to delete <strong x-text="deleteTargetName()"></strong>?
<template x-if="deleteType === 'week'">
<span style="color: #f87171;"> This will also delete all tasks in this week!</span>
</template>
<template x-if="deleteType === 'category'">
<span style="color: #f87171;"> Tasks using this category will have no category!</span>
</template>
This action cannot be undone.
</p>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showDeleteModal = false">Cancel</button>
<button type="button" class="btn-danger" @click="executeDelete">Delete</button>
</div>
</div>
</div>
<div class="modal-overlay" x-show="showCategoriesModal" x-cloak @click.self="showCategoriesModal = false">
<div class="modal-content" style="max-width: 560px;" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Task Categories</h2>
<button class="modal-close" @click="showCategoriesModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="category-list">
<template x-for="cat in $store.app.categories" :key="cat.id">
<div class="category-item">
<div class="category-color" :style="categoryIconStyle(cat.color)">
<svg x-show="cat.icon === 'book'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
<svg x-show="cat.icon === 'code'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
<svg x-show="cat.icon === 'folder'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
</svg>
<svg x-show="cat.icon === 'clipboard'" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
</svg>
</div>
<div class="category-info">
<div class="category-label" x-text="cat.label"></div>
<div class="category-meta">
<span x-text="categoryTaskCountLabel(cat.id)"></span>
<span class="scorable-badge" x-show="cat.has_score">Scorable</span>
</div>
</div>
<div class="actions">
<button class="btn-icon" @click="editCategory(cat)" title="Edit">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</button>
<button class="btn-icon danger" @click="confirmDeleteCategory(cat)" title="Delete">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</div>
</div>
</template>
</div>
<button class="btn-add" style="width: 100%;" @click="openAddCategoryModal">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
Add Category
</button>
</div>
</div>
<div class="modal-overlay" x-show="showAddCategoryModal" x-cloak @click.self="showAddCategoryModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Add Category</h2>
<button class="modal-close" @click="showAddCategoryModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<form @submit.prevent="addCategory">
<div class="form-group">
<label class="form-label" for="newCategoryLabel">Label</label>
<input type="text" id="newCategoryLabel" name="label" class="form-input" x-model="newCategoryLabel" required placeholder="e.g., Research">
</div>
<div class="form-group">
<label class="form-label" for="newCategoryName">Internal Name</label>
<input type="text" id="newCategoryName" name="name" class="form-input" x-model="newCategoryName" required placeholder="e.g., research" pattern="[a-z_]+" autocomplete="off">
<p class="form-help">Lowercase letters and underscores only</p>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label" for="newCategoryColor">Color</label>
<input type="color" id="newCategoryColor" name="color" class="form-input-color" x-model="newCategoryColor">
</div>
<div class="form-group">
<span class="form-label">Icon</span>
<div class="icon-select" role="radiogroup" aria-label="Icon selection">
<div class="icon-option" :class="{ 'selected': newCategoryIcon === 'book' }" @click="setNewCategoryIcon('book')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': newCategoryIcon === 'code' }" @click="setNewCategoryIcon('code')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': newCategoryIcon === 'folder' }" @click="setNewCategoryIcon('folder')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': newCategoryIcon === 'clipboard' }" @click="setNewCategoryIcon('clipboard')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
</svg>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="checkbox-label">
<input type="checkbox" id="newCategoryHasScore" name="has_score" class="form-checkbox" x-model="newCategoryHasScore">
<span class="checkbox-text">Enable scoring (1-10) for tasks in this category</span>
</label>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showAddCategoryModal = false">Cancel</button>
<button type="submit" class="btn-primary">Create Category</button>
</div>
</form>
</div>
</div>
<div class="modal-overlay" x-show="showEditCategoryModal" x-cloak @click.self="showEditCategoryModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Edit Category</h2>
<button class="modal-close" @click="showEditCategoryModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<template x-if="editingCategory">
<form @submit.prevent="saveCategory">
<div class="form-group">
<label class="form-label" for="editCategoryLabel">Label</label>
<input type="text" id="editCategoryLabel" name="label" class="form-input" x-model="editingCategoryLabel" required>
</div>
<div class="form-group">
<label class="form-label" for="editCategoryName">Internal Name</label>
<input type="text" id="editCategoryName" name="name" class="form-input" x-model="editingCategoryName" required pattern="[a-z_]+" autocomplete="off">
<p class="form-help">Lowercase letters and underscores only</p>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label" for="editCategoryColor">Color</label>
<input type="color" id="editCategoryColor" name="color" class="form-input-color" x-model="editingCategoryColor">
</div>
<div class="form-group">
<span class="form-label">Icon</span>
<div class="icon-select" role="radiogroup" aria-label="Icon selection">
<div class="icon-option" :class="{ 'selected': editingCategoryIcon === 'book' }" @click="setEditingCategoryIcon('book')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': editingCategoryIcon === 'code' }" @click="setEditingCategoryIcon('code')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': editingCategoryIcon === 'folder' }" @click="setEditingCategoryIcon('folder')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
</svg>
</div>
<div class="icon-option" :class="{ 'selected': editingCategoryIcon === 'clipboard' }" @click="setEditingCategoryIcon('clipboard')">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
</svg>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="checkbox-label">
<input type="checkbox" id="editCategoryHasScore" name="has_score" class="form-checkbox" x-model="editingCategoryHasScore">
<span class="checkbox-text">Enable scoring (1-10) for tasks in this category</span>
</label>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showEditCategoryModal = false">Cancel</button>
<button type="submit" class="btn-primary">Save Changes</button>
</div>
</form>
</template>
</div>
</div>
<div class="modal-overlay" x-show="showStatusesModal" x-cloak @click.self="showStatusesModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Task Statuses</h2>
<button class="modal-close" @click="showStatusesModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="category-list">
<template x-for="status in $store.app.statuses" :key="status.id">
<div class="category-item">
<div class="category-color" :style="statusColorStyle(status.color)">
<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10" stroke-width="2"/>
</svg>
</div>
<div class="category-info">
<div class="category-label" x-text="status.label"></div>
<div class="category-meta">
<span x-text="statusOrderLabel(status.sort_order)"></span>
</div>
</div>
<div class="actions">
<button class="btn-icon" @click="editStatus(status)" title="Edit">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</button>
<button class="btn-icon danger" @click="confirmDeleteStatus(status)" title="Delete">
<svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</div>
</div>
</template>
</div>
<button class="btn-add" style="width: 100%;" @click="openAddStatusModal">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
Add Status
</button>
</div>
</div>
<div class="modal-overlay" x-show="showAddStatusModal" x-cloak @click.self="showAddStatusModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Add Status</h2>
<button class="modal-close" @click="showAddStatusModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<form @submit.prevent="addStatus">
<div class="form-group">
<label class="form-label" for="newStatusLabel">Label</label>
<input type="text" id="newStatusLabel" name="label" class="form-input" x-model="newStatusLabel" required placeholder="e.g., On Hold">
</div>
<div class="form-group">
<label class="form-label" for="newStatusName">Internal Name</label>
<input type="text" id="newStatusName" name="name" class="form-input" x-model="newStatusName" required placeholder="e.g., on_hold" pattern="[a-z_]+" autocomplete="off">
<p class="form-help">Lowercase letters and underscores only</p>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label" for="newStatusColor">Color</label>
<input type="color" id="newStatusColor" name="color" class="form-input-color" x-model="newStatusColor">
</div>
<div class="form-group">
<label class="form-label" for="newStatusSortOrder">Sort Order</label>
<input type="number" id="newStatusSortOrder" name="sort_order" class="form-input" x-model="newStatusSortOrder" min="1" required>
</div>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showAddStatusModal = false">Cancel</button>
<button type="submit" class="btn-primary">Create Status</button>
</div>
</form>
</div>
</div>
<div class="modal-overlay" x-show="showEditStatusModal" x-cloak @click.self="showEditStatusModal = false">
<div class="modal-content" @click.stop>
<div class="modal-header">
<h2 class="modal-title">Edit Status</h2>
<button class="modal-close" @click="showEditStatusModal = false">
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<template x-if="editingStatus">
<form @submit.prevent="saveStatus">
<div class="form-group">
<label class="form-label" for="editStatusLabel">Label</label>
<input type="text" id="editStatusLabel" name="label" class="form-input" x-model="editingStatusLabel" required>
</div>
<div class="form-group">
<label class="form-label" for="editStatusName">Internal Name</label>
<input type="text" id="editStatusName" name="name" class="form-input" x-model="editingStatusName" required pattern="[a-z_]+" autocomplete="off">
<p class="form-help">Lowercase letters and underscores only</p>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label" for="editStatusColor">Color</label>
<input type="color" id="editStatusColor" name="color" class="form-input-color" x-model="editingStatusColor">
</div>
<div class="form-group">
<label class="form-label" for="editStatusSortOrder">Sort Order</label>
<input type="number" id="editStatusSortOrder" name="sort_order" class="form-input" x-model="editingStatusSortOrder" min="1" required>
</div>
</div>
<div class="modal-actions">
<button type="button" class="btn-secondary" @click="showEditStatusModal = false">Cancel</button>
<button type="submit" class="btn-primary">Save Changes</button>
</div>
</form>
</template>
</div>
</div>
</div>
</body>
</html>