fix: adds 'view all ...' button to dashboard widgets

This commit is contained in:
2025-05-13 09:07:20 -05:00
parent 217a667df2
commit 8967d407cb
8 changed files with 71 additions and 45 deletions

View File

@@ -26,8 +26,8 @@
</tr>
</thead>
<tbody class="divide-y divide-gray-50">
{% if this.userMonitors()|length > 0 %}
{% for monitor in this.userMonitors() %}
{% if this.userMonitors.items|length > 0 %}
{% for monitor in this.userMonitors.items %}
<tr id="monitor_{{ monitor.id }}">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 min-w-[50ch] max-w-[50ch] truncate">
{{ monitor.title }}
@@ -52,6 +52,13 @@
</td>
</tr>
{% endfor %}
{% if this.userMonitors.items|length > 5 %}
<tr id="monitor_view_all">
<td colspan="5" class="py-2 whitespace-nowrap bg-orange-500 uppercase text-sm font-medium text-center text-white min-w-[50ch] max-w-[50ch] truncate">
<a href="#">View All Monitors</a>
</td>
</tr>
{% endif %}
{% else %}
<tr>
<td class="px-6 py-4 whitespace-nowrap text-xs uppercase text-center col-span-2 font-medium text-stone-800" colspan="2">
@@ -61,5 +68,12 @@
{% endif %}
</tbody>
</table>
{% if this.isWidget == false %}
{% if this.userMonitors.items|length > 0 %}
{% set paginator = this.userMonitors %}
{% include 'partial/paginator.html.twig' %}
{% endif %}
{% endif %}
</div>