Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS fix for Text/Textarea input fields language selector #560

Merged
merged 6 commits into from
Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use System\Models\File;
use Cms\Models\ThemeData;
use System\Classes\PluginBase;
use System\Classes\CombineAssets;
use RainLab\Translate\Models\Message;
use RainLab\Translate\Classes\EventRegistry;
use RainLab\Translate\Classes\Translator;
Expand Down Expand Up @@ -91,6 +92,8 @@ public function register()
* Register console commands
*/
$this->registerConsoleCommand('translate.scan', 'Rainlab\Translate\Console\ScanCommand');

$this->registerAssetBundles();
}

public function boot()
Expand Down Expand Up @@ -252,6 +255,14 @@ public function registerFormWidgets()
];
}

protected function registerAssetBundles()
{
CombineAssets::registerCallback(function ($combiner) {
$combiner->registerBundle('$/rainlab/translate/assets/less/messages.less');
$combiner->registerBundle('$/rainlab/translate/assets/less/multilingual.less');
});
}

public function localeUrl($url, $locale)
{
$translator = Translator::instance();
Expand Down
78 changes: 16 additions & 62 deletions assets/css/messages.css
Original file line number Diff line number Diff line change
@@ -1,65 +1,19 @@
#messagesContainer {
padding-top: 20px;
}
.callout-container .callout {
margin-bottom: 0;
}
.translate-messages {
position: relative;
margin-top: -20px;
}
.translate-messages .pagination {
margin-left: 20px;
}
.translate-messages .dropdown-button-placeholder {
display: block;
width: 1px;
height: 20px;
}
#messagesContainer {padding-top:20px}
.callout-container .callout {margin-bottom:0}
.translate-messages {position:relative;margin-top:-20px}
.translate-messages .pagination {margin-left:20px}
.translate-messages .dropdown-button-placeholder {display:block;width:1px;height:20px}
.translate-messages .dropdown-to,
.translate-messages .dropdown-from {
position: absolute;
top: 57px;
}
.translate-messages .dropdown-to {
left: 50%;
}
.translate-messages .dropdown-from {
left: 0;
}
.translate-messages .no-other-languages {
text-align: center;
padding: 5px;
}
.translate-messages .dropdown-from {position:absolute;top:57px}
.translate-messages .dropdown-to {left:50%}
.translate-messages .dropdown-from {left:0}
.translate-messages .no-other-languages {text-align:center;padding:5px}
.translate-messages .header-language,
.translate-messages .header-swap-languages,
.translate-messages .header-hide-translated {
line-height: 27px;
}
.translate-messages .header-language {
float: left;
cursor: pointer;
}
.translate-messages .header-language span.is-default {
text-transform: none;
}
.translate-messages .header-swap-languages {
margin-right: 10px;
float: right;
font-size: 16px;
cursor: pointer;
}
.translate-messages .header-hide-translated {
float: right;
text-align: right;
}
.translate-messages .header-hide-translated label {
font-weight: normal;
margin-bottom: 0;
margin-right: 10px;
font-size: 12px;
}
.translate-messages .header-hide-translated label:before {
top: 2px;
left: 0;
}
.translate-messages .header-hide-translated {line-height:27px}
.translate-messages .header-language {float:left;cursor:pointer}
.translate-messages .header-language span.is-default {text-transform:none}
.translate-messages .header-swap-languages {margin-right:10px;float:right;font-size:16px;cursor:pointer}
.translate-messages .header-hide-translated {float:right;text-align:right}
.translate-messages .header-hide-translated label {font-weight:normal;margin-bottom:0;margin-right:10px;font-size:12px}
.translate-messages .header-hide-translated label:before {top:2px;left:0}
101 changes: 18 additions & 83 deletions assets/css/multilingual.css
Original file line number Diff line number Diff line change
@@ -1,83 +1,18 @@
.field-multilingual {
position: relative;
}
.field-multilingual .ml-btn {
background: transparent;
position: absolute;
color: #7b7b7b;
text-transform: uppercase;
font-size: 11px;
letter-spacing: 1px;
width: 44px;
padding-right: 0;
-webkit-box-shadow: none;
box-shadow: none;
text-shadow: none;
z-index: 2;
}
.field-multilingual .ml-btn:hover {
color: #555555;
}
.field-multilingual.field-multilingual-text .form-control {
padding-right: 44px;
}
.field-multilingual.field-multilingual-text .ml-btn {
right: 4px;
top: 50%;
margin-top: -44px;
height: 88px;
}
.field-multilingual.field-multilingual-textarea .ml-btn {
right: 11px;
top: 5px;
text-align: right;
}
.field-multilingual.field-multilingual-textarea .ml-dropdown-menu {
top: 39px;
right: 1px;
}
.field-multilingual.field-multilingual-richeditor .ml-btn {
top: 43px;
right: 25px;
text-align: right;
}
.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu {
top: 74px;
right: 12px;
}
.field-multilingual.field-multilingual-markdowneditor .ml-btn {
top: 43px;
right: 25px;
text-align: right;
}
.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu {
top: 74px !important;
right: 12px;
}
.field-multilingual.field-multilingual-repeater .ml-btn {
top: -27px;
right: 11px;
text-align: right;
}
.field-multilingual.field-multilingual-repeater .ml-dropdown-menu {
top: 0;
right: 0;
}
.field-multilingual.field-multilingual-repeater.is-empty {
padding-top: 5px;
}
.field-multilingual.field-multilingual-repeater.is-empty .ml-btn {
top: -10px;
right: 5px;
text-align: right;
}
.field-multilingual.field-multilingual-repeater.is-empty .ml-dropdown-menu {
top: 15px;
right: -7px;
}
.fancy-layout .form-tabless-fields .field-multilingual .ml-btn {
color: rgba(255, 255, 255, 0.8);
}
.fancy-layout .form-tabless-fields .field-multilingual .ml-btn:hover {
color: #ffffff;
}
.field-multilingual {position:relative}
.field-multilingual .ml-btn {background:transparent;position:absolute;color:#7b7b7b;text-transform:uppercase;font-size:11px;letter-spacing:1px;width:44px;padding-right:0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none;z-index:2}
.field-multilingual .ml-btn:hover {color:#555}
.field-multilingual.field-multilingual-text input.form-control {padding-right:44px}
.field-multilingual.field-multilingual-text .ml-btn {right:4px;top:50%;margin-top:-44px;height:88px}
.field-multilingual.field-multilingual-textarea .ml-btn {right:11px;top:5px;text-align:right}
.field-multilingual.field-multilingual-textarea .ml-dropdown-menu {top:39px;right:1px}
.field-multilingual.field-multilingual-richeditor .ml-btn {top:43px;right:25px;text-align:right}
.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu {top:74px;right:12px}
.field-multilingual.field-multilingual-markdowneditor .ml-btn {top:43px;right:25px;text-align:right}
.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu {top:74px !important;right:12px}
.field-multilingual.field-multilingual-repeater .ml-btn {top:-27px;right:11px;text-align:right}
.field-multilingual.field-multilingual-repeater .ml-dropdown-menu {top:0;right:0}
.field-multilingual.field-multilingual-repeater.is-empty {padding-top:5px}
.field-multilingual.field-multilingual-repeater.is-empty .ml-btn {top:-10px;right:5px;text-align:right}
.field-multilingual.field-multilingual-repeater.is-empty .ml-dropdown-menu {top:15px;right:-7px}
.fancy-layout .form-tabless-fields .field-multilingual .ml-btn {color:rgba(255,255,255,0.8)}
.fancy-layout .form-tabless-fields .field-multilingual .ml-btn:hover {color:#fff}
2 changes: 1 addition & 1 deletion assets/less/multilingual.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

&.field-multilingual-text {
.form-control {
input.form-control {
bennothommo marked this conversation as resolved.
Show resolved Hide resolved
padding-right: 44px;
}

Expand Down