]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Basic RTL tweaks feature-rtl
authorshamoon <4887959+shamoon@users.noreply.github.com>
Sun, 28 Apr 2024 05:28:50 +0000 (22:28 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Sun, 28 Apr 2024 05:28:50 +0000 (22:28 -0700)
src-ui/src/rtl.scss [new file with mode: 0644]
src-ui/src/styles.scss
src/documents/templates/index.html
src/documents/templates/paperless-ngx/base.html

diff --git a/src-ui/src/rtl.scss b/src-ui/src/rtl.scss
new file mode 100644 (file)
index 0000000..814733f
--- /dev/null
@@ -0,0 +1,87 @@
+[dir="rtl"] {
+  .btn-group,
+  .input-group,
+  .pagination {
+      flex-direction: row-reverse;
+  }
+
+  .sidebar {
+    right: 0;
+    left: auto;
+  }
+
+  .sidebar-slim-toggler {
+    right: auto;
+    left: -12px;
+  }
+
+  .ms-sm-auto {
+    margin-inline-start: auto !important;
+    margin-inline-end: 0 !important;
+  }
+
+  .nav {
+    padding-inline-start: 0;
+    padding-inline-end: 0;
+  }
+
+  .dropdown-toggle:after {
+    margin-inline-start: .255em;
+    margin-inline-end: 0;
+  }
+
+  .ms-auto {
+    margin-inline-start: auto !important;
+    margin-inline-end: 0 !important;
+  }
+
+  .ms-1 {
+    margin-inline-start: .25rem !important;
+    margin-inline-end: 0 !important;
+  }
+
+  .ms-2 {
+    margin-inline-start: .5rem !important;
+    margin-inline-end: 0 !important;
+  }
+
+  .ms-3 {
+    margin-inline-start: 1rem !important;
+    margin-inline-end: 0 !important;
+  }
+
+  .me-1 {
+    margin-inline-start: 0 !important;
+    margin-inline-end: .25rem !important;
+  }
+
+  .me-2 {
+    margin-inline-start: 0 !important;
+    margin-inline-end: .5rem !important;
+  }
+
+  .me-3 {
+    margin-inline-start: 0 !important;
+    margin-inline-end: 1rem !important;
+  }
+
+  .ps-1 {
+    padding-inline-start: .25rem !important;
+    padding-inline-end: 0 !important;
+  }
+
+  .ps-2 {
+    padding-inline-start: .5rem !important;
+    padding-inline-end: 0 !important;
+  }
+
+  .pe-1 {
+    padding-inline-start: 0 !important;
+    padding-inline-end: .25rem !important;
+  }
+
+  .pe-2 {
+    padding-inline-start: 0 !important;
+    padding-inline-end: .5rem !important;
+  }
+}
index 22e4b348b197944afe506f4670f087fde92c1edd..4e9f6870f7221237ba193068506233dc90376a77 100644 (file)
@@ -16,6 +16,7 @@ $form-file-button-hover-bg: var(--pngx-bg-alt);
 
 @import "node_modules/bootstrap/scss/bootstrap";
 @import "theme";
+@import "rtl";
 @import "~@ng-select/ng-select/themes/default.theme.css";
 @import "print";
 
index 2bb3758aca9b4f482f5373056772035bb88811af..8539028b1315cdbdb01ad8474030ed1377d47530 100644 (file)
@@ -1,8 +1,9 @@
 <!doctype html>
-
 {% load static i18n %}
+{% get_current_language as LANGUAGE_CODE %}
+{% get_current_language_bidi as LANGUAGE_IS_RTL %}
 
-<html lang="en" data-bs-theme="auto">
+<html lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_IS_RTL %}dir="rtl"{% else %}dir="ltr"{% endif %} data-bs-theme="auto">
 <head>
        <meta charset="utf-8">
        <title>Paperless-ngx</title>
index 7a15320fd5b3d9825d706371d9ee1da60463f385..c32222ae69ebf760ae1f02e52940d94719b05b20 100644 (file)
@@ -1,7 +1,9 @@
 <!doctype html>
 {% load static i18n %}
+{% get_current_language as LANGUAGE_CODE %}
+{% get_current_language_bidi as LANGUAGE_IS_RTL %}
 
-<html lang="en">
+<html lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_IS_RTL %}dir="rtl"{% else %}dir="ltr"{% endif %} data-bs-theme="auto">
     <head>
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">