User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Fix form-horizontal for non-latin or long language strings.
Please look for this languages specifies fix: @infograf768
Optional width 200px:
max-width: 200px;
min-width: 200px;
width: 200px;
Testing latest version Firefox, Chrome and etc Chromius based brawsers.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Templates (admin) |
As a Russian language user I am definitely for it. Looking much better now.
Agree
if 2 People test this PR successfully it could go in staging if Maintainers agree.
I have tested this item
Tested with multiple languages and Russian in particular which had this issue.
Logic improvement on i18n to ensure any language looks good/correct in the interface for admin forms.
Please do not edit the css file directly. That is not correct.
The correct way is to make the changes in the less file and then run generatecss.php from the build directory to create the css
Unhappily, we have multiple .form-horizontal .control-label
in the less => css files.
Some have width: auto; depending on the screen width.
Therefore the less file to modify has to be chosen carefully
Also nothing is changed for rtl here.
The Bootstrap default is for the control-label to wrap at 160px so if the intent is to allow the label to wrap then simply removing https://github.com/joomla/joomla-cms/blob/staging/administrator/templates/isis/less/blocks/_forms.less#L10 should give the same result. If you wish to increase the label width you will also need to increase the left margin on .form-horizontal .controls
by the same amount. Not sure if there is a need for setting the min and max width.. maybe you have your reasons?
Test RTL however it should be ok. Media queries should also be fine as is.. smaller screen sizes have the label and control in columns.
As mentioned by @brianteeman you will need to edit the LESS files and then compile rather than editing the CSS directly (https://docs.joomla.org/Joomla_LESS).
Labels |
Added:
?
|
I have tested this item
it because a Spacer field displaying the text as a label, this is some very old legacy.
But even with this, it is looks better than on the screenshot from the pull description
upd: In theory, for a Spacer field we can force class in "JFormFieldSpacer::renderField", something like field-spacer
and then in css use .field-spacer>.control-label{width:auto;}
@quy what do you think?
Sounds good to me in theory. but I am no css guru. :)
@joomla-ua you will update the PR?
@infograf768
in JFormFieldSpacer
class, add method
public function renderField($options = array())
{
$options['class'] = empty($options['class']) ? 'field-spacer' : $options['class'] . ' field-spacer';
return parent::renderField($options);
}
other solution can be, to add a layout (renderLayout
) specially for a Spacer field instead of default joomla.form.renderfield
I like the layout approach more
I can't get it to work here
we have to overwrite width: 160px;
in
.form-horizontal .control-label {
float: left;
padding-top: 5px;
width: 160px;
}
and the code above does not.
@infograf768 I have sent pull with updates to @joomla-ua
the configuration page render the fields without use of renderField
, that why the code from my previous comment not worked
@dgt41 I think here we can use the class, because the layout it is a "new feature" and cannot be accepted until j3.8, I guess.
We can do the layout for Spacer field anytime later.
Eager to test. We have multiple types of spacers and this should take into account all of them.
I would not consider this such a new feature that it could not go into a 3.7.2 (if no B/C impact on frontend).
Category | Administration Templates (admin) | ⇒ | Administration com_config Templates (admin) Libraries |
It works. I just noticed under System > Global Configuration > Templates
, the following does not require the spacer pr because it is coded differently. Should System > Global Configuration > Media
be changed to match?
Supported File Formats
Be careful before changing the file types. Read the tool tips before editing.
@Quy that another field type note
, that actually use a hack to be out of the ".control-label"
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/fields/note.php#L60
Will test tomorrow.
I have tested this item
Thanks. Works great.
@Fedik
We forgot something.
you should do the same for /layouts/joomla/content/options_default.php
to cope with Global Configuration.
For example, I have added in /administrator/components/com_config/model/form/application.xml
a new spacer field.
<field name="spacer1"
type="spacer"
class="text"
label="COM_CONFIG_FIELD_DEFAULT_CAPTCHA_DESC"
/>
(I used an existing lang string).
And I get this
Should be easy
diff would be:
diff --git a/layouts/joomla/content/options_default.php b/layouts/joomla/content/options_default.php
index 9b42831..e36532c 100644
--- a/layouts/joomla/content/options_default.php
+++ b/layouts/joomla/content/options_default.php
@@ -26,4 +26,5 @@
{
$datashowon = '';
+ $groupClass = $field->type === 'Spacer' ? ' field-spacer' : '';
if ($field->showon)
@@ -34,5 +35,5 @@
}
?>
- <div class="control-group"<?php echo $datashowon; ?>>
+ <div class="control-group<?php echo $groupClass; ?>"<?php echo $datashowon; ?>>
<?php if (!isset($displayData->showlabel) || $displayData->showlabel) : ?>
<div class="control-label"><?php echo $field->label; ?></div>
Category | Administration Templates (admin) com_config Libraries | ⇒ | Administration com_config Templates (admin) Layout Libraries |
I have tested this item
I have tested this item
Patch ok for me
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
I will keep 3.7.1 as light as possible, so if it is not without any doubt a bugfix it has to wait for 3.7.2
OK, no p
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-22 19:15:34 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
Joomla pain :)