fix: adds status badges
This commit is contained in:
10
src/Twig/Components/StatusBadge.php
Normal file
10
src/Twig/Components/StatusBadge.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Twig\Components;
|
||||||
|
|
||||||
|
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
|
||||||
|
|
||||||
|
#[AsTwigComponent]
|
||||||
|
final class StatusBadge
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<div{{ attributes }}>
|
<div{{ attributes }}>
|
||||||
<div class="flex flex-col bg-white border border-gray-200 border-t-4 border-t-orange-500 shadow-2xs rounded-xl dark:bg-sky-950 dark:border-neutral-700 dark:border-t-orange-500 dark:shadow-neutral-700/70
|
<div class="flex flex-col bg-sky-950 border-neutral-700 border-t-4 border-t-orange-500 rounded-xl
|
||||||
dark:backdrop-filter dark:backdrop-blur-md dark:bg-opacity-40
|
backdrop-filter backdrop-blur-md bg-opacity-40
|
||||||
">
|
">
|
||||||
<div class="p-4 md:p-5">
|
<div class="p-4 md:p-5">
|
||||||
<h3 class="mb-4 text-lg font-bold text-gray-800 dark:text-white">
|
<h3 class="mb-4 text-lg font-bold text-white">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,7 @@
|
|||||||
<span class="w-4 inline-block text-center text-gray-50">{{ download.progress }}</span>
|
<span class="w-4 inline-block text-center text-gray-50">{{ download.progress }}</span>
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="p-1.5 bg-green-600 rounded-full">
|
<twig:StatusBadge color="green" status="Completed" />
|
||||||
<span class="inline-block text-center text-gray-50">Complete</span>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -43,17 +43,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
{% if monitor.status == "New" %}
|
{% if monitor.status == "New" %}
|
||||||
<span class="p-1.5 bg-orange-500 rounded-full">
|
<twig:StatusBadge color="orange" status="{{ monitor.status }}" />
|
||||||
<span class="w-4 inline-block text-center text-gray-50">{{ monitor.status }}</span>
|
|
||||||
</span>
|
|
||||||
{% elseif monitor.status == "In Progress" or monitor.status == "Active" %}
|
{% elseif monitor.status == "In Progress" or monitor.status == "Active" %}
|
||||||
<span class="p-1.5 bg-purple-600 rounded-full">
|
<twig:StatusBadge color="purple" status="{{ monitor.status }}" />
|
||||||
<span class="inline-block text-center text-gray-50">{{ monitor.status }}</span>
|
|
||||||
</span>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="p-1.5 bg-green-600 rounded-full">
|
<twig:StatusBadge color="green" status="{{ monitor.status }}" />
|
||||||
<span class="inline-block text-center text-gray-50">{{ monitor.status }}</span>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
3
templates/components/StatusBadge.html.twig
Normal file
3
templates/components/StatusBadge.html.twig
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<span {{ attributes }} class="py-[3px] px-[8px] bg-{{ color|default('green') }}-600 rounded-lg inline-block text-center text-xs text-gray-50">
|
||||||
|
{{ status }}
|
||||||
|
</span>
|
||||||
5
templates/partial/alert-status.html.twig
Normal file
5
templates/partial/alert-status.html.twig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{# The status indicator for the Alert button. Rendering this will add a small colored span
|
||||||
|
to the Alert button, indicating there are unread alerts.
|
||||||
|
#}
|
||||||
|
|
||||||
|
<span style="position: absolute;width: 8px;height: 8px;background: greenyellow;border-radius: 5px; z-index: 1000;margin-left: 3px;margin-top: -5px;"></span>
|
||||||
Reference in New Issue
Block a user