Enhances user experience with dark‑mode detection, responsive layout, and streamlined role selection workflow
77 lines
4.7 KiB
HTML
77 lines
4.7 KiB
HTML
<div id="recent-activity" class="xl:col-span-2 rounded-xl bg-white dark:bg-gray-950 shadow-sm ring-1 ring-gray-950/5 dark:ring-white/10">
|
|
<div class="flex items-center justify-between gap-3 px-6 py-4 border-b border-gray-100 dark:border-gray-600">
|
|
<div>
|
|
<h3 class="text-base font-semibold text-gray-900 dark:text-white">Recent Activities</h3>
|
|
<p class="text-sm text-gray-500 dark:text-gray-400 mt-0.5">Latest updates across projects</p>
|
|
</div>
|
|
<a href="/dashboard/recent-activity/all/" class="text-xs font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 whitespace-nowrap">
|
|
View All <i class="fas fa-arrow-right ml-1 text-[10px]"></i>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="px-6 py-3 border-b border-gray-100 dark:border-gray-600 flex flex-wrap items-center gap-3">
|
|
<div class="flex items-center gap-2">
|
|
<input type="date" name="start_date" form="activity-filter" class="text-xs border border-gray-200 dark:border-gray-600 rounded-lg px-2 py-1.5 bg-white dark:bg-gray-950 text-gray-700 dark:text-gray-300" onclick="this.showPicker()">
|
|
<span class="text-xs text-gray-400">to</span>
|
|
<input type="date" name="end_date" form="activity-filter" class="text-xs border border-gray-200 dark:border-gray-600 rounded-lg px-2 py-1.5 bg-white dark:bg-gray-950 text-gray-700 dark:text-gray-300" onclick="this.showPicker()">
|
|
</div>
|
|
<label class="flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-400 cursor-pointer">
|
|
<input type="checkbox" name="today" form="activity-filter" class="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500">
|
|
Today Only
|
|
</label>
|
|
<select name="user" form="activity-filter" class="text-xs border border-gray-200 dark:border-gray-600 rounded-lg px-2 py-1.5 bg-white dark:bg-gray-950 text-gray-700 dark:text-gray-300">
|
|
<option value="">All Users</option>
|
|
{% for u in users %}
|
|
<option value="{{ u.id }}">{{ u.get_full_name|default:u.username }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<button type="submit" form="activity-filter" class="text-xs px-3 py-1.5 rounded-lg bg-blue-600 text-white hover:bg-blue-700 font-medium">Filter</button>
|
|
</div>
|
|
|
|
<form id="activity-filter" hx-get="/dashboard/recent-activity/" hx-target="#recent-activity" hx-swap="outerHTML" class="hidden"></form>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-100 dark:border-gray-600 bg-gray-50 dark:bg-gray-800">
|
|
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Activity</th>
|
|
<th class="px-6 py-3 text-right text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if histories %}
|
|
{% for h in histories %}
|
|
<tr class="border-b border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800/30 transition-colors cursor-pointer" onclick="window.location='/dashboard/tickets/{{ h.ticket.id }}/'">
|
|
<td class="px-6 py-3">
|
|
<div class="flex items-center gap-2">
|
|
<span class="text-blue-600 dark:text-blue-400 font-medium text-sm">{{ h.user.get_full_name|default:h.user.username }}</span>
|
|
<span class="text-gray-500 dark:text-gray-400 text-sm">changed</span>
|
|
<span class="font-medium text-sm text-gray-900 dark:text-white truncate max-w-[200px]">"{{ h.ticket.name|truncatechars:40 }}"</span>
|
|
</div>
|
|
<p class="text-xs text-gray-400 mt-0.5">
|
|
{% now "Y-m-d" as today_str %}{% if h.created_at|date:"Y-m-d" == today_str %}{{ h.created_at|time:"H:i" }}{% else %}{{ h.created_at|date:"M d, H:i" }}{% endif %}
|
|
• {{ h.ticket.uuid }}
|
|
• {{ h.ticket.project.name }}
|
|
</p>
|
|
</td>
|
|
<td class="px-6 py-3 text-right">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium text-white" style="background-color:{{ h.status.color|default:'#6B7280' }}">
|
|
{{ h.status.name }}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="2" class="text-center py-12 text-gray-400">
|
|
<i class="fas fa-clock text-4xl block mb-3 text-gray-300 dark:text-gray-600"></i>
|
|
<p class="text-sm font-medium text-gray-500 dark:text-gray-400">No Activity Found</p>
|
|
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">No ticket activities found for the selected period.</p>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div> |