changes rtl

This commit is contained in:
Flatlogic Bot 2026-01-25 11:35:22 +00:00
parent 192b5d7408
commit 59204ba309
3 changed files with 17 additions and 5 deletions

View File

@ -84,6 +84,7 @@ TEMPLATES = [
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'django.template.context_processors.i18n',
# IMPORTANT: do not remove injects PROJECT_DESCRIPTION/PROJECT_IMAGE_URL and cache-busting timestamp # IMPORTANT: do not remove injects PROJECT_DESCRIPTION/PROJECT_IMAGE_URL and cache-busting timestamp
'core.context_processors.project_context', 'core.context_processors.project_context',
], ],

View File

@ -2,7 +2,7 @@
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% get_language_info for LANGUAGE_CODE as lang %} {% get_language_info for LANGUAGE_CODE as lang %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" dir="{{ lang.direction }}"> <html lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -19,7 +19,7 @@
{% endif %} {% endif %}
<!-- Bootstrap 5 --> <!-- Bootstrap 5 -->
{% if lang.direction == 'rtl' %} {% if LANGUAGE_BIDI %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css">
{% else %} {% else %}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
@ -30,12 +30,19 @@
<!-- Custom Styles --> <!-- Custom Styles -->
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}"> <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
{% if lang.direction == 'rtl' %} {% if LANGUAGE_BIDI %}
<style> <style>
/* Additional RTL overrides if needed */ /* RTL Overrides */
body { body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Example font suitable for Arabic */ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-align: right;
} }
/* Ensure Navbar flips correctly */
.navbar-nav {
padding-right: 0; /* Reset default padding */
}
/* Fix alignment for form inputs in RTL */ /* Fix alignment for form inputs in RTL */
.form-control, .form-select { .form-control, .form-select {
text-align: right; text-align: right;
@ -45,6 +52,10 @@
text-align: right; text-align: right;
width: 100%; width: 100%;
} }
/* Float helpers if needed (though flex is preferred) */
.float-end { float: left !important; }
.float-start { float: right !important; }
</style> </style>
{% endif %} {% endif %}