mirror of
https://github.com/grocy/grocy.git
synced 2025-04-28 09:16:25 +00:00
Added basic RTL support (reference #984)
This commit is contained in:
parent
9e824a7afc
commit
672c4d33bf
@ -125,21 +125,26 @@ class BaseController
|
||||
});
|
||||
$this->View->set('GettextPo', $localizationService->GetPoAsJsonString());
|
||||
|
||||
// TODO: Better handle this generically based on the current language (header in .po file?)
|
||||
$dir = 'ltr';
|
||||
if (GROCY_LOCALE == 'he_IL')
|
||||
{
|
||||
$dir = 'rtl';
|
||||
}
|
||||
$this->View->set('dir', $dir);
|
||||
|
||||
$this->View->set('U', function ($relativePath, $isResource = false) use ($container) {
|
||||
return $container->get('UrlManager')->ConstructUrl($relativePath, $isResource);
|
||||
});
|
||||
|
||||
$embedded = false;
|
||||
|
||||
if (isset($_GET['embedded']))
|
||||
{
|
||||
$embedded = true;
|
||||
}
|
||||
|
||||
$this->View->set('embedded', $embedded);
|
||||
|
||||
$constants = get_defined_constants();
|
||||
|
||||
foreach ($constants as $constant => $value)
|
||||
{
|
||||
if (substr($constant, 0, 19) !== 'GROCY_FEATURE_FLAG_')
|
||||
@ -149,7 +154,6 @@ class BaseController
|
||||
}
|
||||
|
||||
$this->View->set('featureFlags', $constants);
|
||||
|
||||
if (GROCY_AUTHENTICATED)
|
||||
{
|
||||
$this->View->set('permissions', User::PermissionList());
|
||||
|
@ -10,6 +10,7 @@
|
||||
"bootbox": "^5.3.2",
|
||||
"bootstrap": "^4.5.2",
|
||||
"bootstrap-select": "^1.13.18",
|
||||
"bootstrap-v4-rtl": "^4.5.2-1",
|
||||
"chart.js": "^2.8.0",
|
||||
"datatables.net": "^1.10.22",
|
||||
"datatables.net-bs4": "^1.10.22",
|
||||
|
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ GROCY_LOCALE }}">
|
||||
<html lang="{{ GROCY_LOCALE }}"
|
||||
dir="{{ $dir }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
@ -47,8 +48,13 @@
|
||||
|
||||
<title>@yield('title') | grocy</title>
|
||||
|
||||
@if($dir == 'rtl')
|
||||
<link href="{{ $U('/node_modules/bootstrap-v4-rtl/dist/css/bootstrap.min.css?v=', true) }}{{ $version }}"
|
||||
rel="stylesheet">
|
||||
@else
|
||||
<link href="{{ $U('/node_modules/bootstrap/dist/css/bootstrap.min.css?v=', true) }}{{ $version }}"
|
||||
rel="stylesheet">
|
||||
@endif
|
||||
<link href="{{ $U('/node_modules/startbootstrap-sb-admin/css/sb-admin.min.css?v=', true) }}{{ $version }}"
|
||||
rel="stylesheet">
|
||||
<link href="{{ $U('/node_modules/@fortawesome/fontawesome-free/css/all.css?v=', true) }}{{ $version }}"
|
||||
@ -663,7 +669,11 @@
|
||||
</div>
|
||||
|
||||
<script src="{{ $U('/node_modules/jquery/dist/jquery.min.js?v=', true) }}{{ $version }}"></script>
|
||||
@if($dir == 'rtl')
|
||||
<script src="{{ $U('/node_modules/bootstrap-v4-rtl/dist/js/bootstrap.bundle.min.js?v=', true) }}{{ $version }}"></script>
|
||||
@else
|
||||
<script src="{{ $U('/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js?v=', true) }}{{ $version }}"></script>
|
||||
@endif
|
||||
<script src="{{ $U('/node_modules/startbootstrap-sb-admin/js/sb-admin.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/node_modules/bootbox/dist/bootbox.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/node_modules/jquery-serializejson/jquery.serializejson.min.js?v=', true) }}{{ $version }}"></script>
|
||||
|
@ -678,6 +678,11 @@ bootstrap-select@^1.13.18:
|
||||
resolved "https://registry.yarnpkg.com/bootstrap-select/-/bootstrap-select-1.13.18.tgz#4557119d58dc1159189977161c803962220e4dda"
|
||||
integrity sha512-V1IzK4rxBq5FrJtkzSH6RmFLFBsjx50byFbfAf8jYyXROWs7ZpprGjdHeoyq2HSsHyjJhMMwjsQhRoYAfxCGow==
|
||||
|
||||
bootstrap-v4-rtl@^4.5.2-1:
|
||||
version "4.5.2-1"
|
||||
resolved "https://registry.yarnpkg.com/bootstrap-v4-rtl/-/bootstrap-v4-rtl-4.5.2-1.tgz#fd30136a6a0cec2af30c2dbf13c0e337369e6179"
|
||||
integrity sha512-lwu6VIHAMNaY5VcMbNQa8L7xkBISEW1pq5XA6bpTggz+ONWT6Ya+m774tXh31uBf/SOx6TnuUeD7pEb4e/eGDw==
|
||||
|
||||
bootstrap@4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0.tgz#ceb03842c145fcc1b9b4e15da2a05656ba68469a"
|
||||
|
Loading…
x
Reference in New Issue
Block a user