[UPDT] HORILLA_THEME: Changed the default button and updated filter

This commit is contained in:
Horilla
2026-01-13 15:57:35 +05:30
parent de7ea970ad
commit c6fdfac7ff
4 changed files with 46 additions and 25 deletions

View File

@@ -102,7 +102,7 @@
<div
class="text-sm font-medium px-3 py-1 rounded-xl text-center {% if document.document %} {% if document.status == 'approved' %}bg-green-100 text-green-700 {% elif document.status == 'rejected' %}bg-red-100 text-red-700 {% elif document.status == 'requested' %}bg-blue-100 text-blue-700 {% endif %} {% else %} bg-amber-100 text-amber-700 {% endif %}"
>
{% if document.document %} {{document.status}}
{% if document.document %} {{document.get_status_display}}
{% else %} {% trans "No Document" %}
{% endif %}
</div>
@@ -115,10 +115,31 @@
<div class="flex gap-1 w-full">
{% if document.document %}
{% if perms.horilla_document.change_documentrequest %}
{% if document.status == "approved" %}
{% if document.status == "requested" %}
<button
class="oh-btn flex-1 text-base bg-green-100 text-green-700 hover:bg-green-200 hover:scale-105"
hx-get="{% url 'document-approve' document.id %}"
title="{% trans 'Approve' %}"
onclick="event.stopPropagation()"
>
<ion-icon class="me-1" name="checkmark-outline"></ion-icon>
</button>
<button
class="oh-btn flex-1 text-base bg-red-100 text-red-600 hover:bg-red-200 hover:scale-105 transition"
hx-get="{% url 'document-reject' document.id %}"
hx-target="#genericModalBody"
data-toggle="oh-modal-toggle"
data-target="#genericModal"
title="{% trans 'Reject' %}"
onclick="event.stopPropagation()"
>
<ion-icon class="me-1" name="close-outline"></ion-icon>
</button>
{% elif document.status == "approved" %}
<button
class="oh-btn flex-1 text-base bg-green-100 text-green-700 hover:bg-green-200 hover:scale-105 opacity-50 cursor-not-allowed"
title="{% trans 'Approve' %}"
onclick="event.stopPropagation()"
>
<ion-icon class="me-1" name="checkmark-outline"></ion-icon>
</button>
@@ -146,6 +167,7 @@
<button
class="oh-btn flex-1 text-base bg-red-100 text-red-600 hover:bg-red-200 hover:scale-105 transition opacity-50 cursor-not-allowed"
title="{% trans 'Reject' %}"
onclick="event.stopPropagation()"
>
<ion-icon class="me-1" name="close-outline"></ion-icon>
</button>

View File

@@ -15,7 +15,6 @@
@click="open = !open"
@click.outside="open = false"
title="Actions"
style="color: #e54f38;"
>
<ion-icon
name="ellipsis-vertical"

View File

@@ -163,8 +163,8 @@
padding: 10px;
display: flex;
justify-content: right;
color: orangered;
"
class="text-primary-600"
>
<span
data-toggle="oh-modal-toggle"

View File

@@ -48,27 +48,27 @@
</form>
<!-- Set as Default Button -->
<div class="px-4 pb-4 mt-auto">
{% if default_theme and default_theme.id == theme.id %}
<button type="button"
class="w-full flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-all duration-200 rounded-lg border bg-[{{ theme.primary_600 }}] text-white hover:bg-[{{ theme.primary_800 }}]"
hx-post="{% url 'horilla_theme:set_default_theme' %}" hx-target="#theme-cards-container"
hx-swap="outerHTML" hx-indicator="#loading-indicator" hx-vals='{"theme_id": "{{ theme.id }}"}'
onclick="event.stopPropagation();" title="{% trans 'Remove as default' %}">
<i class="fas fa-star text-sm"></i>
<span>{% trans 'Default Theme' %}</span>
</button>
{% else %}
<button type="button"
class="w-full flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-all duration-200 rounded-lg border bg-white text-gray-700 border-dark-50 hover:bg-[{{ theme.primary_600 }}] hover:text-white"
hx-post="{% url 'horilla_theme:set_default_theme' %}" hx-target="#theme-cards-container"
hx-swap="outerHTML" hx-indicator="#loading-indicator" hx-vals='{"theme_id": "{{ theme.id }}"}'
onclick="event.stopPropagation();" title="{% trans 'Set as default for login page' %}">
<i class="fas fa-star text-sm"></i>
<span>{% trans 'Set as Default' %}</span>
</button>
{% endif %}
</div>
{% comment %} <div class="px-4 pb-4 mt-auto">
{% if default_theme and default_theme.id == theme.id %}
<button type="button"
class="w-full flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-all duration-200 rounded-lg border bg-[{{ theme.primary_600 }}] text-white hover:bg-[{{ theme.primary_800 }}]"
hx-post="{% url 'horilla_theme:set_default_theme' %}" hx-target="#theme-cards-container"
hx-swap="outerHTML" hx-indicator="#loading-indicator" hx-vals='{"theme_id": "{{ theme.id }}"}'
onclick="event.stopPropagation();" title="{% trans 'Remove as default' %}">
<i class="fas fa-star text-sm"></i>
<span>{% trans 'Default Theme' %}</span>
</button>
{% else %}
<button type="button"
class="w-full flex items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-all duration-200 rounded-lg border bg-white text-gray-700 border-dark-50 hover:bg-[{{ theme.primary_600 }}] hover:text-white"
hx-post="{% url 'horilla_theme:set_default_theme' %}" hx-target="#theme-cards-container"
hx-swap="outerHTML" hx-indicator="#loading-indicator" hx-vals='{"theme_id": "{{ theme.id }}"}'
onclick="event.stopPropagation();" title="{% trans 'Set as default for login page' %}">
<i class="fas fa-star text-sm"></i>
<span>{% trans 'Set as Default' %}</span>
</button>
{% endif %}
</div> {% endcomment %}
</div>
{% empty %}
<div class="col-span-full text-center py-8 text-gray-500">