Skip to content

EspoCRM – Open Source CRM Application

Add theme direction parameter and improve RTL support (#3731)

Eymen Elkum5a81845cb647
diff --git a/application/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgrade.php b/application/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgrade.php
new file mode 100644
index 0000000000..5c889f027e
--- /dev/null
+++ b/application/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgrade.php
@@ -0,0 +1,147 @@
+<?php
+/************************************************************************
+ * This file is part of EspoCRM.
+ *
+ * EspoCRM – Open Source CRM application.
+ * Copyright (C) 2014-2026 EspoCRM, Inc.
+ * Website: https://www.espocrm.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU Affero General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
+ ************************************************************************/
+
+namespace Espo\Core\Upgrades\Migrations\V10_1;
+
+use Espo\Core\Upgrades\Migration\Script;
+use Espo\Core\Utils\Config;
+use Espo\Core\Utils\Config\ConfigWriter;
+use Espo\Core\Utils\Theme\Direction;
+use Espo\Entities\LeadCapture;
+use Espo\Entities\Portal;
+use Espo\Entities\Preferences;
+use Espo\Entities\User;
+use Espo\ORM\Entity;
+use Espo\ORM\EntityManager;
+
+class AfterUpgrade implements Script
+{
+ private const LEGACY_THEME = 'EspoRtl';
+ private const THEME = 'Espo';
+
+ public function __construct(
+ private EntityManager $entityManager,
+ private Config $config,
+ private ConfigWriter $configWriter,
+ ) {}
+
+ public function run(): void
+ {
+ $this->updateConfig();
+ $this->updatePreferences();
+ $this->updatePortals();
+ $this->updateLeadCaptures();
+ }
+
+ private function updateConfig(): void
+ {
+ if ($this->config->get('theme') !== self::LEGACY_THEME) {
+ return;
+ }
+
+ $this->configWriter->set('theme', self::THEME);
+ $this->configWriter->set('themeParams', $this->prepareThemeParams($this->config->get('themeParams')));
+ $this->configWriter->save();
+ }
+
+ private function updatePreferences(): void
+ {
+ $users = $this->entityManager
+ ->getRDBRepositoryByClass(User::class)
+ ->where([
+ User::ATTR_TYPE => [
+ User::TYPE_ADMIN,
+ User::TYPE_REGULAR,
+ User::TYPE_PORTAL,
+ ],
+ ])
+ ->find();
+
+ foreach ($users as $user) {
+ $preferences = $this->entityManager
+ ->getRepositoryByClass(Preferences::class)
+ ->getById($user->getId());
+
+ if (!$preferences || $preferences->get('theme') !== self::LEGACY_THEME) {
+ continue;
+ }
+
+ $this->updateThemeEntity($preferences);
+ }
+ }
+
+ private function updatePortals(): void
+ {
+ $portals = $this->entityManager
+ ->getRDBRepositoryByClass(Portal::class)
+ ->where(['theme' => self::LEGACY_THEME])
+ ->find();
+
+ foreach ($portals as $portal) {
+ $this->updateThemeEntity($portal);
+ }
+ }
+
+ private function updateLeadCaptures(): void
+ {
+ $leadCaptures = $this->entityManager
+ ->getRDBRepositoryByClass(LeadCapture::class)
+ ->where(['formTheme' => self::LEGACY_THEME])
+ ->find();
+
+ foreach ($leadCaptures as $leadCapture) {
+ $leadCapture->set('formTheme', self::THEME);
+ $this->entityManager->saveEntity($leadCapture);
+ }
+ }
+
+ private function updateThemeEntity(Entity $entity): void
+ {
+ $entity->set('theme', self::THEME);
+ $entity->set('themeParams', $this->prepareThemeParams($entity->get('themeParams')));
+
+ $this->entityManager->saveEntity($entity);
+ }
+
+ private function prepareThemeParams(mixed $themeParams): object
+ {
+ if (is_object($themeParams)) {
+ $themeParams = get_object_vars($themeParams);
+ }
+
+ if (!is_array($themeParams)) {
+ $themeParams = [];
+ }
+
+ $themeParams['navbar'] ??= 'top';
+ $themeParams['direction'] = Direction::Rtl->value;
+
+ return (object) $themeParams;
+ }
+}
diff --git a/application/Espo/Core/Utils/Client/ActionRenderer.php b/application/Espo/Core/Utils/Client/ActionRenderer.php
index 8e5ab08bac..075e768f94 100644
--- a/application/Espo/Core/Utils/Client/ActionRenderer.php
+++ b/application/Espo/Core/Utils/Client/ActionRenderer.php
@@ -33,6 +33,7 @@ use Espo\Core\Api\Response;
use Espo\Core\Utils\Client\ActionRenderer\Params;
use Espo\Core\Utils\Json;
use Espo\Core\Utils\ClientManager;
+use Espo\Core\Utils\Theme\Direction;
/**
* Renders a front-end page that executes a controller action. Utilized by entry points.
@@ -56,6 +57,7 @@ class ActionRenderer
scripts: $params->getScripts(),
pageTitle: $params->getPageTitle(),
theme: $params->getTheme(),
+ direction: $params->getDirection(),
);
$securityParams = new SecurityParams(
@@ -78,6 +80,7 @@ class ActionRenderer
array $scripts,
?string $pageTitle,
?string $theme,
+ ?Direction $direction,
): string {
$encodedData = Json::encode($data);
@@ -99,6 +102,7 @@ class ActionRenderer
scripts: $scripts,
pageTitle: $pageTitle,
theme: $theme,
+ direction: $direction,
);
return $this->clientManager->render($params);
diff --git a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php b/application/Espo/Core/Utils/Client/ActionRenderer/Params.php
index bca03a896e..971b48a48a 100644
--- a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php
+++ b/application/Espo/Core/Utils/Client/ActionRenderer/Params.php
@@ -30,6 +30,7 @@
namespace Espo\Core\Utils\Client\ActionRenderer;
use Espo\Core\Utils\Client\Script;
+use Espo\Core\Utils\Theme\Direction;
/**
* Immutable.
@@ -45,6 +46,7 @@ class Params
private array $scripts = [];
private ?string $pageTitle = null;
private ?string $theme = null;
+ private ?Direction $direction = null;
/**
* @param ?array<string, mixed> $data
@@ -130,6 +132,14 @@ class Params
return $obj;
}
+ public function withDirection(?Direction $direction): self
+ {
+ $obj = clone $this;
+ $obj->direction = $direction;
+
+ return $obj;
+ }
+
public function getController(): string
{
return $this->controller;
@@ -186,4 +196,9 @@ class Params
{
return $this->theme;
}
+
+ public function getDirection(): ?Direction
+ {
+ return $this->direction;
+ }
}
diff --git a/application/Espo/Core/Utils/Client/RenderParams.php b/application/Espo/Core/Utils/Client/RenderParams.php
index 974401e70b..c21ad515be 100644
--- a/application/Espo/Core/Utils/Client/RenderParams.php
+++ b/application/Espo/Core/Utils/Client/RenderParams.php
@@ -29,6 +29,8 @@
namespace Espo\Core\Utils\Client;
+use Espo\Core\Utils\Theme\Direction;
+
readonly class RenderParams
{
/**
@@ -36,11 +38,13 @@ readonly class RenderParams
* @param Script[] $scripts Scripts to include on the page.
* @param ?string $pageTitle A page title. Since 9.1.0.
* @param ?string $theme A page theme name.
+ * @param ?Direction $direction A document direction.
*/
public function __construct(
public ?string $runScript = null,
public array $scripts = [],
public ?string $pageTitle = null,
public ?string $theme = null,
+ public ?Direction $direction = null,
) {}
}
diff --git a/application/Espo/Core/Utils/ClientManager.php b/application/Espo/Core/Utils/ClientManager.php
index c52a53a5e3..b245a0527d 100644
--- a/application/Espo/Core/Utils/ClientManager.php
+++ b/application/Espo/Core/Utils/ClientManager.php
@@ -41,6 +41,7 @@ use Espo\Core\Utils\Config\ApplicationConfig;
use Espo\Core\Utils\Config\SystemConfig;
use Espo\Core\Utils\File\Manager as FileManager;
+use Espo\Core\Utils\Theme\Direction;
use Espo\Core\Utils\Theme\MetadataProvider as ThemeMetadataProvider;
use Slim\Psr7\Response as Psr7Response;
use Slim\ResponseEmitter;
@@ -179,6 +180,7 @@ class ClientManager
additionalScripts: $params->scripts,
pageTitle: $params->pageTitle,
theme: $params->theme,
+ direction: $params->direction,
);
}
@@ -193,6 +195,7 @@ class ClientManager
array $additionalScripts = [],
?string $pageTitle = null,
?string $theme = null,
+ ?Direction $direction = null,
): string {
$runScript ??= $this->runScript;
@@ -248,6 +251,8 @@ class ClientManager
$this->themeMetadataProvider->getStylesheet($theme) :
$this->themeManager->getStylesheet();
+ $direction ??= $this->themeManager->getDirection();
+
$data = [
'applicationId' => $this->applicationId,
'apiUrl' => $this->apiUrl,
@@ -256,6 +261,7 @@ class ClientManager
'appTimestamp' => $appTimestamp,
'loaderCacheTimestamp' => Json::encode($loaderCacheTimestamp),
'stylesheet' => $stylesheet,
+ 'direction' => $direction->value,
'theme' => Json::encode($theme),
'runScript' => $runScript,
'basePath' => $this->basePath,
diff --git a/application/Espo/Core/Utils/Theme/Direction.php b/application/Espo/Core/Utils/Theme/Direction.php
new file mode 100644
index 0000000000..02b98c4680
--- /dev/null
+++ b/application/Espo/Core/Utils/Theme/Direction.php
@@ -0,0 +1,36 @@
+<?php
+/************************************************************************
+ * This file is part of EspoCRM.
+ *
+ * EspoCRM – Open Source CRM application.
+ * Copyright (C) 2014-2026 EspoCRM, Inc.
+ * Website: https://www.espocrm.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU Affero General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
+ ************************************************************************/
+
+namespace Espo\Core\Utils\Theme;
+
+enum Direction: string
+{
+ case Ltr = 'ltr';
+ case Rtl = 'rtl';
+}
diff --git a/application/Espo/Core/Utils/ThemeManager.php b/application/Espo/Core/Utils/ThemeManager.php
index 9c76cbfddd..9535509674 100644
--- a/application/Espo/Core/Utils/ThemeManager.php
+++ b/application/Espo/Core/Utils/ThemeManager.php
@@ -29,6 +29,7 @@
namespace Espo\Core\Utils;
+use Espo\Core\Utils\Theme\Direction;
use Espo\Core\Utils\Theme\MetadataProvider;
class ThemeManager
@@ -53,6 +54,32 @@ class ThemeManager
return $this->metadataProvider->getStylesheet($this->getName());
}
+ public function getDirection(): Direction
+ {
+ $rawDirection = $this->config->get('themeParams.direction');
+ $direction = is_string($rawDirection) ? Direction::tryFrom($rawDirection) : null;
+
+ if ($direction) {
+ return $direction;
+ }
+
+ $rawDirection = $this->metadata->get(
+ ['themes', $this->getName(), 'params', 'direction', 'default']
+ );
+
+ if (!is_string($rawDirection)) {
+ return Direction::Ltr;
+ }
+
+ $direction = Direction::tryFrom($rawDirection);
+
+ if (!$direction) {
+ return Direction::Ltr;
+ }
+
+ return $direction;
+ }
+
public function getLogoSrc(): string
{
return $this->metadata->get(['themes', $this->getName(), 'logo']) ?? $this->defaultLogoSrc;
diff --git a/application/Espo/EntryPoints/LeadCaptureForm.php b/application/Espo/EntryPoints/LeadCaptureForm.php
index f7f967642a..301f39fe88 100644
--- a/application/Espo/EntryPoints/LeadCaptureForm.php
+++ b/application/Espo/EntryPoints/LeadCaptureForm.php
@@ -74,7 +74,8 @@ class LeadCaptureForm implements EntryPoint
$params = $params
->withFrameAncestors($leadCapture->getFormFrameAncestors())
->withPageTitle($leadCapture->getFormTitle())
- ->withTheme($leadCapture->getFormTheme());
+ ->withTheme($leadCapture->getFormTheme())
+ ->withDirection($this->service->getDirection($leadCapture));
if ($captchaScript) {
$params = $params->withScripts([new Script(source: $captchaScript)]);
diff --git a/application/Espo/Resources/defaults/config.php b/application/Espo/Resources/defaults/config.php
index cf636d188b..fc5f47df81 100644
--- a/application/Espo/Resources/defaults/config.php
+++ b/application/Espo/Resources/defaults/config.php
@@ -191,7 +191,10 @@ return [
'b2cMode' => false,
'restrictedMode' => false,
'theme' => 'Espo',
- 'themeParams' => (object) ['navbar' => 'side'],
+ 'themeParams' => (object) [
+ 'navbar' => 'side',
+ 'direction' => 'ltr',
+ ],
'massEmailMaxPerHourCount' => 100,
'massEmailMaxPerBatchCount' => null,
'massEmailVerp' => false,
diff --git a/application/Espo/Resources/i18n/en_US/Global.json b/application/Espo/Resources/i18n/en_US/Global.json
index 58fb751335..4833878c0c 100644
--- a/application/Espo/Resources/i18n/en_US/Global.json
+++ b/application/Espo/Resources/i18n/en_US/Global.json
@@ -978,7 +978,6 @@
"Dark": "Dark",
"Light": "Light",
"Espo": "Espo",
- "EspoRtl": "RTL",
"Sakura": "Sakura",
"Violet": "Violet",
"Hazyblue": "Hazyblue",
@@ -988,6 +987,10 @@
"side": "Side Navbar",
"top": "Top Navbar"
},
+ "themeDirections": {
+ "ltr": "LTR",
+ "rtl": "RTL"
+ },
"fieldValidations": {
"required": "Required",
"maxCount": "Max Count",
diff --git a/application/Espo/Resources/i18n/ur_IN/Global.json b/application/Espo/Resources/i18n/ur_IN/Global.json
index 08d0fb99b6..7d01b729e1 100644
--- a/application/Espo/Resources/i18n/ur_IN/Global.json
+++ b/application/Espo/Resources/i18n/ur_IN/Global.json
@@ -825,7 +825,6 @@
"Sakura": "ساکورا",
"Violet": "وایلیٹ",
"Hazyblue": "ہیزی بلو",
- "EspoRtl": "rtl",
"Glass": "گلاس",
"Light": "روشنی"
},
@@ -920,4 +919,4 @@
"tabs": {
"Stream": "ندی"
}
-}
\ No newline at end of file
+}
diff --git a/application/Espo/Resources/metadata/themes/Espo.json b/application/Espo/Resources/metadata/themes/Espo.json
index 23f161550a..fa735191b1 100644
--- a/application/Espo/Resources/metadata/themes/Espo.json
+++ b/application/Espo/Resources/metadata/themes/Espo.json
@@ -10,6 +10,14 @@
"side",
"top"
]
+ },
+ "direction": {
+ "type": "enum",
+ "default": "ltr",
+ "options": [
+ "ltr",
+ "rtl"
+ ]
}
},
"mappedParams": {
diff --git a/application/Espo/Resources/metadata/themes/EspoRtl.json b/application/Espo/Resources/metadata/themes/EspoRtl.json
deleted file mode 100644
index f76e989533..0000000000
--- a/application/Espo/Resources/metadata/themes/EspoRtl.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "stylesheet": "client/css/espo/espo-rtl.css",
- "stylesheetIframe": "client/css/espo/espo-rtl-iframe.css",
- "logo": "client/img/logo-light.svg",
- "params": {
- "navbar": {
- "type": "enum",
- "default": "top",
- "options": [
- "top",
- "side"
- ]
- }
- }
-}
diff --git a/application/Espo/Tools/LeadCapture/FormService.php b/application/Espo/Tools/LeadCapture/FormService.php
index 5258b2c620..a9678145bf 100644
--- a/application/Espo/Tools/LeadCapture/FormService.php
+++ b/application/Espo/Tools/LeadCapture/FormService.php
@@ -37,6 +37,7 @@ use Espo\Core\Utils\Config;
use Espo\Core\Utils\DataCache;
use Espo\Core\Utils\Language;
use Espo\Core\Utils\Metadata;
+use Espo\Core\Utils\Theme\Direction;
use Espo\Core\Utils\Theme\MetadataProvider as ThemeMetadataProvider;
use Espo\Core\Utils\ThemeManager;
use Espo\Entities\Integration;
@@ -50,6 +51,7 @@ use RuntimeException;
class FormService
{
private const CACHE_KEY_PREFIX = 'leadCaptureForm';
+ private const RTL_LANGUAGE_CODE_LIST = ['ar', 'fa', 'he', 'ur'];
public function __construct(
private EntityManager $entityManager,
@@ -83,6 +85,14 @@ class FormService
return [$leadCapture, $data, $captchaScript];
}
+ public function getDirection(LeadCapture $leadCapture): Direction
+ {
+ $language = $leadCapture->getFormLanguage() ?? $this->config->get('language') ?? 'en_US';
+ $languageCode = strtolower(substr($language, 0, 2));
+
+ return in_array($languageCode, self::RTL_LANGUAGE_CODE_LIST, true) ? Direction::Rtl : Direction::Ltr;
+ }
+
/**
* @return array<string, mixed>
*/
diff --git a/client/modules/crm/src/views/calendar/calendar.js b/client/modules/crm/src/views/calendar/calendar.js
index 50e0fcbc19..385890a805 100644
--- a/client/modules/crm/src/views/calendar/calendar.js
+++ b/client/modules/crm/src/views/calendar/calendar.js
@@ -896,6 +896,7 @@ class CalendarView extends View {
/** @type {CalendarOptions & Object.<string, *>} */
const options = {
+ direction: this.getThemeManager().getDirection(),
scrollTime: this.scrollHour + ':00',
headerToolbar: false,
slotLabelFormat: slotLabelFormat,
diff --git a/client/modules/crm/src/views/calendar/timeline.js b/client/modules/crm/src/views/calendar/timeline.js
index d6605b6079..0edc82e650 100644
--- a/client/modules/crm/src/views/calendar/timeline.js
+++ b/client/modules/crm/src/views/calendar/timeline.js
@@ -595,6 +595,7 @@ class TimelineView extends View {
const itemsDataSet = new DataSet(eventList);
this.timeline = new Timeline($timeline.get(0), itemsDataSet, this.groupsDataSet, {
+ rtl: this.getThemeManager().getDirection() === 'rtl',
dataAttributes: 'all',
start: this.start.toDate(),
end: this.end.toDate(),
diff --git a/client/res/templates/record/detail.tpl b/client/res/templates/record/detail.tpl
index 0f3b285fdd..83e3235702 100644
--- a/client/res/templates/record/detail.tpl
+++ b/client/res/templates/record/detail.tpl
@@ -7,7 +7,7 @@
role="group"
>{{{buttons}}}</div>
{{#if navigateButtonsEnabled}}
- <div class="pull-right">
+ <div class="pull-end">
<div class="btn-group" role="group">
<button
type="button"
@@ -39,7 +39,7 @@
role="group"
>{{{editButtons}}}</div>
<div
- class="btn-group pull-right"
+ class="btn-group pull-end"
role="group"
>{{{editSideButtons}}}</div>
</div>
diff --git a/client/res/templates/record/edit.tpl b/client/res/templates/record/edit.tpl
index 479f666799..2788d3ca8a 100644
--- a/client/res/templates/record/edit.tpl
+++ b/client/res/templates/record/edit.tpl
@@ -7,7 +7,7 @@
role="group"
>{{{buttons}}}</div>
<div
- class="btn-group pull-right"
+ class="btn-group pull-end"
role="group"
>{{{sideButtons}}}</div>
</div>
diff --git a/client/src/app.js b/client/src/app.js
index 97c6184fab..8e831ddc87 100644
--- a/client/src/app.js
+++ b/client/src/app.js
@@ -487,6 +487,7 @@ class App {
this.loadStylesheet();
}
+ this.applyThemeDirection();
this.applyUserStyle();
if (this.anotherUser) {
@@ -966,6 +967,8 @@ class App {
this.preferences.clear();
this.acl.clear();
+ this.applyThemeDirection();
+
if (!silent) {
this.storage.clear('user', 'auth');
this.storage.clear('user', 'anotherUser');
@@ -1023,6 +1026,16 @@ class App {
element.setAttribute('href', path);
}
+ /**
+ * @private
+ */
+ applyThemeDirection() {
+ const direction = this.themeManager.getDirection();
+
+ document.documentElement.dir = direction;
+ document.body.dataset.direction = direction;
+ }
+
/**
* @private
*/
diff --git a/client/src/theme-manager.js b/client/src/theme-manager.js
index 2cbab3c425..be7f3d6147 100644
--- a/client/src/theme-manager.js
+++ b/client/src/theme-manager.js
@@ -176,6 +176,17 @@ class ThemeManager {
return link;
}
+ /**
+ * Get the normalized document direction.
+ *
+ * @returns {'ltr'|'rtl'}
+ */
+ getDirection() {
+ const direction = this.getParam('direction');
+
+ return direction === 'rtl' ? 'rtl' : 'ltr';
+ }
+
/**
* Get a theme parameter.
*
diff --git a/client/src/views/admin/user-interface.js b/client/src/views/admin/user-interface.js
index e19eeeff0b..ff57aa0de7 100644
--- a/client/src/views/admin/user-interface.js
+++ b/client/src/views/admin/user-interface.js
@@ -41,9 +41,13 @@ export default class extends SettingsEditRecordView {
this.listenTo(this.model, 'change:scopeColorsDisabled', () => this.controlColorsField());
this.on('save', initialAttributes => {
+ const themeParams = this.model.get('themeParams') || {};
+ const initialThemeParams = initialAttributes.themeParams || {};
+
if (
this.model.get('theme') !== initialAttributes.theme ||
- (this.model.get('themeParams').navbar || {}) !== (initialAttributes.themeParams).navbar
+ themeParams.navbar !== initialThemeParams.navbar ||
+ themeParams.direction !== initialThemeParams.direction
) {
this.setConfirmLeaveOut(false);
diff --git a/client/src/views/fields/wysiwyg.ts b/client/src/views/fields/wysiwyg.ts
index 0fbf5ec19e..0ad33295a4 100644
--- a/client/src/views/fields/wysiwyg.ts
+++ b/client/src/views/fields/wysiwyg.ts
@@ -455,7 +455,8 @@ class WysiwygFieldView <
}
// noinspection HtmlRequiredTitleElement
- const documentHtml = `<head>${headHtml}</head><body>${bodyHtml}</body>`
+ const direction = this.getThemeManager().getDirection();
+ const documentHtml = `<html dir="${direction}"><head>${headHtml}</head><body>${bodyHtml}</body></html>`
// @ts-ignore
documentElement.write(documentHtml);
diff --git a/client/src/views/lead-capture/fields/form-theme.js b/client/src/views/lead-capture/fields/form-theme.js
index d634222348..0380c67fb7 100644
--- a/client/src/views/lead-capture/fields/form-theme.js
+++ b/client/src/views/lead-capture/fields/form-theme.js
@@ -32,14 +32,9 @@ export default class FormThemeFieldView extends EnumFieldView {
setupOptions() {
const list = Object.keys(this.getMetadata().get('themes') || {})
- .sort((v1, v2) => {
- if (v2 === 'EspoRtl') {
- return -1;
- }
-
- return this.translate(v1, 'theme')
- .localeCompare(this.translate(v2, 'theme'));
- });
+ .sort(
+ (v1, v2) => this.translate(v1, 'theme').localeCompare(this.translate(v2, 'theme'))
+ );
this.params.options = ['', ...list];
}
diff --git a/client/src/views/preferences/fields/theme.js b/client/src/views/preferences/fields/theme.js
index d2dde8b8dc..8b2d0aa96d 100644
--- a/client/src/views/preferences/fields/theme.js
+++ b/client/src/views/preferences/fields/theme.js
@@ -32,13 +32,7 @@ export default class extends ThemeSettingsFieldView {
setupOptions() {
this.params.options = Object.keys(this.getMetadata().get('themes') || {})
- .sort((v1, v2) => {
- if (v2 === 'EspoRtl') {
- return -1;
- }
-
- return this.translate(v1, 'themes').localeCompare(this.translate(v2, 'themes'));
- });
+ .sort((v1, v2) => this.translate(v1, 'themes').localeCompare(this.translate(v2, 'themes')));
this.params.options.unshift('');
}
@@ -56,8 +50,16 @@ export default class extends ThemeSettingsFieldView {
afterRenderDetail() {
const navbar = this.getNavbarValue() || this.getDefaultNavbar();
+ const direction = this.getDirectionValue() || this.getDefaultDirection();
+
+ [
+ [navbar, 'themeNavbars'],
+ [direction, 'themeDirections'],
+ ].forEach(([value, category]) => {
+ if (!value) {
+ return;
+ }
- if (navbar) {
this.$el
.append(' ')
.append(
@@ -65,8 +67,8 @@ export default class extends ThemeSettingsFieldView {
)
.append(' ')
.append(
- $('<span>').text(this.translate(navbar, 'themeNavbars'))
+ $('<span>').text(this.translate(value, category))
)
- }
+ });
}
}
diff --git a/client/src/views/preferences/record/edit.js b/client/src/views/preferences/record/edit.js
index 38ef63bce7..5eab1027a9 100644
--- a/client/src/views/preferences/record/edit.js
+++ b/client/src/views/preferences/record/edit.js
@@ -150,6 +150,7 @@ class PreferencesEditRecordView extends EditRecordView {
this.model.get('language') !== initialAttributes.language ||
this.model.get('theme') !== initialAttributes.theme ||
(this.model.get('themeParams') || {}).navbar !== (initialAttributes.themeParams || {}).navbar ||
+ (this.model.get('themeParams') || {}).direction !== (initialAttributes.themeParams || {}).direction ||
this.model.get('pageContentWidth') !== initialAttributes.pageContentWidth
) {
this.setConfirmLeaveOut(false);
diff --git a/client/src/views/settings/fields/theme.js b/client/src/views/settings/fields/theme.js
index 577e4e00d7..e970c21035 100644
--- a/client/src/views/settings/fields/theme.js
+++ b/client/src/views/settings/fields/theme.js
@@ -54,6 +54,13 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
</select>
</div>
{{/if}}
+ {{#if directionOptionList.length}}
+ <div>
+ <select data-name="themeDirection" class="form-control">
+ {{options directionOptionList direction translatedOptions=directionTranslatedOptions}}
+ </select>
+ </div>
+ {{/if}}
</div>
`
@@ -68,6 +75,14 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
data.navbarTranslatedOptions[item] = this.translate(item, 'themeNavbars');
});
+ data.directionOptionList = this.getDirectionOptionList();
+ data.direction = this.getDirectionValue() || this.getDefaultDirection();
+
+ data.directionTranslatedOptions = {};
+ data.directionOptionList.forEach(item => {
+ data.directionTranslatedOptions[item] = this.translate(item, 'themeDirections');
+ });
+
return data;
}
@@ -88,10 +103,13 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
afterRenderEdit() {
this.$navbar = this.$el.find('[data-name="themeNavbar"]');
+ this.$direction = this.$el.find('[data-name="themeDirection"]');
this.$navbar.on('change', () => this.trigger('change'));
+ this.$direction.on('change', () => this.trigger('change'));
Select.init(this.$navbar);
+ Select.init(this.$direction);
}
/**
@@ -152,6 +170,64 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
return defs.default || null;
}
+ /**
+ * @protected
+ * @return {string}
+ */
+ getDirectionValue() {
+ const params = this.model.get('themeParams') || {};
+
+ return params.direction;
+ }
+
+ /**
+ * @protected
+ * @return {Record|null}
+ */
+ getDirectionDefs() {
+ if (!this.themeManager) {
+ return null;
+ }
+
+ const params = this.themeManager.getParam('params');
+
+ if (!params || !params.direction) {
+ return null;
+ }
+
+ return Espo.Utils.cloneDeep(params.direction);
+ }
+
+ /**
+ * @private
+ * @return {string[]}
+ */
+ getDirectionOptionList() {
+ const defs = this.getDirectionDefs();
+
+ if (!defs) {
+ return [];
+ }
+
+ const optionList = defs.options || [];
+
+ if (!optionList.length || optionList.length === 1) {
+ return [];
+ }
+
+ return optionList;
+ }
+
+ /**
+ * @protected
+ * @return {string|null}
+ */
+ getDefaultDirection() {
+ const defs = this.getDirectionDefs() || {};
+
+ return defs.default || null;
+ }
+
/**
* @private
*/
@@ -178,14 +254,9 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
setupOptions() {
this.params.options = Object.keys(this.getMetadata().get('themes') || {})
- .sort((v1, v2) => {
- if (v2 === 'EspoRtl') {
- return -1;
- }
-
- return this.translate(v1, 'theme')
- .localeCompare(this.translate(v2, 'theme'));
- });
+ .sort(
+ (v1, v2) => this.translate(v1, 'theme').localeCompare(this.translate(v2, 'theme'))
+ );
}
fetch() {
@@ -197,6 +268,10 @@ export default class ThemeSettingsFieldView extends EnumFieldView {
params.navbar = this.$navbar.val();
}
+ if (this.$direction.length) {
+ params.direction = this.$direction.val();
+ }
+
data.themeParams = params;
return data;
diff --git a/client/src/views/site/master.js b/client/src/views/site/master.js
index 2df1ccf8b1..c59173cd4c 100644
--- a/client/src/views/site/master.js
+++ b/client/src/views/site/master.js
@@ -118,6 +118,7 @@ class MasterSiteView extends View {
body.dataset[param] = this.getThemeManager().getParam(param);
}
+ body.dataset.direction = this.getThemeManager().getDirection();
body.dataset.isDark = this.getThemeManager().getParam('isDark') ?? false;
body.dataset.themeName = this.getThemeManager().getName();
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/alerts-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/alerts-rtl.less
deleted file mode 100644
index 2d6aad8082..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/alerts-rtl.less
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// RTL Alerts
-// --------------------------------------------------
-
-
-// Dismissable alerts
-//
-// Expand the left padding and account for the close button's positioning.
-
-.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
-.alert-dismissible {
-
- // Adjust close link position
- .close {
- right: auto;
- left: -21px;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/badges-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/badges-rtl.less
deleted file mode 100644
index ba0f4292e0..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/badges-rtl.less
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// RTL Badges
-// --------------------------------------------------
-
-
-// Base class
-.badge {
-
- .nav-pills > li > a > & {
- margin-left: 0px;
- margin-right: 3px;
- }
-
- .list-group-item > & {
- float: left;
- }
- .list-group-item > & + & {
- margin-left: 5px;
- margin-right: auto;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-flipped.less b/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-flipped.less
deleted file mode 100644
index d04b46496f..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-flipped.less
+++ /dev/null
@@ -1,64 +0,0 @@
-// --------------------------------------------------
-// Deprecated flips for Bootstrap RTL v3.x
-// Morteza Ansarinia
-// http://github.com/morteza/bootstrap-rtl
-// --------------------------------------------------
-
-// Regular, semantically correct Bootstrap RTL
-// Core variables and mixins imported from the latest original bootstrap
-@import "../bootstrap/less/variables.less";
-@import "variables-rtl.less";
-@import "mixins-flipped.less";
-
-// ---- Single side border-radius ----
-
-.border-right-radius(@radius) {
- border-bottom-left-radius: @radius;
- border-top-left-radius: @radius;
-}
-.border-left-radius(@radius) {
- border-bottom-right-radius: @radius;
- border-top-right-radius: @radius;
-}
-
-// Reset and dependencies
-@import "normalize-rtl.less";
-
-
-// Core CSS
-
-@import "type-rtl.less";
-
-@import "grid-rtl.less";
-@import "tables-rtl.less";
-@import "forms-rtl.less";
-
-
-// Components
-//@import "component-animations.less";
-@import "dropdowns-rtl.less";
-@import "button-groups-rtl.less";
-@import "input-groups-rtl.less";
-@import "navs-rtl.less";
-@import "navbar-rtl.less";
-
-@import "badges-rtl.less";
-@import "alerts-rtl.less";
-@import "progress-bars-rtl.less";
-@import "media-rtl.less";
-@import "list-group-rtl.less";
-@import "panels-rtl.less";
-@import "responsive-embed-rtl.less";
-
-@import "close-rtl.less";
-
-
-@import "modals-rtl.less";
-
-@import "popovers-rtl.less";
-@import "carousel-rtl.less";
-
-
-@import "utilities-rtl.less";
-
-@import "flipped.less";
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-rtl.less
deleted file mode 100644
index 725256f633..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/bootstrap-rtl.less
+++ /dev/null
@@ -1,49 +0,0 @@
-// --------------------------------------------------
-// Right-to-Left (RTL) Theme for Bootstrap 3.x
-// Morteza Ansarinia
-// http://github.com/morteza/bootstrap-rtl
-// --------------------------------------------------
-
-// Core variables and mixins imported from the latest original bootstrap
-@import "../../espo/bootstrap/variables.less";
-@import "variables-rtl.less";
-@import "mixins-rtl.less";
-
-// Reset and dependencies
-@import "normalize-rtl.less";
-//@import "print.less";
-//@import "glyphicons.less";
-
-// Core CSS
-//@import "scaffolding.less";
-@import "type-rtl.less";
-//@import "code.less";
-@import "grid-rtl.less";
-@import "tables-rtl.less";
-@import "forms-rtl.less";
-//@import "buttons.less";
-
-// Components
-//@import "component-animations.less";
-@import "dropdowns-rtl.less";
-@import "button-groups-rtl.less";
-@import "input-groups-rtl.less";
-@import "navs-rtl.less";
-@import "navbar-rtl.less";
-@import "badges-rtl.less";
-@import "alerts-rtl.less";
-@import "progress-bars-rtl.less";
-@import "media-rtl.less";
-@import "list-group-rtl.less";
-@import "panels-rtl.less";
-@import "responsive-embed-rtl.less";
-@import "close-rtl.less";
-
-// Components w/ JavaScript
-@import "modals-rtl.less";
-@import "popovers-rtl.less";
-@import "carousel-rtl.less";
-
-// Utility classes
-@import "utilities-rtl.less";
-//@import "responsive-utilities.less";
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/button-groups-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/button-groups-rtl.less
deleted file mode 100644
index f7064008ca..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/button-groups-rtl.less
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// RTL Button groups
-// --------------------------------------------------
-
-// Make the div behave like a button
-.btn-group,
-.btn-group-vertical {
- > .btn {
- float: right;
- }
-}
-
-// Prevent double borders when buttons are next to each other
-.btn-group {
- .btn + .btn,
- .btn + .btn-group,
- .btn-group + .btn,
- .btn-group + .btn-group {
- margin-right: -1px;
- margin-left: 0px;
- }
-}
-
-// Optional: Group multiple button groups together for a toolbar
-.btn-toolbar {
- margin-right: -5px; // Offset the first child's margin
- margin-left: 0px;
-
- .btn-group,
- .input-group {
- float: right;
- }
- > .btn,
- > .btn-group,
- > .input-group {
- margin-right: 5px;
- margin-left: 0px;
- }
-}
-
-// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
-.btn-group > .btn:first-child {
- margin-right: 0;
- &:not(:last-child):not(.dropdown-toggle) {
- .border-left-radius(0);
- }
-}
-// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
- .border-right-radius(0);
-}
-
-// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
-.btn-group > .btn-group {
- float: right;
-}
-
-.btn-group.btn-group-justified > .btn,
-.btn-group.btn-group-justified > .btn-group {
- float: none;
-}
-
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-.btn-group > .btn-group:first-child {
- > .btn:last-child,
- > .dropdown-toggle {
- .border-left-radius(0);
- }
-}
-.btn-group > .btn-group:last-child > .btn:first-child {
- .border-right-radius(0);
-}
-
-// Reposition the caret
-.btn .caret {
- margin-right: 0;
-}
-
-// Vertical button groups
-// ----------------------
-
-.btn-group-vertical {
-
- > .btn + .btn,
- > .btn + .btn-group,
- > .btn-group + .btn,
- > .btn-group + .btn-group {
- margin-top: -1px;
- margin-right: 0;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/carousel-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/carousel-rtl.less
deleted file mode 100644
index e5650ae1f6..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/carousel-rtl.less
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// RTL Carousel
-// --------------------------------------------------
-
-
-// Left/right controls for nav
-// ---------------------------
-
-.carousel-control {
- right: 0;
- bottom: 0;
-
- // Set gradients for backgrounds
- &.left {
- right: auto;
- left: 0;
- #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));
- }
- &.right {
- left: auto;
- right: 0;
- #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));
- }
-
- .icon-prev,
- .glyphicon-chevron-left {
- left: 50%;
- right: auto;
- margin-right: -10px;
- }
- .icon-next,
- .glyphicon-chevron-right {
- right: 50%;
- left: auto;
- margin-left: -10px;
- }
-}
-
-// Optional indicator pips
-//
-// Add an unordered list with the following class and add a list item for each
-// slide your carousel holds.
-
-.carousel-indicators {
- right: 50%;
- left: 0;
- margin-right: -30%;
- margin-left: 0;
- padding-left: 0;
-
-}
-
-// Scale up controls for tablets and up
-@media screen and (min-width: @screen-sm-min) {
-
- // Scale up the controls a smidge
- .carousel-control {
- .glyphicon-chevron-left,
- .icon-prev {
- margin-left: 0;
- margin-right: -15px;
- }
- .glyphicon-chevron-right,
- .icon-next {
- margin-left: 0;
- margin-right: -15px;
- }
- }
-
- // Show and left align the captions
- .carousel-caption {
- left: 20%;
- right: 20%;
- padding-bottom: 30px;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/close-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/close-rtl.less
deleted file mode 100644
index b61439574c..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/close-rtl.less
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// RTL Close icons
-// --------------------------------------------------
-
-
-.close {
- float: left;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/dropdowns-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/dropdowns-rtl.less
deleted file mode 100644
index 808252c7fb..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/dropdowns-rtl.less
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// RTL Dropdown menus
-// --------------------------------------------------
-
-// Dropdown arrow/caret
-.caret {
- margin-right: 2px;
- margin-left: 0;
-}
-
-// The dropdown menu (ul)
-.dropdown-menu {
- right: auto;
- left: 0;
- float: left;
- text-align: right; // Ensures proper alignment if parent has it changed (e.g., modal footer)
-
- // Aligns the dropdown menu to right
- //
- // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
- &.pull-right {
- left: 0;
- right: auto;
- float: right;
- }
-}
-
-// Menu positioning
-//
-// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
-// menu with the parent.
-.dropdown-menu-right {
- left: auto; // Reset the default from `.dropdown-menu`
- right: 0;
-}
-// With v3, we enabled auto-flipping if you have a dropdown within a right
-// aligned nav component. To enable the undoing of that, we provide an override
-// to restore the default dropdown menu alignment.
-//
-// This is only for left-aligning a dropdown menu within a `.navbar-right` or
-// `.pull-right` nav component.
-.dropdown-menu-left {
- left: 0;
- right: auto;
-}
-
-// Component alignment
-//
-// Reiterate per navbar.less and the modified component alignment there.
-
-@media (min-width: @grid-float-breakpoint) {
- .navbar-right {
- .dropdown-menu {
- .dropdown-menu-right();
- }
- // Necessary for overrides of the default right aligned menu.
- // Will remove come v4 in all likelihood.
- .dropdown-menu-left {
- .dropdown-menu-left();
- }
- }
-}
-
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/flipped.less b/frontend/less/espo-rtl/bootstrap-rtl/flipped.less
deleted file mode 100644
index 4d5a57a6d6..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/flipped.less
+++ /dev/null
@@ -1,83 +0,0 @@
-// ---------------------------------------------
-// Flipped classes
-// ---------------------------------------------
-
-// ---- Utilities ----
-.pull-right {
- float: left !important;
-}
-.pull-left {
- float: right !important;
-}
-
-//TODO carousel
-//TODO Glyphicons
-
-// ---- Dropdown ----
-.dropdown-menu-left {
- left: auto;
- right: 0;
-}
-
-// ---- Media ----
-.media-right,
-.media > .pull-right {
- padding-right: 10px;
- padding-left: initial;
-}
-
-.media-left,
-.media > .pull-left {
- padding-left: 10px;
- padding-right: initial;
-}
-
-// ---- Navbar ----
-@media (min-width: @grid-float-breakpoint) {
- .navbar-left { .pull-left(); }
- .navbar-right {
- .pull-right();
-
- ~ .navbar-right {
- margin-left: 0;
- margin-right: initial;
- }
- }
-}
-
-// ---- Tooltip ----
-.tooltip {
- &.top-left .tooltip-arrow {
- left: @tooltip-arrow-width;
- }
- &.top-right .tooltip-arrow {
- right: @tooltip-arrow-width;
- }
- &.right .tooltip-arrow {
- right: 0;
- border-left-color: @tooltip-arrow-color;
- }
- &.left .tooltip-arrow {
- left: 0;
- border-right-color: @tooltip-arrow-color;
- }
- &.bottom-left .tooltip-arrow {
- left: @tooltip-arrow-width;
- }
- &.bottom-right .tooltip-arrow {
- right: @tooltip-arrow-width;
- }
-}
-
-// ---- Type ----
-.text-left { text-align: right; }
-.text-right { text-align: left; }
-
-//DEPRECATED
-blockquote.pull-right {
- padding-left: 15px;
- padding-right: 0;
- border-left: 5px solid @blockquote-border-color;
- border-right: 0;
- text-align: left;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/forms-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/forms-rtl.less
deleted file mode 100644
index dce7fbad07..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/forms-rtl.less
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// RTL Forms
-// --------------------------------------------------
-
-
-.radio,
-.checkbox {
-
- label {
- padding-right: 20px;
- padding-left: initial;
- }
-}
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
- margin-right: -20px;
- margin-left: auto;
-}
-
-// Radios and checkboxes on same line
-.radio-inline,
-.checkbox-inline {
- padding-right: 20px;
- padding-left: 0;
-}
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
- margin-right: 10px; // space out consecutive inline controls
- margin-left: 0;
-}
-
-.has-feedback {
-
- // Ensure icons don't overlap text
- .form-control {
- padding-left: calc(var(--input-height-base) * 1.25);
- padding-right: 12px;
- }
-}
-// Feedback icon (requires .glyphicon classes)
-.form-control-feedback {
- left: 0;
- right: auto;
-}
-
-// Inline forms
-//
-// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
-// forms begin stacked on extra small (mobile) devices and then go inline when
-// viewports reach <768px.
-//
-// Requires wrapping inputs and labels with `.form-group` for proper display of
-// default HTML form controls and our custom form controls (e.g., input groups).
-//
-// Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
-
-.form-inline {
-
- // Kick in the inline
- @media (min-width: @screen-sm-min) {
-
- label {
- padding-right: 0;
- padding-left: initial;
- }
-
- .radio input[type="radio"],
- .checkbox input[type="checkbox"] {
- margin-right: 0;
- margin-left: auto;
- }
-
- }
-}
-
-
-// Horizontal forms
-//
-// Horizontal forms are built on grid classes and allow you to create forms with
-// labels on the left and inputs on the right.
-
-.form-horizontal {
-
- // Reset spacing and right align labels, but scope to media queries so that
- // labels on narrow viewports stack the same as a default form example.
- @media (min-width: @screen-sm-min) {
- .control-label {
- text-align: left;
- }
- }
-
- // Validation states
- //
- // Reposition the icon because it's now within a grid column and columns have
- // `position: relative;` on them. Also accounts for the grid gutter padding.
- .has-feedback .form-control-feedback {
- left: var(--grid-gutter-width-half);
- right: auto;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/grid-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/grid-rtl.less
deleted file mode 100644
index e482bcbf6d..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/grid-rtl.less
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// RTL Grid system
-// --------------------------------------------------
-
-// Columns
-//
-// Common styles for small and large grid columns
-
-.make-rtl-grid-columns();
-
-
-// Extra small grid
-//
-// Columns, offsets, pushes, and pulls for extra small devices like
-// smartphones.
-
-.make-rtl-grid(xs);
-
-
-// Small grid
-//
-// Columns, offsets, pushes, and pulls for the small device range, from phones
-// to tablets.
-
-@media (min-width: @screen-sm-min) {
- .make-rtl-grid(sm);
-}
-
-
-// Medium grid
-//
-// Columns, offsets, pushes, and pulls for the desktop device range.
-
-@media (min-width: @screen-md-min) {
- .make-rtl-grid(md);
-}
-
-
-// Large grid
-//
-// Columns, offsets, pushes, and pulls for the large desktop device range.
-
-@media (min-width: @screen-lg-min) {
- .make-rtl-grid(lg);
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/input-groups-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/input-groups-rtl.less
deleted file mode 100644
index f04c21d2bf..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/input-groups-rtl.less
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Input groups
-// --------------------------------------------------
-
-// Base styles
-// -------------------------
-.input-group {
- .form-control {
- // IE9 fubars the placeholder attribute in text inputs and the arrows on
- // select elements in input groups. To fix it, we float the input. Details:
- // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
- float: right;
- }
-}
-
-// Reset rounded corners
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
-.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
- .border-right-radius(var(--border-radius));
- .border-left-radius(0);
-}
-.input-group-addon:first-child {
- border-left: 0px;
- border-right: 1px solid;
-}
-
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child),
-.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
- .border-right-radius(0);
-}
-.input-group-addon:last-child {
- border-left-width: 1px;
- border-left-style: solid;
- border-right: 0px;
-}
-
-// Button input groups
-// -------------------------
-.input-group-btn {
-
- // Negative margin for spacing, position for bringing hovered/focused/actived
- // element above the siblings.
- > .btn {
- + .btn {
- margin-right: -1px;
- margin-left: auto;
- }
- }
-
- // Negative margin to only have a 1px border between the two
- &:first-child {
- > .btn,
- > .btn-group {
- margin-left: -1px;
- margin-right: auto;
- }
- }
- &:last-child {
- > .btn,
- > .btn-group {
- margin-right: -1px;
- margin-left: auto;
- }
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/list-group-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/list-group-rtl.less
deleted file mode 100644
index 67734f7e44..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/list-group-rtl.less
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// List groups
-// --------------------------------------------------
-
-
-// Base class
-//
-// Easily usable on <ul>, <ol>, or <div>.
-
-.list-group {
- padding-right: 0; // reset padding because ul and ol
- padding-left: initial;
-}
-
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/media-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/media-rtl.less
deleted file mode 100644
index 9dd84247ff..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/media-rtl.less
+++ /dev/null
@@ -1,47 +0,0 @@
-// RTL Media objects
-// --------------------------------------------------
-
-
-// Media image alignment
-// -------------------------
-
-.media {
- > .pull-left {
- margin-right: 10px;
- &.flip {
- margin-right: 0;
- margin-left: 10px;
- }
- }
- > .pull-right {
- margin-left: 10px;
- &.flip {
- margin-left: 0;
- margin-right: 10px;
- }
- }
-}
-
-.media-right,
-.media > .pull-right {
- padding-right: 10px;
- padding-left: initial;
-}
-
-.media-left,
-.media > .pull-left {
- padding-left: 10px;
- padding-right: initial;
-}
-
-
-// Media list variation
-// -------------------------
-
-// Undo default ul/ol styles
-.media-list {
- padding-right: 0;
- padding-left: initial;
- list-style: none;
-}
-
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins-flipped.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins-flipped.less
deleted file mode 100644
index 96b617f3b3..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins-flipped.less
+++ /dev/null
@@ -1,31 +0,0 @@
-// Mixins
-// --------------------------------------------------
-
-// Utilities
-@import "../bootstrap/less/mixins/hide-text.less";
-@import "../bootstrap/less/mixins/opacity.less";
-@import "../bootstrap/less/mixins/image.less";
-@import "../bootstrap/less/mixins/reset-filter.less";
-@import "../bootstrap/less/mixins/resize.less";
-@import "../bootstrap/less/mixins/responsive-visibility.less";
-@import "../bootstrap/less/mixins/size.less";
-@import "../bootstrap/less/mixins/tab-focus.less";
-@import "../bootstrap/less/mixins/text-overflow.less";
-@import "../bootstrap/less/mixins/vendor-prefixes.less";
-
-// Components
-@import "../bootstrap/less/mixins/buttons.less";
-@import "../bootstrap/less/mixins/panels.less";
-@import "../bootstrap/less/mixins/nav-divider.less";
-@import "../bootstrap/less/mixins/forms.less";
-@import "../bootstrap/less/mixins/progress-bar.less";
-
-// Skins
-@import "mixins/border-radius-flipped.less"; //FLIPPED
-@import "mixins/gradients-rtl.less"; // RTL
-
-// Layout
-@import "../bootstrap/less/mixins/clearfix.less";
-@import "../bootstrap/less/mixins/center-block.less";
-@import "mixins/grid-framework-rtl.less"; // RTL
-@import "mixins/grid-rtl.less"; // RTL
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins-rtl.less
deleted file mode 100644
index 855d26b127..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins-rtl.less
+++ /dev/null
@@ -1,31 +0,0 @@
-// Mixins
-// --------------------------------------------------
-
-// Utilities
-@import "../../espo/bootstrap/mixins/hide-text.less";
-@import "../../espo/bootstrap/mixins/opacity.less";
-@import "../../espo/bootstrap/mixins/image.less";
-@import "../../espo/bootstrap/mixins/reset-filter.less";
-@import "../../espo/bootstrap/mixins/resize.less";
-@import "../../espo/bootstrap/mixins/responsive-visibility.less";
-@import "../../espo/bootstrap/mixins/size.less";
-@import "../../espo/bootstrap/mixins/tab-focus.less";
-@import "../../espo/bootstrap/mixins/text-overflow.less";
-@import "../../espo/bootstrap/mixins/vendor-prefixes.less";
-
-// Components
-@import "../../espo/bootstrap/mixins/buttons.less";
-@import "../../espo/bootstrap/mixins/panels.less";
-@import "../../espo/bootstrap/mixins/nav-divider.less";
-@import "../../espo/bootstrap/mixins/forms.less";
-@import "../../espo/bootstrap/mixins/progress-bar.less";
-
-// Skins
-@import "../../espo/bootstrap/mixins/border-radius.less";
-@import "mixins/gradients-rtl.less"; // RTL
-
-// Layout
-@import "../../espo/bootstrap/mixins/clearfix.less";
-@import "../../espo/bootstrap/mixins/center-block.less";
-@import "mixins/grid-framework-rtl.less"; // RTL
-@import "mixins/grid-rtl.less"; // RTL
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins/border-radius-flipped.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins/border-radius-flipped.less
deleted file mode 100644
index bddaeca3b8..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins/border-radius-flipped.less
+++ /dev/null
@@ -1,10 +0,0 @@
-// Single side flipped border-radius
-
-.border-right-radius(@radius) {
- border-bottom-left-radius: @radius;
- border-top-left-radius: @radius;
-}
-.border-left-radius(@radius) {
- border-bottom-right-radius: @radius;
- border-top-right-radius: @radius;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins/gradients-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins/gradients-rtl.less
deleted file mode 100644
index 3a69ad9797..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins/gradients-rtl.less
+++ /dev/null
@@ -1,24 +0,0 @@
-// RTL Gradients
-
-#gradient {
-
- // Horizontal gradient, from right to left
- //
- // Creates two color stops, start and end, by specifying a color and position for each color stop.
- // Color stops are not available in IE9 and below.
- .horizontal(@start-color: #333; @end-color: #555; @start-percent: 0%; @end-percent: 100%) {
- background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1-6, Chrome 10+
- background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12
- background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
- background-repeat: repeat-x;
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
- }
-
- .horizontal-three-colors(@start-color: #c3325f; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #00b3ee) {
- background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
- background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
- background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
- background-repeat: no-repeat;
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-framework-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-framework-rtl.less
deleted file mode 100644
index 3d36c62a2d..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-framework-rtl.less
+++ /dev/null
@@ -1,96 +0,0 @@
-// RTL Framework grid generation
-//
-// Used only by Bootstrap to generate the correct number of grid classes given
-// any value of `@grid-columns`.
-
-.make-rtl-grid-columns() {
- // Common styles for all sizes of grid columns, widths 1-12
- .col(@index) { // initial
- @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
- .col((@index + 1), @item);
- }
- .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
- @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
- .col((@index + 1), ~"@{list}, @{item}");
- }
- .col(@index, @list) when (@index > @grid-columns) { // terminal
- @{list} {
- position: relative;
- // Prevent columns from collapsing when empty
- min-height: 1px;
- // Inner gutter via padding
- padding-left: var(--grid-gutter-width-half);
- padding-right: var(--grid-gutter-width-half);
- }
- }
- .col(1); // kickstart it
-}
-
-.float-rtl-grid-columns(@class) {
- .col(@index) { // initial
- @item: ~".col-@{class}-@{index}";
- .col((@index + 1), @item);
- }
- .col(@index, @list) when (@index =< @grid-columns) { // general
- @item: ~".col-@{class}-@{index}";
- .col((@index + 1), ~"@{list}, @{item}");
- }
- .col(@index, @list) when (@index > @grid-columns) { // terminal
- @{list} {
- float: right;
- }
- }
- .col(1); // kickstart it
-}
-
-.calc-rtl-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {
- .col-@{class}-@{index} {
- width: percentage((@index / @grid-columns));
- }
-}
-.calc-rtl-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {
- .col-@{class}-push-@{index} {
- right: percentage((@index / @grid-columns));
- left: 0;
- }
-}
-.calc-rtl-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {
- .col-@{class}-push-0 {
- right: auto;
- left: 0;
- }
-}
-.calc-rtl-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {
- .col-@{class}-pull-@{index} {
- left: percentage((@index / @grid-columns));
- right: auto;
- }
-}
-.calc-rtl-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {
- .col-@{class}-pull-0 {
- left: auto;
- right: auto;
- }
-}
-.calc-rtl-grid-column(@index, @class, @type) when (@type = offset) {
- .col-@{class}-offset-@{index} {
- margin-right: percentage((@index / @grid-columns));
- margin-left: 0;
- }
-}
-
-// Basic looping in LESS
-.loop-rtl-grid-columns(@index, @class, @type) when (@index >= 0) {
- .calc-rtl-grid-column(@index, @class, @type);
- // next iteration
- .loop-rtl-grid-columns((@index - 1), @class, @type);
-}
-
-// Create grid for specific class
-.make-rtl-grid(@class) {
- .float-rtl-grid-columns(@class);
- .loop-rtl-grid-columns(@grid-columns, @class, width);
- .loop-rtl-grid-columns(@grid-columns, @class, pull);
- .loop-rtl-grid-columns(@grid-columns, @class, push);
- .loop-rtl-grid-columns(@grid-columns, @class, offset);
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-rtl.less
deleted file mode 100644
index 58ef91ef80..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/mixins/grid-rtl.less
+++ /dev/null
@@ -1,98 +0,0 @@
-// RTL Grid system
-//
-// Generate semantic rtl grid columns with these mixins.
-
-// Generate the extra small columns
-.make-xs-column(@columns) {
- float: right;
-}
-.make-xs-column-offset(@columns) {
- margin-right: percentage((@columns / @grid-columns));
- margin-left: 0;
-}
-.make-xs-column-push(@columns) {
- right: percentage((@columns / @grid-columns));
- left: auto;
-}
-.make-xs-column-pull(@columns) {
- left: percentage((@columns / @grid-columns));
- right: auto;
-}
-
-// Generate the small columns
-.make-sm-column(@columns) {
-
- @media (min-width: @screen-sm-min) {
- float: right;
- }
-}
-.make-sm-column-offset(@columns) {
- @media (min-width: @screen-sm-min) {
- margin-right: percentage((@columns / @grid-columns));
- margin-left: 0;
- }
-}
-.make-sm-column-push(@columns) {
- @media (min-width: @screen-sm-min) {
- right: percentage((@columns / @grid-columns));
- left: auto;
- }
-}
-.make-sm-column-pull(@columns) {
- @media (min-width: @screen-sm-min) {
- left: percentage((@columns / @grid-columns));
- right: auto;
- }
-}
-
-// Generate the medium columns
-.make-md-column(@columns) {
-
- @media (min-width: @screen-md-min) {
- float: right;
- }
-}
-.make-md-column-offset(@columns) {
- @media (min-width: @screen-md-min) {
- margin-right: percentage((@columns / @grid-columns));
- margin-left: 0;
- }
-}
-.make-md-column-push(@columns) {
- @media (min-width: @screen-md-min) {
- right: percentage((@columns / @grid-columns));
- left: auto;
- }
-}
-.make-md-column-pull(@columns) {
- @media (min-width: @screen-md-min) {
- left: percentage((@columns / @grid-columns));
- right: auto;
- }
-}
-
-// Generate the large columns
-.make-lg-column(@columns) {
-
- @media (min-width: @screen-lg-min) {
- float: right;
- }
-}
-.make-lg-column-offset(@columns) {
- @media (min-width: @screen-lg-min) {
- margin-right: percentage((@columns / @grid-columns));
- margin-left: 0;
- }
-}
-.make-lg-column-push(@columns) {
- @media (min-width: @screen-lg-min) {
- right: percentage((@columns / @grid-columns));
- left: auto;
- }
-}
-.make-lg-column-pull(@columns) {
- @media (min-width: @screen-lg-min) {
- left: percentage((@columns / @grid-columns));
- right: auto;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/modals-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/modals-rtl.less
deleted file mode 100644
index 0a373c8385..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/modals-rtl.less
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// RTL Modals
-// --------------------------------------------------
-
-// Footer (for actions)
-.modal-footer {
- text-align: left; // right align buttons
-
- &.flip {
- text-align: right;
- }
- // Properly space out buttons
- .btn + .btn {
- margin-left: auto;
- margin-right: 5px;
- }
- // but override that for button groups
- .btn-group .btn + .btn {
- margin-right: -1px;
- margin-left: auto;
- }
- // and override it for block buttons as well
- .btn-block + .btn-block {
- margin-right: 0;
- margin-left: auto;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/navbar-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/navbar-rtl.less
deleted file mode 100644
index fe4c040514..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/navbar-rtl.less
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// RTL Navbars
-// --------------------------------------------------
-
-
-// Navbar heading
-//
-// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy
-// styling of responsive aspects.
-
-.navbar-header {
-
- @media (min-width: @grid-float-breakpoint) {
- float: right;
- }
-}
-
-// Brand/project name
-
-.navbar-brand {
- float: right;
-}
-
-
-// Navbar toggle
-//
-// Custom button for toggling the `.navbar-collapse`, powered by the collapse
-// JavaScript plugin.
-
-.navbar-toggle {
- float: left;
-}
-
-
-// Navbar nav links
-//
-// Builds on top of the `.nav` components with its own modifier class to make
-// the nav the full height of the horizontal nav (above 768px).
-
-.navbar-nav {
-
- @media (max-width: @grid-float-breakpoint-max) {
- // Dropdowns get custom display when collapsed
- .open .dropdown-menu {
- > li > a,
- .dropdown-header {
- padding: 5px 25px 5px 15px;
- }
- }
- }
-
- // Uncollapse the nav
- @media (min-width: @grid-float-breakpoint) {
- float: right;
-
- > li {
- float: right !important;
- }
-
- }
-}
-
-@media (min-width: @grid-float-breakpoint) {
- .navbar-left {
- float: right !important;
- &.flip {
- float: right !important;
- }
- }
-
- .navbar-right {
- float: left !important;
-
- &.flip {
- float: left !important;
- }
-
- .dropdown-menu {
- left: 0;
- right: auto;
- }
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/navs-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/navs-rtl.less
deleted file mode 100644
index ad43b11de8..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/navs-rtl.less
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// Navs
-// --------------------------------------------------
-
-
-// Base class
-// --------------------------------------------------
-
-.nav {
- padding-right: 0; // Override default ul/ol
- padding-left: initial;
-}
-
-
-// Tabs
-// -------------------------
-
-// Give the tabs something to sit on
-.nav-tabs {
- > li {
- float: right;
-
- // Actual tabs (as links)
- > a {
- margin-left: auto;
- margin-right: -2px;
- }
- }
-}
-
-
-// Pills
-// -------------------------
-.nav-pills {
- > li {
- float: right;
-
- + li {
- margin-right: 2px;
- margin-left: auto;
- }
- }
-}
-
-
-// Stacked pills
-.nav-stacked {
- > li {
- float: none;
- + li {
- margin-right: 0; // no need for this gap between nav items
- margin-left: auto;
- }
- }
-}
-
-
-// Nav variations
-// --------------------------------------------------
-
-// Justified nav links
-// -------------------------
-
-.nav-justified {
-
- //To fix the overridden style by line 21
- > li{
- float: none;
- }
-
- > .dropdown .dropdown-menu {
- right: auto;
- }
-}
-
-// Move borders to anchors instead of bottom of list
-//
-// Mixin for adding on top the shared `.nav-justified` styles for our tabs
-.nav-tabs-justified {
-
- > li > a {
- // Override margin from .nav-tabs
- margin-left: 0;
- margin-right: auto;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/normalize-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/normalize-rtl.less
deleted file mode 100644
index c1250b9e7e..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/normalize-rtl.less
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// 1. Set direction to RTL
-//
-
-html {
- direction: rtl;
-}
-
-//
-// Remove default margin.
-//
-
-body {
- direction: rtl;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/panels-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/panels-rtl.less
deleted file mode 100644
index 13e1128b14..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/panels-rtl.less
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// RTL Panels
-// --------------------------------------------------
-
-// Tables in panels
-//
-// Place a non-bordered `.table` within a panel (not within a `.panel-body`) and
-// watch it go full width.
-
-.panel {
- // Add border top radius for first one
- > .table:first-child,
- > .table-responsive:first-child > .table:first-child {
-
- > thead:first-child,
- > tbody:first-child {
- > tr:first-child {
- td:first-child,
- th:first-child {
- //border-top-right-radius: (@panel-border-radius);
- //border-top-left-radius: 0;
- }
- td:last-child,
- th:last-child {
- //border-top-left-radius: (@panel-border-radius);
- //border-top-right-radius: 0;
- }
- }
- }
- }
- // Add border bottom radius for last one
- > .table:last-child,
- > .table-responsive:last-child > .table:last-child {
-
- > tbody:last-child,
- > tfoot:last-child {
- > tr:last-child {
- td:first-child,
- th:first-child {
- //border-bottom-left-radius: (@panel-border-radius);
- //border-top-right-radius: 0;
- }
- td:last-child,
- th:last-child {
- //border-bottom-right-radius: (@panel-border-radius);
- //border-top-left-radius: 0;
- }
- }
- }
- }
- > .table-bordered,
- > .table-responsive > .table-bordered {
- > thead,
- > tbody,
- > tfoot {
- > tr {
- > th:first-child,
- > td:first-child {
- border-right: 0;
- border-left: none;
- }
- > th:last-child,
- > td:last-child {
- border-right: none;
- border-left: 0;
- }
- }
- }
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/popovers-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/popovers-rtl.less
deleted file mode 100644
index 8de29cb137..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/popovers-rtl.less
+++ /dev/null
@@ -1,27 +0,0 @@
-.popover {
- left: auto;
- text-align: right;
-}
-
-.popover {
- &.top > .arrow {
- right: 50%;
- left: auto;
- margin-right: var(--popover-arrow-outer-width-negative);
- margin-left: auto;
- &:after {
- margin-right: var(--popover-arrow-width-negative);
- margin-left: auto;
- }
- }
- &.bottom > .arrow {
- right: 50%;
- left: auto;
- margin-right: var(--popover-arrow-outer-width-negative);
- margin-left: auto;
- &:after {
- margin-right: var(--popover-arrow-width-negative);
- margin-left: auto;
- }
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/progress-bars-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/progress-bars-rtl.less
deleted file mode 100644
index 9b5b9f76e0..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/progress-bars-rtl.less
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// RTL Progress bars
-// --------------------------------------------------
-
-// Bar of progress
-.progress-bar {
- float: right;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/responsive-embed-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/responsive-embed-rtl.less
deleted file mode 100644
index 87bc416db0..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/responsive-embed-rtl.less
+++ /dev/null
@@ -1,15 +0,0 @@
-// RTL Embeds responsive
-//
-// Credit: Nicolas Gallagher and SUIT CSS.
-
-.embed-responsive {
-
- .embed-responsive-item,
- iframe,
- embed,
- object {
- right: 0;
- left: auto;
- }
-
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/tables-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/tables-rtl.less
deleted file mode 100644
index 956e6ade46..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/tables-rtl.less
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Tables
-// --------------------------------------------------
-
-//TODO
-caption {
- text-align: right;
-}
-
-th {
- text-align: right;
-}
-
-// Responsive tables
-//
-// Wrap your tables in `.table-responsive` and we'll make them mobile friendly
-// by enabling horizontal scrolling. Only applies <768px. Everything above that
-// will display normally.
-
-.table-responsive {
- @media screen and (max-width: @screen-xs-max) {
-
- // Special overrides for the bordered tables
- > .table-bordered {
- border: 0;
-
- // Nuke the appropriate borders so that the parent can handle them
- > thead,
- > tbody,
- > tfoot {
- > tr {
- > th:first-child,
- > td:first-child {
- border-right: 0;
- border-left: initial;
- }
- > th:last-child,
- > td:last-child {
- border-left: 0;
- border-right: initial;
- }
- }
- }
-
- }
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/type-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/type-rtl.less
deleted file mode 100644
index 0b4af781f6..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/type-rtl.less
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// RTL Typography
-// --------------------------------------------------
-
-// Flipped Alignment
-.flip.text-left { text-align: right; }
-.flip.text-right { text-align: left; }
-
-// List options
-
-// Unstyled keeps list items block level, just removes default browser padding and list-style
-.list-unstyled {
- padding-right: 0;
- padding-left: initial;
-}
-
-// Inline turns list items into inline-block
-.list-inline {
- .list-unstyled();
- margin-right: -5px;
- margin-left: 0;
-}
-
-dd {
- margin-right: 0; // Undo browser default
- margin-left: initial;
-}
-
-// Blockquotes
-blockquote {
- border-right: 5px solid @blockquote-border-color;
- border-left: 0;
-}
-
-// Opposite alignment of blockquote
-//
-// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.
-.blockquote-reverse,
-blockquote.pull-left {
- padding-left: 15px;
- padding-right: 0;
- border-left: 5px solid @blockquote-border-color;
- border-right: 0;
- text-align: left;
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/utilities-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/utilities-rtl.less
deleted file mode 100644
index eaf8db421c..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/utilities-rtl.less
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// Temporary RTL style to fix bugs rapidly.
-// They will move to some place more appropriate later.
-// --------------------------------------------------
-
-.pull-right {
- &.flip {
- float: left !important;
- }
-}
-.pull-left {
- &.flip {
- float: right !important;
- }
-}
diff --git a/frontend/less/espo-rtl/bootstrap-rtl/variables-rtl.less b/frontend/less/espo-rtl/bootstrap-rtl/variables-rtl.less
deleted file mode 100644
index 13afd053b7..0000000000
--- a/frontend/less/espo-rtl/bootstrap-rtl/variables-rtl.less
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// RTL Variables
-// --------------------------------------------------
-
-
-//== Media Objects on pull-left/pull-right + flip
-//REMOVED @media-pull-margin: 10px;
-
diff --git a/frontend/less/espo-rtl/iframe/main.less b/frontend/less/espo-rtl/iframe/main.less
deleted file mode 100644
index 265a4f6022..0000000000
--- a/frontend/less/espo-rtl/iframe/main.less
+++ /dev/null
@@ -1,7 +0,0 @@
-@import "../../espo/bootstrap/variables.less";
-@import "../../espo/value-variables.less";
-@import "../../espo/variables.less";
-@import "../variables.less";
-@import "../../espo/root-variables.less";
-@import "../../espo/fonts.less";
-@import "../../espo/iframe/iframe.less";
diff --git a/frontend/less/espo-rtl/main.less b/frontend/less/espo-rtl/main.less
deleted file mode 100644
index e19b461883..0000000000
--- a/frontend/less/espo-rtl/main.less
+++ /dev/null
@@ -1,19 +0,0 @@
-@import "../espo/init.less";
-@import "bootstrap-rtl/bootstrap-rtl.less";
-@import "../espo/value-variables.less";
-@import "../espo/variables.less";
-@import "variables.less";
-@import "../espo/root-variables.less";
-@import "../espo/mixins.less";
-@import "../espo/misc.less";
-@import "../espo/layout-top.less";
-@import "../espo/layout-side.less";
-@import "../espo/custom.less";
-@import "layout-top.less";
-@import "layout-side.less";
-@import "custom.less";
-@import "bootstrap-rtl/utilities-rtl.less";
-
-body {
- --theme-name: EspoRtl;
-}
diff --git a/frontend/less/espo-rtl/variables.less b/frontend/less/espo-rtl/variables.less
deleted file mode 100644
index 15e61e24af..0000000000
--- a/frontend/less/espo-rtl/variables.less
+++ /dev/null
@@ -1,3 +0,0 @@
-@border-radius-value: var(--6px);
-@panel-border-radius-value: var(--6px);
-@dropdown-border-radius-value: var(--4px);
diff --git a/frontend/less/espo/bootstrap/utilities.less b/frontend/less/espo/bootstrap/utilities.less
index 7a8ca27a8f..3a6909f2fa 100644
--- a/frontend/less/espo/bootstrap/utilities.less
+++ b/frontend/less/espo/bootstrap/utilities.less
@@ -18,6 +18,12 @@
.pull-left {
float: left !important;
}
+.pull-start {
+ float: inline-start !important;
+}
+.pull-end {
+ float: inline-end !important;
+}
// Toggling content
diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less
index 93bbeff120..a36862fa51 100644
--- a/frontend/less/espo/custom.less
+++ b/frontend/less/espo/custom.less
@@ -1769,7 +1769,7 @@ table.less-padding td.cell[data-name="buttons"] > .btn-group {
}
.show-more > .btn-block {
- text-align: left;
+ text-align: start;
padding: var(--7px) var(--10px) var(--7px) var(--panel-padding);
&,
@@ -2461,7 +2461,7 @@ div.field,
td.cell {
> img.avatar-link {
- margin-right: var(--6px);
+ margin-inline-end: var(--6px);
}
}
@@ -3742,7 +3742,7 @@ table.table-admin-panel {
@media screen and (min-width: @screen-sm-min) {
.search-container .view-mode-switcher-buttons-group {
- float: right;
+ float: inline-end;
}
}
@@ -3901,7 +3901,7 @@ a.field-info > span.fa-info-circle {
.btn:not(.btn-icon) > .far:first-child:has(+ span),
.btn:not(.btn-icon) > .fas:first-child:has(+ span) {
- padding-right: var(--5px);
+ padding-inline-end: var(--5px);
&.fas,
&.far {
@@ -4426,12 +4426,12 @@ body > .autocomplete-suggestions.text-search-suggestions {
position: relative;
input {
- padding-right: var(--32px);
+ padding-inline-end: var(--32px);
}
a[data-action="toggleShowPassword"] {
position: absolute;
- right: var(--8px);
+ inset-inline-end: var(--8px);
top: var(--8px);
user-select: none;
width: var(--22px);
diff --git a/frontend/less/espo/main.less b/frontend/less/espo/main.less
index 1e9bd73cfc..d2bb1a1e95 100644
--- a/frontend/less/espo/main.less
+++ b/frontend/less/espo/main.less
@@ -8,6 +8,7 @@
@import "layout-side.less";
@import "custom.less";
@import "utilities.less";
+@import "rtl/main.less";
body {
--theme-name: Espo;
diff --git a/frontend/less/espo/misc/kanban.less b/frontend/less/espo/misc/kanban.less
index b4cba05e83..28a4f95913 100644
--- a/frontend/less/espo/misc/kanban.less
+++ b/frontend/less/espo/misc/kanban.less
@@ -21,7 +21,7 @@ div.list-kanban > div > table {
}
> div {
- padding-left: var(--table-cell-padding);
+ padding-inline-start: var(--table-cell-padding);
position: relative;
line-height: var(--28px);
height: 100%;
diff --git a/frontend/less/espo/rtl/bootstrap.less b/frontend/less/espo/rtl/bootstrap.less
new file mode 100644
index 0000000000..f094ae6eca
--- /dev/null
+++ b/frontend/less/espo/rtl/bootstrap.less
@@ -0,0 +1,444 @@
+// Compact Bootstrap 3 RTL adjustments used by EspoCRM.
+// Native `dir=rtl` handles inline flow; physical Bootstrap declarations are
+// corrected here without changing the shared LTR styles.
+
+span,
+a,
+label,
+strong,
+small {
+ unicode-bidi: isolate;
+}
+
+[class^="col-xs-"],
+[class*=" col-xs-"] {
+ float: right;
+}
+
+@media (min-width: @screen-sm-min) {
+ [class^="col-sm-"],
+ [class*=" col-sm-"] {
+ float: right;
+ }
+
+ .col-sm-offset-2 {
+ margin-left: 0;
+ margin-right: percentage((2 / @grid-columns));
+ }
+
+ .form-horizontal .control-label {
+ text-align: left;
+ }
+
+ .navbar-header,
+ .navbar-brand,
+ .navbar-nav,
+ .navbar-nav > li {
+ float: right;
+ }
+
+ .navbar-right {
+ float: left !important;
+ margin-left: calc(var(--grid-gutter-width-half) * -1);
+ margin-right: 0;
+
+ .dropdown-menu {
+ left: 0;
+ right: auto;
+ }
+ }
+
+ .navbar-left {
+ float: right !important;
+ }
+}
+
+@media (min-width: @screen-md-min) {
+ [class^="col-md-"],
+ [class*=" col-md-"] {
+ float: right;
+ }
+}
+
+@media (min-width: @screen-lg-min) {
+ [class^="col-lg-"],
+ [class*=" col-lg-"] {
+ float: right;
+ }
+}
+
+.nav-tabs > li,
+.btn-group > .btn,
+.pagination > li > a,
+.pagination > li > span {
+ float: right;
+}
+
+.btn-toolbar .btn,
+.btn-toolbar .btn-group,
+.btn-toolbar .input-group,
+.btn-group > .btn-group,
+.input-group .form-control,
+.progress-bar {
+ float: right;
+}
+
+.btn-toolbar {
+ margin-left: 0;
+ margin-right: var(--minus-5px);
+
+ > .btn,
+ > .btn-group,
+ > .input-group {
+ margin-left: 0;
+ margin-right: var(--5px);
+ }
+}
+
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle),
+.input-group .form-control:first-child,
+.input-group-addon:first-child,
+.input-group-btn:first-child > .btn,
+.pagination > li:first-child > a,
+.pagination > li:first-child > span {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+ border-bottom-right-radius: var(--border-radius);
+ border-top-right-radius: var(--border-radius);
+}
+
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child),
+.input-group .form-control:last-child,
+.input-group-addon:last-child,
+.input-group-btn:last-child > .btn,
+.pagination > li:last-child > a,
+.pagination > li:last-child > span {
+ border-bottom-left-radius: var(--border-radius);
+ border-top-left-radius: var(--border-radius);
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+
+.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+ border-bottom-right-radius: var(--border-radius);
+ border-top-right-radius: var(--border-radius);
+}
+
+.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-bottom-left-radius: var(--border-radius);
+ border-top-left-radius: var(--border-radius);
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+
+.input-group-addon:first-child {
+ border-left: 0;
+ border-right: var(--input-border-width) solid var(--input-border);
+}
+
+.input-group-addon:last-child {
+ border-left: var(--input-border-width) solid var(--input-border);
+ border-right: 0;
+}
+
+.input-group-btn {
+ > .btn + .btn {
+ margin-left: 0;
+ margin-right: var(--minus-1px);
+ }
+
+ &:first-child > .btn,
+ &:first-child > .btn-group {
+ margin-left: var(--minus-1px);
+ margin-right: 0;
+ }
+
+ &:last-child > .btn,
+ &:last-child > .btn-group {
+ margin-left: 0;
+ margin-right: var(--minus-1px);
+ }
+}
+
+.caret {
+ margin-left: 0;
+ margin-right: var(--2px);
+}
+
+.dropdown-menu {
+ text-align: right;
+
+ &.pull-right {
+ left: 0;
+ right: auto;
+ }
+}
+
+.nav,
+.list-group {
+ padding-left: initial;
+ padding-right: 0;
+}
+
+.nav-tabs > li > a {
+ margin-left: auto;
+ margin-right: var(--minus-2px);
+}
+
+.radio,
+.checkbox {
+ label {
+ padding-left: 0;
+ padding-right: var(--20px);
+ }
+}
+
+.radio input[type="radio"],
+.checkbox input[type="checkbox"] {
+ margin-left: auto;
+ margin-right: calc(var(--20px) * -1);
+}
+
+.has-feedback .form-control {
+ padding-left: calc(var(--input-height-base) * 1.25);
+ padding-right: var(--12px);
+}
+
+.form-control-feedback {
+ left: 0;
+ right: auto;
+}
+
+.form-horizontal .has-feedback .form-control-feedback {
+ left: var(--grid-gutter-width-half);
+ right: auto;
+}
+
+caption,
+th {
+ text-align: right;
+}
+
+blockquote {
+ border-left: 0;
+ border-right: var(--3px) solid var(--blockquote-border-color);
+}
+
+.navbar-toggle {
+ float: left;
+ margin-left: var(--15px);
+ margin-right: 0;
+}
+
+.media-left {
+ padding-left: var(--10px);
+ padding-right: 0;
+}
+
+.media-right {
+ padding-left: 0;
+ padding-right: var(--10px);
+}
+
+.list-group-item > .badge,
+.close {
+ float: left;
+}
+
+.list-group-item > .badge + .badge {
+ margin-left: var(--5px);
+ margin-right: 0;
+}
+
+.pager .previous > a,
+.pager .previous > span {
+ float: right;
+}
+
+.pager .next > a,
+.pager .next > span {
+ float: left;
+}
+
+// Typography
+
+.list-unstyled,
+.list-inline {
+ padding-right: 0;
+}
+
+.list-inline {
+ margin-right: var(--minus-5px);
+ margin-left: 0;
+}
+
+dd {
+ margin-right: 0;
+}
+
+.blockquote-reverse {
+ padding-left: var(--15px);
+ padding-right: 0;
+ border-left: var(--5px) solid var(--blockquote-border-color);
+ border-right: 0;
+ text-align: left;
+}
+
+// Tables
+
+.table-responsive {
+ @media screen and (max-width: @screen-xs-max) {
+ > .table-bordered > :is(thead, tbody, tfoot) > tr {
+ > :is(th, td):first-child:not(:last-child) {
+ border-left: var(--1px) solid @table-border-color;
+ border-right: 0;
+ }
+
+ > :is(th, td):last-child:not(:first-child) {
+ border-left: 0;
+ border-right: var(--1px) solid @table-border-color;
+ }
+ }
+ }
+}
+
+// Forms
+
+.radio-inline,
+.checkbox-inline {
+ padding-left: 0;
+ padding-right: var(--20px);
+}
+
+.radio-inline input[type="radio"],
+.checkbox-inline input[type="checkbox"] {
+ margin-left: auto;
+ margin-right: calc(var(--20px) * -1);
+}
+
+.radio-inline + .radio-inline,
+.checkbox-inline + .checkbox-inline {
+ margin-left: 0;
+ margin-right: var(--10px);
+}
+
+// Button groups
+
+.btn-group {
+ .btn + .btn,
+ .btn + .btn-group,
+ .btn-group + .btn,
+ .btn-group + .btn-group {
+ margin-left: 0;
+ margin-right: var(--minus-1px);
+ }
+}
+
+.btn-group.btn-group-justified > .btn,
+.btn-group.btn-group-justified > .btn-group {
+ float: none;
+}
+
+.btn .caret {
+ margin-right: 0;
+}
+
+// Input groups
+
+.input-group-btn:first-child > .btn-group > .btn,
+.input-group-btn:first-child > .dropdown-toggle,
+.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
+.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+ border-bottom-right-radius: var(--border-radius);
+ border-top-right-radius: var(--border-radius);
+}
+
+.input-group-btn:last-child > .btn-group > .btn,
+.input-group-btn:last-child > .dropdown-toggle,
+.input-group-btn:first-child > .btn:not(:first-child),
+.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
+ border-bottom-left-radius: var(--border-radius);
+ border-top-left-radius: var(--border-radius);
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+
+// Navs
+
+.nav-justified > li {
+ float: none;
+}
+
+.nav-tabs-justified > li > a {
+ margin-left: 0;
+ margin-right: auto;
+}
+
+// Navbar
+
+.navbar-brand {
+ float: right;
+}
+
+@media (max-width: @grid-float-breakpoint-max) {
+ .navbar-nav .open .dropdown-menu {
+ > li > a,
+ .dropdown-header {
+ padding: var(--5px) var(--25px) var(--5px) var(--15px);
+ }
+ }
+}
+
+// Badges
+
+.nav-pills > li > a > .badge {
+ margin-left: 0;
+ margin-right: var(--3px);
+}
+
+// Media objects
+
+.media-list {
+ padding-right: 0;
+}
+
+// Panels
+
+.panel {
+ > .table-bordered,
+ > .table-responsive > .table-bordered {
+ > :is(thead, tbody, tfoot) > tr {
+ > :is(th, td):first-child:not(:last-child) {
+ border-left: var(--1px) solid @table-border-color;
+ border-right: 0;
+ }
+
+ > :is(th, td):last-child:not(:first-child) {
+ border-left: 0;
+ border-right: var(--1px) solid @table-border-color;
+ }
+ }
+ }
+}
+
+// Modals
+
+.modal-footer {
+ text-align: left;
+
+ .btn + .btn {
+ margin-left: 0;
+ margin-right: var(--5px);
+ }
+
+ .btn-group .btn + .btn {
+ margin-left: 0;
+ margin-right: var(--minus-1px);
+ }
+}
diff --git a/frontend/less/espo-rtl/custom.less b/frontend/less/espo/rtl/custom.less
similarity index 69%
rename from frontend/less/espo-rtl/custom.less
rename to frontend/less/espo/rtl/custom.less
index a7ef857820..fd5accaf5f 100644
--- a/frontend/less/espo-rtl/custom.less
+++ b/frontend/less/espo/rtl/custom.less
@@ -1,5 +1,5 @@
.dropdown-menu {
- left: auto;
+ left: auto;
right: 0;
}
@@ -13,16 +13,29 @@
right: 0;
}
+body > .alert.alert-closable {
+ .message {
+ float: right;
+ }
+
+ .close-container {
+ float: left;
+ }
+}
+
.list .checkbox-dropdown {
- margin-left: -0;
- margin-right: 0;
- right: 16px;
+ margin-right: var(--2px);
+ margin-left: 0;
}
.list-buttons-container > div {
- float: right;
- margin-left: var(--panel-padding);
- margin-right: 0;
+ &.settings-container.pull-right {
+ float: left !important;
+ }
+
+ &.pagination {
+ float: left;
+ }
}
.list-buttons-container > div.total-count {
@@ -30,6 +43,10 @@
padding: 6px 0;
}
+.btn-group > a.pagination-btn {
+ float: left;
+}
+
li .preset .pull-right {
float: left !important;
}
@@ -53,12 +70,21 @@ ul.dropdown-menu > li.checkbox {
}
.modal-body > div > .list > table td:first-child,
-.modal-body > div > .list > table th:first-child {
- padding-right: var(--panel-padding);
- padding-left: var(--table-cell-padding-half);
+.modal-body > div > .list > table th:first-child,
+#main > .list-container > .list > table td:first-child,
+#main > .list-container > .list > table th:first-child,
+.panel-body .no-side-margin > table td:first-child,
+.panel-body .no-side-margin > table th:first-child {
+ padding-right: var(--panel-padding);
+ padding-left: var(--table-cell-padding-half);
}
+
.modal-body > div > .list > table td:last-child,
-.modal-body > div > .list > table th:last-child {
+.modal-body > div > .list > table th:last-child,
+#main > .list-container > .list > table td:last-child,
+#main > .list-container > .list > table th:last-child,
+.panel-body .no-side-margin > table td:last-child,
+.panel-body .no-side-margin > table th:last-child {
padding-left: var(--panel-padding);
padding-right: var(--table-cell-padding-half);
}
@@ -67,30 +93,6 @@ ul.dropdown-menu > li.checkbox {
margin-left: calc(var(--container-padding) * -1);
margin-right: calc(var(--container-padding) * -1);
}
-#main > .list-container > .list > table td:first-child,
-#main > .list-container > .list > table th:first-child {
- padding-right: var(--panel-padding);
- padding-left: var(--table-cell-padding-half);
-}
-#main > .list-container > .list > table td:last-child,
-#main > .list-container > .list > table th:last-child {
- padding-left: var(--panel-padding);
- padding-right: var(--table-cell-padding-half);
-}
-
-.panel-body .no-side-margin {
- > table td:first-child,
- > table th:first-child {
- padding-right: var(--panel-padding);
- padding-left: var(--table-cell-padding-half);
- }
-
- > table td:last-child,
- > table th:last-child {
- padding-left: var(--panel-padding);
- padding-right: var(--table-cell-padding-half);
- }
-}
.panel > .panel-heading > .btn-group {
right: 0;
@@ -101,11 +103,8 @@ ul.dropdown-menu > li.checkbox {
}
.detail-button-container > .pull-right,
-.edit-button-container > .pull-right
-{
- float: left !important;
-}
-
+.edit-button-container > .pull-right,
+.layout-container > [data-role="layoutRow"] > .btn-group.pull-right,
.header-buttons.pull-right {
float: left !important;
}
@@ -118,16 +117,20 @@ ul.dropdown-menu > li.checkbox {
direction: ltr;
}
-.calendar-container .button-container > div > div.pull-right {
+.calendar-container .button-container > div > div.pull-right,
+.dropdown-menu > li > a > span.pull-right {
float: left !important;
}
-.dropdown-menu > li > a > span.pull-right {
- float: left !important;
+.button-container [data-action="previous"],
+.button-container [data-action="next"] {
+ transform: scaleX(-1);
}
-.panel > .panel-heading > .pull-right.btn-group {
+.panel > .panel-heading > .pull-right.btn-group,
+.panel > .panel-heading > .pull-right.dropdown {
float: left !important;
+
.dropdown-menu {
left: 0;
right: auto;
@@ -140,21 +143,17 @@ ul.dropdown-menu > li.checkbox {
}
.panel > .panel-heading > .pull-right.dropdown {
- float: left !important;
right: 0;
margin-left: -11px;
- .dropdown-menu {
- left: 0;
- right: auto;
- }
}
-.panel .panel-heading > a.pull-right {
+.panel .panel-heading > a.pull-right,
+.cell > a.pull-right {
float: left !important;
}
-.cell > a.pull-right {
- float: left !important;
+.cell:has(> .inline-edit-link):has(> .field) .control-label {
+ float: right;
}
.inline-save-link {
@@ -165,6 +164,20 @@ ul.dropdown-menu > li.checkbox {
margin-left: 0;
}
+.cell {
+ .inline-save-link {
+ float: left;
+ margin-left: 0;
+ margin-right: var(--8px);
+ }
+
+ .inline-cancel-link {
+ float: left;
+ margin-left: 0;
+ margin-right: var(--26px);
+ }
+}
+
td.cell[data-name="buttons"] > .btn-group {
margin-right: -17px;
}
@@ -173,20 +186,21 @@ td.cell[data-name="buttons"] > .btn-group {
margin-right: -14px;
}
-.list-expanded > .list-group > .list-group-item > .pull-right {
+.list-expanded > .list-group > .list-group-item > .pull-right,
+.list-expanded > .list-group > .list-group-item > .pull-right > .list-row-buttons {
float: left !important;
}
.list-expanded > .list-group > .list-group-item > .pull-right > .list-row-buttons {
- float: left !important;
margin-right: 0;
margin-left: -16px;
}
-.link-container > .list-group-item > .pull-right {
+[data-action="showMore"] .more-count {
float: left !important;
}
+.link-container > .list-group-item > .pull-right,
.link-container > .list-group-item > .pull-left > .pull-right {
float: left !important;
}
@@ -200,14 +214,19 @@ td.cell[data-name="buttons"] > .btn-group {
}
#global-search-panel,
-#last-viewed-panel {
- left: 35px;
+#last-viewed-panel,
+#notifications-panel {
+ left: 0;
right: auto;
}
+#last-viewed-panel > .panel,
+#notifications-panel > .panel {
+ border-top-left-radius: 0;
+ border-top-right-radius: var(--panel-border-radius);
+}
+
#notifications-panel {
- left: 0;
- right: auto;
.panel .panel-heading .pull-right {
float: left !important;
}
@@ -225,22 +244,10 @@ td.cell[data-name="buttons"] > .btn-group {
direction: rtl;
}
-.dynamic-logic-expression-container {
- .pull-right {
- float: left !important;
- }
-}
-
-#fields-panel .cell .field {
- .pull-right {
- float: left !important;
- }
-}
-
-.gray-box {
- .pull-right {
- float: left !important;
- }
+.dynamic-logic-expression-container .pull-right,
+#fields-panel .cell .field .pull-right,
+.gray-box .pull-right {
+ float: left !important;
}
.panel.dashlet > .panel-heading > .btn-group {
@@ -254,6 +261,33 @@ ul {
padding-left: 0;
padding-right: var(--8px);
}
+
+ &.dropdown-menu-with-icons,
+ &:has(> li:not(.hidden) > a span.item-icon) {
+ > li:not(:has(.item-icon-grid)) {
+ a {
+ padding-left: var(--20px);
+ padding-right: var(--12px);
+ }
+
+ .item-text {
+ padding-left: 0;
+ padding-right: var(--10px);
+ }
+ }
+ }
+
+ &:has(> li:not(.hidden) > a span.item-icon) {
+ > li > a:not(:has(span.item-icon)) {
+ padding-right: var(--28px);
+ padding-left: var(--20px);
+ }
+ }
+
+ &.dropdown-menu > li > a > .check-icon + div {
+ padding-right: 0;
+ padding-left: var(--26px);
+ }
}
.panel {
@@ -263,14 +297,17 @@ ul {
> a {
padding-right: 20px;
}
+
float: left;
}
}
}
-.dropdown-menu-with-icons li a {
- padding-right: 10px;
- padding-left: 20px;
+#navbar .navbar .menu-container {
+ > ul.dropdown-menu > li > a:has(> .item-user-profile) .avatar {
+ margin-left: var(--8px);
+ margin-right: 0;
+ }
}
.post-container {
@@ -280,18 +317,16 @@ ul {
}
}
-.link-multiple-item {
- .link-multiple-item-icon {
- margin-left: 4px;
- margin-right: 0;
- }
-}
-
+.link-multiple-item .link-multiple-item-icon,
.link-field-icon {
margin-left: 4px;
margin-right: 0;
}
+.stream-details-container .fa-arrow-right {
+ transform: scaleX(-1);
+}
+
.array-add-list-group > li {
input[type="checkbox"] {
margin-left: 0;
@@ -306,6 +341,10 @@ ul {
}
div.list-kanban > div > table {
+ .item .panel .item-menu-container {
+ float: left !important;
+ }
+
th.group-header {
> div {
.create-button {
@@ -339,22 +378,25 @@ div.list-kanban > div > table {
padding: 5px 12px 5px 0;
}
+.list-group-tree > li {
+ padding: 0 var(--panel-padding) 0 0;
+}
+
.list > table th.action-cell {
a {
- left: 11px;
- right: auto;
+ left: 11px;
+ right: auto;
}
}
#main > .list-container > .list > table th.action-cell {
a {
- left: 9px;
- right: auto;
+ left: 9px;
+ right: auto;
- @media screen and (max-width: @screen-xs-max) {
- right: auto;
- left: 5px;
- }
+ @media screen and (max-width: @screen-xs-max) {
+ left: 5px;
+ }
}
}
@@ -363,13 +405,7 @@ table.table-admin-panel tr > td:first-child > div > a {
padding-left: 10px;
}
-.input-group > .input-group-btn:not(:first-child) > .btn:first-child {
- border-top-right-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
- border-top-left-radius: var(--border-radius) !important;
- border-bottom-left-radius: var(--border-radius) !important;
-}
-
+.input-group > .input-group-btn:not(:first-child) > .btn:first-child,
.input-group > .input-group-btn:last-child > .form-control:last-child {
border-top-left-radius: var(--border-radius) !important;
border-bottom-left-radius: var(--border-radius) !important;
@@ -381,11 +417,6 @@ table.table-admin-panel tr > td:first-child > div > a {
border-radius: 0 !important;
}
-.field .input-group > .input-group-btn > button.btn.btn-icon:last-child {
- border-top-left-radius: 5px !important;
- border-bottom-left-radius: 5px !important;
-}
-
.field .input-group > input.main-element.form-control:first-child {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
@@ -428,6 +459,7 @@ table.table-admin-panel tr > td:first-child > div > a {
&.radius-right {
border-top-left-radius: var(--border-radius) !important;
border-bottom-left-radius: var(--border-radius) !important;
+
&:not(.radius-left) {
.border-right-radius(0) !important;
}
@@ -436,6 +468,7 @@ table.table-admin-panel tr > td:first-child > div > a {
&.radius-left {
border-top-right-radius: var(--border-radius) !important;
border-bottom-right-radius: var(--border-radius) !important;
+
&:not(.radius-right) {
.border-left-radius(0) !important;
}
@@ -456,20 +489,24 @@ table.table-admin-panel tr > td:first-child > div > a {
> thead,
> tbody {
> tr {
- > th:first-child,
- > td:first-child {
- padding-right: var(--padding-base-horizontal);
+ > th:first-child,
+ > td:first-child {
+ padding-right: var(--padding-base-horizontal);
+ }
- @media screen and (max-width: @screen-xs-max) {
- padding-right: var(--table-cell-padding);
+ > th:last-child,
+ > td:last-child {
+ padding-left: var(--padding-base-horizontal);
}
- }
- > th:last-child,
- > td:last-child {
- padding-left: var(--padding-base-horizontal);
+ @media screen and (max-width: @screen-xs-max) {
+ > th:first-child,
+ > td:first-child {
+ padding-right: var(--table-cell-padding);
+ }
- @media screen and (max-width: @screen-xs-max) {
+ > th:last-child,
+ > td:last-child {
padding-left: var(--table-cell-padding);
}
}
@@ -493,19 +530,10 @@ table.table-admin-panel tr > td:first-child > div > a {
}
}
}
-}
-@media screen and (min-width: @screen-sm-min) {
.folders-container.sticked {
left: unset;
right: 15px;
-
- .list-group-side {
- > li {
- //margin-left: -15px;
- //margin-right: 0;
- }
- }
}
}
@@ -513,10 +541,6 @@ table.table-admin-panel tr > td:first-child > div > a {
float: right;
}
-.list .checkbox-dropdown {
- right: 4px;
-}
-
.checkbox input[type="checkbox"].form-checkbox {
margin-left: 0;
margin-right: -20px;
diff --git a/frontend/less/espo-rtl/layout-side.less b/frontend/less/espo/rtl/layout-side.less
similarity index 100%
rename from frontend/less/espo-rtl/layout-side.less
rename to frontend/less/espo/rtl/layout-side.less
diff --git a/frontend/less/espo-rtl/layout-top.less b/frontend/less/espo/rtl/layout-top.less
similarity index 92%
rename from frontend/less/espo-rtl/layout-top.less
rename to frontend/less/espo/rtl/layout-top.less
index 0ee15c6abf..09818d1259 100644
--- a/frontend/less/espo-rtl/layout-top.less
+++ b/frontend/less/espo/rtl/layout-top.less
@@ -36,10 +36,6 @@ body:not([data-navbar="side"]) {
padding-left: 18px;
}
}
-
- .search-container .view-mode-switcher-buttons-group {
- float: left !important;
- }
}
@media screen and (max-width: @screen-xs-max) {
@@ -69,7 +65,6 @@ body:not([data-navbar="side"]) {
.kanban-row {
.item-menu-container.pull-right {
- float: left !important;
left: -9px;
margin-left: -10px;
margin-right: 0;
diff --git a/frontend/less/espo/rtl/main.less b/frontend/less/espo/rtl/main.less
new file mode 100644
index 0000000000..22b84c3215
--- /dev/null
+++ b/frontend/less/espo/rtl/main.less
@@ -0,0 +1,6 @@
+html[dir="rtl"] {
+ @import "bootstrap.less";
+ @import "layout-top.less";
+ @import "layout-side.less";
+ @import "custom.less";
+}
diff --git a/frontend/test/spec/test.theme-manager.js b/frontend/test/spec/test.theme-manager.js
index 57053d2094..5c5f10f39b 100644
--- a/frontend/test/spec/test.theme-manager.js
+++ b/frontend/test/spec/test.theme-manager.js
@@ -55,6 +55,14 @@ describe('theme-manager', () => {
"side",
"top"
]
+ },
+ "direction": {
+ "type": "enum",
+ "default": "ltr",
+ "options": [
+ "ltr",
+ "rtl"
+ ]
}
},
"mappedParams": {
@@ -149,6 +157,48 @@ describe('theme-manager', () => {
expect(themeManager.getParam('navbar')).toBe('top');
});
+ it('direction default', () => {
+ spyOn(preferences, 'get').and.callFake(name => {
+ if (name === 'theme') {
+ return 'Espo';
+ }
+ });
+
+ expect(themeManager.getDirection()).toBe('ltr');
+ });
+
+ it('direction from preferences', () => {
+ spyOn(preferences, 'get').and.callFake(name => {
+ if (name === 'theme') {
+ return 'Espo';
+ }
+
+ if (name === 'themeParams') {
+ return {
+ direction: 'rtl',
+ };
+ }
+ });
+
+ expect(themeManager.getDirection()).toBe('rtl');
+ });
+
+ it('invalid direction', () => {
+ spyOn(preferences, 'get').and.callFake(name => {
+ if (name === 'theme') {
+ return 'Espo';
+ }
+
+ if (name === 'themeParams') {
+ return {
+ direction: 'invalid',
+ };
+ }
+ });
+
+ expect(themeManager.getDirection()).toBe('ltr');
+ });
+
it('mapped param 1', () => {
spyOn(preferences, 'get').and.callFake(name => {
if (name === 'theme') {
diff --git a/html/main.html b/html/main.html
index 4ddcd63a65..5d39f7e068 100644
--- a/html/main.html
+++ b/html/main.html
@@ -1,5 +1,5 @@
<!doctype html>
-<html>
+<html dir="{{direction}}">
<head>
<title>{{applicationName}}</title>
<script type="application/json" data-name="loader-params">{{loaderParams}}</script>{{scriptsHtml}}
@@ -51,7 +51,7 @@
});
</script>
</head>
- <body data-id="{{applicationId}}">
+ <body data-id="{{applicationId}}" data-direction="{{direction}}">
<div class="container content"></div>
<footer>
<p class="credit small">&copy; 2026
diff --git a/tests/unit/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgradeTest.php b/tests/unit/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgradeTest.php
new file mode 100644
index 0000000000..8ae7496778
--- /dev/null
+++ b/tests/unit/Espo/Core/Upgrades/Migrations/V10_1/AfterUpgradeTest.php
@@ -0,0 +1,48 @@
+<?php
+
+namespace tests\unit\Espo\Core\Upgrades\Migrations\V10_1;
+
+use Espo\Core\Upgrades\Migrations\V10_1\AfterUpgrade;
+use PHPUnit\Framework\TestCase;
+use ReflectionClass;
+use ReflectionMethod;
+
+class AfterUpgradeTest extends TestCase
+{
+ public function testThemeParamsDefaultToTopNavbarAndRtl(): void
+ {
+ $this->assertEquals(
+ (object) [
+ 'navbar' => 'top',
+ 'direction' => 'rtl',
+ ],
+ $this->prepareThemeParams(null),
+ );
+ }
+
+ public function testThemeParamsPreserveNavbarAndCustomValues(): void
+ {
+ $this->assertEquals(
+ (object) [
+ 'navbar' => 'side',
+ 'custom' => 'value',
+ 'direction' => 'rtl',
+ ],
+ $this->prepareThemeParams((object) [
+ 'navbar' => 'side',
+ 'custom' => 'value',
+ 'direction' => 'ltr',
+ ]),
+ );
+ }
+
+ private function prepareThemeParams(mixed $value): object
+ {
+ $reflection = new ReflectionClass(AfterUpgrade::class);
+ $migration = $reflection->newInstanceWithoutConstructor();
+ $method = new ReflectionMethod(AfterUpgrade::class, 'prepareThemeParams');
+
+ /** @var object */
+ return $method->invoke($migration, $value);
+ }
+}
diff --git a/tests/unit/Espo/Core/Utils/ThemeManagerTest.php b/tests/unit/Espo/Core/Utils/ThemeManagerTest.php
new file mode 100644
index 0000000000..241f90a04d
--- /dev/null
+++ b/tests/unit/Espo/Core/Utils/ThemeManagerTest.php
@@ -0,0 +1,82 @@
+<?php
+
+namespace tests\unit\Espo\Core\Utils;
+
+use Espo\Core\Utils\Config;
+use Espo\Core\Utils\Metadata;
+use Espo\Core\Utils\Theme\Direction;
+use Espo\Core\Utils\Theme\MetadataProvider;
+use Espo\Core\Utils\ThemeManager;
+use PHPUnit\Framework\TestCase;
+
+class ThemeManagerTest extends TestCase
+{
+ public function testDirectionFromConfig(): void
+ {
+ $manager = $this->createManager(
+ configValues: [
+ 'theme' => 'Espo',
+ 'themeParams.direction' => 'rtl',
+ ],
+ );
+
+ $this->assertSame(Direction::Rtl, $manager->getDirection());
+ }
+
+ public function testDirectionFromThemeDefault(): void
+ {
+ $manager = $this->createManager(
+ configValues: [
+ 'theme' => 'Custom',
+ 'themeParams.direction' => 'invalid',
+ ],
+ metadataValues: [
+ 'themes.Custom.params.direction.default' => 'rtl',
+ ],
+ );
+
+ $this->assertSame(Direction::Rtl, $manager->getDirection());
+ }
+
+ public function testInvalidDirectionFallsBackToLtr(): void
+ {
+ $manager = $this->createManager(
+ configValues: [
+ 'theme' => 'Espo',
+ 'themeParams.direction' => 'invalid',
+ ],
+ metadataValues: [
+ 'themes.Espo.params.direction.default' => 'invalid',
+ ],
+ );
+
+ $this->assertSame(Direction::Ltr, $manager->getDirection());
+ }
+
+ /**
+ * @param array<string, mixed> $configValues
+ * @param array<string, mixed> $metadataValues
+ */
+ private function createManager(array $configValues, array $metadataValues = []): ThemeManager
+ {
+ $config = $this->createMock(Config::class);
+ $config
+ ->method('get')
+ ->willReturnCallback(fn (string $key) => $configValues[$key] ?? null);
+
+ $metadata = $this->createMock(Metadata::class);
+ $metadata
+ ->method('get')
+ ->willReturnCallback(function (array|string $path) use ($metadataValues) {
+ $key = is_array($path) ? implode('.', $path) : $path;
+
+ return $metadataValues[$key] ?? null;
+ });
+
+ return new ThemeManager(
+ $config,
+ $metadata,
+ $this->createMock(MetadataProvider::class),
+ );
+ }
+}
diff --git a/tests/unit/Espo/Tools/LeadCapture/FormServiceTest.php b/tests/unit/Espo/Tools/LeadCapture/FormServiceTest.php
new file mode 100644
index 0000000000..8a67aee7ed
--- /dev/null
+++ b/tests/unit/Espo/Tools/LeadCapture/FormServiceTest.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace tests\unit\Espo\Tools\LeadCapture;
+
+use Espo\Core\Utils\Theme\Direction;
+use Espo\Entities\LeadCapture;
+use Espo\Tools\LeadCapture\FormService;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\TestCase;
+use ReflectionClass;
+
+class FormServiceTest extends TestCase
+{
+ /**
+ * @return iterable<string, array{string, Direction}>
+ */
+ public static function directionProvider(): iterable
+ {
+ yield 'Arabic' => ['ar_AR', Direction::Rtl];
+ yield 'Persian' => ['fa_IR', Direction::Rtl];
+ yield 'Hebrew' => ['he_IL', Direction::Rtl];
+ yield 'Urdu' => ['ur_IN', Direction::Rtl];
+ yield 'English' => ['en_US', Direction::Ltr];
+ yield 'Turkish' => ['tr_TR', Direction::Ltr];
+ }
+
+ #[DataProvider('directionProvider')]
+ public function testDirectionFromFormLanguage(string $language, Direction $expected): void
+ {
+ $leadCapture = $this->createMock(LeadCapture::class);
+ $leadCapture
+ ->method('getFormLanguage')
+ ->willReturn($language);
+
+ $reflection = new ReflectionClass(FormService::class);
+ /** @var FormService $service */
+ $service = $reflection->newInstanceWithoutConstructor();
+
+ $this->assertSame($expected, $service->getDirection($leadCapture));
+ }
+}