Skip to content

Commit

Permalink
Merge bc52f94 into a173588
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed May 2, 2024
2 parents a173588 + bc52f94 commit 150961b
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cms/static/cms/css/4.1.1/cms.base.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cms/static/cms/css/4.1.1/cms.pagetree.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions cms/static/cms/sass/components/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@
$margin: math.div($toolbar-height - $toolbar-button-height, 2);
@extend .cms-toolbar-item-buttons;
float: right;
&:dir(rtl) {
float: left;
}
margin-inline-start: $margin;

.cancel-link {
Expand All @@ -264,6 +267,9 @@
}
.cms-modal-item-buttons-left {
float: left;
&:dir(rtl) {
float: right;
}
}

// alter footer when html markup is loaded
Expand Down
4 changes: 2 additions & 2 deletions cms/static/cms/sass/components/_structureboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
margin-inline-start: $structure-dragarea-padding-horizontal - 10px;
cursor: pointer;
transform: rotate(180deg);
[dir="rtl"] & {
&:dir(rtl) {
transform: rotate(0deg);
}
}
Expand All @@ -381,7 +381,7 @@
}
.cms-dragitem-expanded:before {
transform: rotate(-90deg);
[dir="rtl"] & {
&:dir(rtl) {
transform: rotate(-90deg);
}
}
Expand Down
20 changes: 7 additions & 13 deletions cms/static/cms/sass/components/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
// items
.cms-toolbar-item {
float: left;
[dir=rtl] & {
&:dir(rtl) {
float: right;
}
}
Expand Down Expand Up @@ -107,13 +107,13 @@
li {
position: relative;
float: left;
[dir=rtl] & {
&:dir(rtl) {
float: right;
}
}
li a {
float: left;
[dir=rtl] & {
&:dir(rtl) {
float: right;
}
color: $toolbar-menu-item-color;
Expand Down Expand Up @@ -184,7 +184,7 @@
display: block;
.cms-icon {
display: block;
[dir="rtl"] & {
&:dir(rtl) {
// undo arrow rotation for RTL
transform: rotate(0deg);
}
Expand Down Expand Up @@ -241,20 +241,14 @@

.cms-toolbar-item {
float: none;
[dir=rtl] & {
// a bit weird, but if removed, it will best match
// with [dir="rtl"] div.cms .cms-toolbar .cms-toolbar-item
// and will float to the right
float: none;
}
margin: $toolbar-menu-item-padding !important;
overflow: hidden;
margin-top: 5px;
margin-bottom: 8px;
}
.cms-toolbar-item-cms-mode-switcher a {
float: left !important;
[dir=rtl] & {
&:dir(rtl) {
float: right !important;
}
width: 50%;
Expand Down Expand Up @@ -415,7 +409,7 @@
cursor: pointer;
display: none;
float: right;
[dir=rtl] & {
&:dir(rtl) {
float: left;
}
position: relative;
Expand Down Expand Up @@ -570,7 +564,7 @@

a {
float: left;
[dir=rtl] & {
&:dir(rtl) {
float: right;
}
line-height: $toolbar-button-height;
Expand Down
16 changes: 8 additions & 8 deletions cms/static/cms/sass/components/pagetree/_tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
color: $gray-darkest;
background: none;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: right;
}
Expand Down Expand Up @@ -451,7 +451,7 @@
min-width: $pagetree-cell-inner-height;
height: $pagetree-cell-inner-height;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: left;
}
Expand Down Expand Up @@ -501,7 +501,7 @@
.cms-tree-reload {
float: right;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: left;
}
Expand Down Expand Up @@ -652,7 +652,7 @@
float: left;
margin-inline-end: 5px;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: right;
}
Expand All @@ -676,7 +676,7 @@
.cms-tree-filters {
float: right;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: left;
}
Expand Down Expand Up @@ -822,7 +822,7 @@
margin-inline-start: -1px;
}
.jstree-ocl {
float: left;
float: left;
position: relative;
inset-inline-start: $pagetree-nesting-padding;
font-size: 12px;
Expand All @@ -832,7 +832,7 @@
padding-block-end: 10px;
padding-inline-start: 0px;

[dir=rtl] & {
&:dir(rtl) {
// inline-start & inline-end are not widely supported
float: right;
}
Expand Down Expand Up @@ -892,7 +892,7 @@
color: $gray !important;
}

[dir=rtl] & {
&:dir(rtl) {
// no direct logical property for background-position
background-position: calc(100% - 2px) center;
}
Expand Down
4 changes: 2 additions & 2 deletions cms/static/cms/sass/settings/_cms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ $z-layers: (
"messages": 999999,
"toolbar": (
"base": 9999999,
"left": 10,
"right": 10,
"inset-inline-start": 10,
"inset-inline-end": 10,
),
"sideframe": (
"base": 999999,
Expand Down
2 changes: 2 additions & 0 deletions cms/templates/cms/toolbar/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class="cms cms-reset
{% if not user.is_authenticated %} cms-toolbar-auth{% endif %}
{% if debug %} cms-toolbar-debug{% endif %}"
{% if request.toolbar.toolbar_language %}lang="{{ request.toolbar.toolbar_language }}"{% endif %}
{% if request.toolbar.toolbar_language_bidi %}dir="{{ request.toolbar.toolbar_language_bidi|yesno:'rtl,ltr,auto' }}"{% endif %}
data-touch-action="none">

{% block toolbar_top %}
Expand Down
2 changes: 2 additions & 0 deletions cms/toolbar/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def __init__(self, request, request_path=None, _async=False):
self.is_staff = None
self.clipboard = None
self.toolbar_language = None
self.toolbar_language_bidi = None
self.show_toolbar = True
self.init_toolbar(request, request_path=request_path)
# Internal attribute to track whether we can cache
Expand Down Expand Up @@ -252,6 +253,7 @@ def init_toolbar(self, request, request_path=None):
user_settings.language = self.request_language
user_settings.save()
self.clipboard = user_settings.clipboard
self.toolbar_language_bidi = self.toolbar_language in settings.LANGUAGES_BIDI

if hasattr(self, 'toolbars'):
for key, toolbar in self.toolbars.items():
Expand Down

0 comments on commit 150961b

Please sign in to comment.