N°4283 - Improve textarea and OQL inputs style

- All textarea app. wide avec the same padding
- OQL fields have the same padding as the other textareas
- OQL fields have the monospaced font
This commit is contained in:
Molkobain
2021-11-19 16:34:01 +01:00
parent a246528eec
commit cbe42cd727
9 changed files with 25 additions and 16 deletions

View File

@@ -2193,7 +2193,10 @@ HTML;
$sStyle = 'style="'.implode('; ', $aStyles).'"';
}
$aTextareaCssClasses = [];
if ($oAttDef->GetEditClass() == 'OQLExpression') {
$aTextareaCssClasses[] = 'ibo-query-oql';
// N°3227 button to open predefined queries dialog
$sPredefinedBtnId = 'predef_btn_'.$sFieldPrefix.$sAttCode.$sNameSuffix;
$sSearchQueryLbl = Dict::S('UI:Edit:SearchQuery');
@@ -2263,14 +2266,16 @@ JS
} else {
$sAdditionalStuff = '';
}
// Ok, the text area is drawn here
$sTextareCssClassesAsString = implode(' ', $aTextareaCssClasses);
$sHTMLValue = <<<HTML
{$sAdditionalStuff}
<div class="field_input_zone field_input_text ibo-input-wrapper ibo-input-text-wrapper" data-validation="untouched">
<div class="f_i_text_header">
<span class="fullscreen_button" title="{$sFullscreenLabelForHtml}"></span>
</div>
<textarea class="ibo-input ibo-input-text" title="{$sHelpText}" name="attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}" rows="8" cols="40" id="{$iId}" {$sStyle} >{$sEditValueForHtml}</textarea>
<textarea class="ibo-input ibo-input-text {$sTextareCssClassesAsString}" title="{$sHelpText}" name="attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}" rows="8" cols="40" id="{$iId}" {$sStyle} >{$sEditValueForHtml}</textarea>
</div>
{$sValidationSpan}{$sReloadSpan}
HTML;

View File

@@ -1008,7 +1008,7 @@ HTML;
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $this->aProperties['query']);
$oField->SetMandatory();
$oField->AddCSSClass("ibo-queryoql");
$oField->AddCSSClass("ibo-query-oql");
$oForm->AddField($oField);
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
@@ -1045,7 +1045,7 @@ HTML;
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $sOQL);
$oField->SetMandatory();
$oField->AddCSSClass("ibo-queryoql");
$oField->AddCSSClass("ibo-query-oql");
$oForm->AddField($oField);
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
@@ -1395,7 +1395,7 @@ abstract class DashletGroupBy extends Dashlet
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $this->aProperties['query']);
$oField->SetMandatory();
$oField->AddCSSClass("ibo-queryoql");
$oField->AddCSSClass("ibo-query-oql");
$oForm->AddField($oField);
try {
@@ -1652,7 +1652,7 @@ abstract class DashletGroupBy extends Dashlet
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $sOQL);
$oField->SetMandatory();
$oField->AddCSSClass("ibo-queryoql");
$oField->AddCSSClass("ibo-query-oql");
$oForm->AddField($oField);
if (!is_null($sOQL)) {
@@ -2225,7 +2225,7 @@ class DashletHeaderDynamic extends Dashlet
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletHeaderDynamic:Prop-Query'), $this->aProperties['query']);
$oField->SetMandatory();
$oField->AddCSSClass("ibo-queryoql");
$oField->AddCSSClass("ibo-query-oql");
$oForm->AddField($oField);
try

View File

@@ -126,7 +126,7 @@ class QueryOQL extends Query
function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
{
$aFieldsMap = parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
$oPage->add_script("$('[name=\"attr_oql\"]').addClass('ibo-queryoql'); $('[data-attribute-code=\"oql\"]').addClass('ibo-queryoql');");
$oPage->add_script("$('[name=\"attr_oql\"]').addClass('ibo-query-oql'); $('[data-attribute-code=\"oql\"]').addClass('ibo-query-oql');");
if (!$bEditMode) {
$sFields = trim($this->Get('fields'));

View File

@@ -22,4 +22,8 @@ fieldset {
legend {
@extend .ibo-fieldset-legend;
}
textarea {
@extend .ibo-input-text;
}

View File

@@ -17,6 +17,6 @@ $ibo-input-text--padding-y: 10px !default;
min-height: 15em;
}
textarea.ibo-queryoql, .ibo-queryoql:not(:nth-child(n)), .ibo-queryoql > :not(.ibo-field--label) {
.ibo-query-oql, .ibo-query-oql > :not(.ibo-field--label) {
@extend %ibo-font-code-150;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -174,7 +174,7 @@ try
//--- Query textarea
$oQueryTextArea = new TextArea('expression', utils::EscapeHtml($sExpression), 'expression', 120, 8);
$oQueryTextArea->AddCSSClass('ibo-queryoql');
$oQueryTextArea->AddCSSClass('ibo-query-oql');
$oQueryForm->AddSubBlock($oQueryTextArea);
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot()."/js/jquery.hotkeys.js");

View File

@@ -132,7 +132,7 @@ function DisplayExpressionForm(WebPage $oP, $sAction, $sExpression = '', $sExcep
$oFieldQuery = FieldUIBlockFactory::MakeStandard('<input type="radio" name="query_mode" value="oql" id="radio_oql" checked><label for="radio_oql">'.Dict::S('Core:BulkExportLabelOQLExpression').'</label>');
$oTextArea = new TextArea('expression', htmlentities($sExpression, ENT_QUOTES, 'UTF-8'), "textarea_oql", 70, 8);
$oTextArea->SetPlaceholder(Dict::S('Core:BulkExportQueryPlaceholder'));
$oTextArea->AddCSSClass("ibo-queryoql");
$oTextArea->AddCSSClass("ibo-query-oql");
$oFieldQuery->AddSubBlock($oTextArea);
$oForm->AddSubBlock($oFieldQuery);
if (!empty($sExceptionMessage)) {