small ifx

This commit is contained in:
Faheed 2025-12-07 17:20:08 +03:00
parent 3f6bbd1cd5
commit c83b878be6
2 changed files with 15 additions and 14 deletions

View File

@ -163,6 +163,7 @@ logger = logging.getLogger(__name__)
User = get_user_model() User = get_user_model()
@login_required @login_required
@superuser_required
def settings(request): def settings(request):
return render(request,'user/settings.html') return render(request,'user/settings.html')

View File

@ -93,9 +93,9 @@
} }
/* ---------------------------------------------------- */ /* ---------------------------------------------------- */
/* 5. BADGE VISIBILITY FIXES (Guaranteed Colors) */ /* 5. badges VISIBILITY FIXES (Guaranteed Colors) */
/* ---------------------------------------------------- */ /* ---------------------------------------------------- */
.badge { .badges {
font-weight: 600; font-weight: 600;
line-height: 1.4; line-height: 1.4;
padding: 0.4em 0.6em; padding: 0.4em 0.6em;
@ -106,26 +106,26 @@
position: relative; position: relative;
} }
/* Dark Badges (CRUD Create/Delete & Login/Logout Type) - Use light text */ /* Dark badgess (CRUD Create/Delete & Login/Logout Type) - Use light text */
.badge-crud-create { .badges-crud-create {
background-color: var(--color-success) !important; background-color: var(--color-success) !important;
color: var(--color-text-on-dark) !important; color: var(--color-text-on-dark) !important;
} }
.badge-crud-delete { .badges-crud-delete {
background-color: var(--color-danger) !important; background-color: var(--color-danger) !important;
color: var(--color-text-on-dark) !important; color: var(--color-text-on-dark) !important;
} }
.badge-login-status { .badges-login-status {
background-color: var(--color-primary-dark) !important; background-color: var(--color-primary-dark) !important;
color: var(--color-text-on-dark) !important; color: var(--color-text-on-dark) !important;
} }
/* Light Badges (CRUD Update & Request Method) - Use dark text */ /* Light badgess (CRUD Update & Request Method) - Use dark text */
.badge-crud-update { .badges-crud-update {
background-color: var(--color-warning) !important; background-color: var(--color-warning) !important;
color: var(--color-text-dark) !important; color: var(--color-text-dark) !important;
} }
.badge-request-method { .badges-request-method {
background-color: var(--color-info) !important; background-color: var(--color-info) !important;
color: var(--color-text-dark) !important; color: var(--color-text-dark) !important;
} }
@ -228,9 +228,9 @@
<td>{{ log.user.email|default:"N/A" }}</td> <td>{{ log.user.email|default:"N/A" }}</td>
<td> <td>
<span class="badge rounded-pill <span class="badge rounded-pill
{% if log.event_type == 1 %}badge-crud-create {% if log.event_type == 1 %}badges-crud-create
{% elif log.event_type == 2 %}badge-crud-update {% elif log.event_type == 2 %}badges-crud-update
{% else %}badge-crud-delete{% endif %}"> {% else %}badges-crud-delete{% endif %}">
{% if log.event_type == 1 %}<i class="fas fa-plus-circle me-1"></i>{% trans "CREATE" %} {% if log.event_type == 1 %}<i class="fas fa-plus-circle me-1"></i>{% trans "CREATE" %}
{% elif log.event_type == 2 %}<i class="fas fa-edit me-1"></i>{% trans "UPDATE" %} {% elif log.event_type == 2 %}<i class="fas fa-edit me-1"></i>{% trans "UPDATE" %}
{% else %}<i class="fas fa-trash-alt me-1"></i>{% trans "DELETE" %}{% endif %} {% else %}<i class="fas fa-trash-alt me-1"></i>{% trans "DELETE" %}{% endif %}
@ -256,7 +256,7 @@
{% endwith %} {% endwith %}
</td> </td>
<td> <td>
<span class="badge rounded-pill badge-login-status"> <span class="badge rounded-pill badges-login-status">
{% if log.login_type == 0 %}{% trans "Login" %} {% if log.login_type == 0 %}{% trans "Login" %}
{% elif log.login_type == 1 %}{% trans "Logout" %} {% elif log.login_type == 1 %}{% trans "Logout" %}
{% else %}{% trans "Failed Login" %}{% endif %} {% else %}{% trans "Failed Login" %}{% endif %}
@ -277,7 +277,7 @@
<td>{{ log.datetime|date:"Y-m-d H:i:s" }}</td> <td>{{ log.datetime|date:"Y-m-d H:i:s" }}</td>
<td>{{ log.user.get_full_name|default:log.user.email|default:"Anonymous" }}</td> <td>{{ log.user.get_full_name|default:log.user.email|default:"Anonymous" }}</td>
<td> <td>
<span class="badge rounded-pill badge-request-method">{{ log.method }}</span> <span class="badge rounded-pill badges-request-method">{{ log.method }}</span>
</td> </td>
<td><code class="text-break small" style="color: var(--color-text-dark) !important;">{{ log.url}}</code></td> <td><code class="text-break small" style="color: var(--color-text-dark) !important;">{{ log.url}}</code></td>