N°931 AttributeSet more generic CSS classes :

* more generic names
* use same classes in both view and edit
* in the scss file, 3 sections : attribute-set edition (with other field types styles), generic Selectize overridings, and styles for attribute-set items visualisation
This commit is contained in:
Pierre Goiffon
2018-09-27 10:10:11 +02:00
parent 3bed62a473
commit 6eaa7c0530
5 changed files with 93 additions and 138 deletions

View File

@@ -7084,7 +7084,7 @@ class AttributeTagSet extends AttributeDBFieldVoid
$sHTML = '';
if (!empty($aValues))
{
$sHTML .= $this->GenerateViewHtmlForValues($aValues, 'attribute-tagset-undefined');
$sHTML .= $this->GenerateViewHtmlForValues($aValues, 'attribute-set-item-undefined');
}
$aValues = $oTagSet->GetTags();
if (!empty($aValues))
@@ -7177,7 +7177,7 @@ class AttributeTagSet extends AttributeDBFieldVoid
* @return string
* @throws \CoreException
*/
private function GenerateViewHtmlForValues($aValues, $sCssClass = 'attribute-tagset')
private function GenerateViewHtmlForValues($aValues, $sCssClass = 'attribute-set')
{
if (empty($aValues)) {return '';}
$sHtml = '<span class="'.$sCssClass.'">';
@@ -7197,11 +7197,11 @@ class AttributeTagSet extends AttributeDBFieldVoid
$sFilter = urlencode($oFilter->serialize());
$sUrl = utils::GetAbsoluteUrlAppRoot()."pages/$sUIPage?operation=search&filter=".$sFilter."&{$sContext}";
$sHtml .= '<a href="'.$sUrl.'" class="attribute-tag attribute-tag-'.$sTagCode.'" data-code="'.$sTagCode.'" data-label="'.$sTagLabel.'" data-description="'.htmlentities($sTagDescription, ENT_QUOTES, 'UTF-8').'">'.$sTagLabel.'</a>';
$sHtml .= '<a href="'.$sUrl.'" class="attribute-set-item attribute-set-item-'.$sTagCode.'" data-code="'.$sTagCode.'" data-label="'.$sTagLabel.'" data-description="'.htmlentities($sTagDescription, ENT_QUOTES, 'UTF-8').'">'.$sTagLabel.'</a>';
}
else
{
$sHtml .= '<span class="attribute-tag-undefined">'.$oTag.'</span>';
$sHtml .= '<span class="attribute-set-item-undefined">'.$oTag.'</span>';
}
}
$sHtml .= '</span>';