batteryfix commited on
Commit
2207d90
·
verified ·
1 Parent(s): 5274beb

in calendar i need to see what it is so when i click on the date of the task the task pops up allowing me to read the whole thing

Browse files
Files changed (1) hide show
  1. calendar.html +62 -29
calendar.html CHANGED
@@ -17,21 +17,20 @@
17
  <div id="calendar" class="bg-white rounded-xl shadow-sm border border-gray-100 p-4"></div>
18
  </div>
19
  </main>
20
-
21
- <!-- Task Info Modal -->
22
- <div class="modal fade" id="taskInfoModal" tabindex="-1" aria-hidden="true">
23
- <div class="modal-dialog modal-dialog-centered">
24
- <div class="modal-content">
25
- <div class="modal-header">
26
- <h5 class="modal-title">Task Details</h5>
27
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
28
- </div>
29
- <div class="modal-body" id="taskInfoContent"></div>
30
  </div>
 
31
  </div>
32
  </div>
33
-
34
- <custom-footer></custom-footer>
35
 
36
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
37
  <script src="components/navbar.js"></script>
@@ -77,25 +76,56 @@
77
  if (daysDiff <= 5) highlightColor = 'bg-red-100';
78
  else if (daysDiff <= 10) highlightColor = 'bg-orange-100';
79
  else if (daysDiff <= 15) highlightColor = 'bg-green-100';
80
-
81
- content += `
82
- <div class="mb-4 p-3 rounded-lg ${highlightColor}">
83
- <h3 class="font-bold">${task.title}</h3>
84
- <p class="text-sm">${task.description || 'No description'}</p>
85
- ${task.comments?.length ? `<div class="mt-2 p-2 bg-gray-100 rounded">
86
- <p class="text-xs font-medium">Comments:</p>
87
- ${task.comments.map(c => `<p class="text-xs">- ${c}</p>`).join('')}
88
- </div>` : ''}
 
 
 
 
 
 
 
 
 
 
89
  </div>
90
- `;
91
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  content += `</div>`;
93
-
94
- new window.bootstrap.Modal(
95
- document.getElementById('taskInfoModal'),
96
- { backdrop: true, keyboard: true }
97
- ).show();
98
- document.getElementById('taskInfoContent').innerHTML = content;
99
  }
100
  },
101
  dayCellClassNames: function(arg) {
@@ -121,5 +151,8 @@
121
  calendar.render();
122
  });
123
  </script>
 
 
 
124
  </body>
125
  </html>
 
17
  <div id="calendar" class="bg-white rounded-xl shadow-sm border border-gray-100 p-4"></div>
18
  </div>
19
  </main>
20
+ <!-- Enhanced Task Info Modal -->
21
+ <div class="modal fade fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center hidden" id="taskInfoModal">
22
+ <div class="bg-white rounded-xl shadow-lg w-full max-w-2xl mx-4 max-h-[90vh] overflow-y-auto">
23
+ <div class="flex justify-between items-center sticky top-0 bg-white p-4 border-b border-gray-200 z-10">
24
+ <h3 class="text-xl font-semibold text-gray-800">Task Details</h3>
25
+ <button onclick="document.getElementById('taskInfoModal').classList.add('hidden')"
26
+ class="text-gray-500 hover:text-gray-700 p-1 rounded-full hover:bg-gray-100">
27
+ <i data-feather="x"></i>
28
+ </button>
 
29
  </div>
30
+ <div class="p-6" id="taskInfoContent"></div>
31
  </div>
32
  </div>
33
+ <custom-footer></custom-footer>
 
34
 
35
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
36
  <script src="components/navbar.js"></script>
 
76
  if (daysDiff <= 5) highlightColor = 'bg-red-100';
77
  else if (daysDiff <= 10) highlightColor = 'bg-orange-100';
78
  else if (daysDiff <= 15) highlightColor = 'bg-green-100';
79
+ content += `
80
+ <div class="mb-6 p-4 rounded-lg border border-gray-200 ${highlightColor}">
81
+ <div class="flex justify-between items-start">
82
+ <div>
83
+ <h3 class="text-lg font-bold text-gray-800 mb-1">${task.title}</h3>
84
+ <div class="flex items-center gap-2 mb-2 text-sm text-gray-500">
85
+ <span class="px-2 py-1 rounded-full ${task.priority === 'high' ? 'bg-red-100 text-red-800' :
86
+ task.priority === 'medium' ? 'bg-yellow-100 text-yellow-800' : 'bg-green-100 text-green-800'}">
87
+ ${task.priority} priority
88
+ </span>
89
+ <span class="px-2 py-1 rounded-full ${task.status === 'completed' ? 'bg-green-100 text-green-800' :
90
+ task.status === 'in-progress' ? 'bg-blue-100 text-blue-800' : 'bg-yellow-100 text-yellow-800'}">
91
+ ${task.status}
92
+ </span>
93
+ </div>
94
+ </div>
95
+ <div class="text-sm text-gray-500">
96
+ Due: ${task.dueDate ? new Date(task.dueDate).toLocaleDateString() : 'No due date'}
97
+ </div>
98
  </div>
99
+
100
+ <div class="prose max-w-none mt-3 text-gray-700">
101
+ <p>${task.description || 'No description provided.'}</p>
102
+ </div>
103
+
104
+ ${task.comments?.length ? `
105
+ <div class="mt-4 border-t border-gray-200 pt-4">
106
+ <h4 class="text-sm font-medium text-gray-700 mb-3">Comments (${task.comments.length})</h4>
107
+ <div class="space-y-3">
108
+ ${task.comments.map(c => `
109
+ <div class="flex gap-3">
110
+ <div class="flex-shrink-0">
111
+ <div class="h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center">
112
+ <i data-feather="user" class="w-4 h-4 text-gray-500"></i>
113
+ </div>
114
+ </div>
115
+ <div class="flex-1 min-w-0">
116
+ <p class="text-sm text-gray-700">${c}</p>
117
+ <p class="text-xs text-gray-500 mt-1">${new Date(task.createdAt).toLocaleString()}</p>
118
+ </div>
119
+ </div>
120
+ `).join('')}
121
+ </div>
122
+ </div>` : ''}
123
+ </div>
124
+ `;
125
+ });
126
  content += `</div>`;
127
+ document.getElementById('taskInfoModal').classList.remove('hidden');
128
+ document.getElementById('taskInfoContent').innerHTML = content;
 
 
 
 
129
  }
130
  },
131
  dayCellClassNames: function(arg) {
 
151
  calendar.render();
152
  });
153
  </script>
154
+ <script>
155
+ feather.replace();
156
+ </script>
157
  </body>
158
  </html>