Skip to content

Commit

Permalink
Merge pull request #5653 from maximebiloe/dev/fix/boom-798
Browse files Browse the repository at this point in the history
Display the public name and in the good language for attribute groups
  • Loading branch information
Julien Martin committed May 26, 2016
2 parents 88209db + b51f46f commit e6a2a57
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
12 changes: 6 additions & 6 deletions admin-dev/themes/new-theme/scss/pages/_product_page.scss
Expand Up @@ -633,8 +633,12 @@
.attributes {
border-top: 2px solid $gray-light;
padding: em(7px);
height: rem(158px);
overflow: auto;
height: rem(162px);
overflow-x: hidden;

.two-columns {
columns: 2;
}

.attribute {
.js-attribute-checkbox {
Expand Down Expand Up @@ -675,10 +679,6 @@
}
}
}

&.two-columns {
columns: 2;
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/PrestaShopBundle/Entity/AttributeRepository.php
Expand Up @@ -17,7 +17,7 @@ public function findByLangAndShop($idLang, $idShop)
$qb = $this->createQueryBuilder('a')
->addSelect('ag.id AS attributeGroupId')
->addSelect('ag.position AS attributeGroupPosition')
->addSelect('agl.name AS attributeGroupName')
->addSelect('agl.publicName AS attributeGroupName')
->addSelect('a.id')
->addSelect('a.color')
->addSelect('a.position as attributePosition')
Expand All @@ -27,6 +27,7 @@ public function findByLangAndShop($idLang, $idShop)
->join('a.attributeLangs', 'al')
->join('ag.attributeGroupLangs', 'agl')
->where('al.lang = :idLang')
->andWhere('agl.lang = :idLang')
->andWhere('s.id = :idShop')
->orderBy('attributePosition')
->addOrderBy('attributeGroupPosition')
Expand Down
Expand Up @@ -75,34 +75,36 @@
{% for attribute_group in attribute_groups %}
<div class="attribute-group">
<a
class="attribute-group-name"
class="attribute-group-name {% if loop.index <= 3 %} collapsed {% endif %}"
data-toggle="collapse"
href="#attribute-group-{{ attribute_group.id }}"
aria-expanded="false"
>
{{ attribute_group.name }}
</a>
<div class="collapse {% if loop.index <= 3 %} in {% endif %} attributes {% if attribute_group.attributes|length > 7 %} two-columns {% endif %}" id="attribute-group-{{ attribute_group.id }}">
{% for attribute in attribute_group.attributes %}
<div class="attribute">
<input
class="js-attribute-checkbox"
id="attribute-{{ attribute.id }}"
data-label="{{ attribute_group.name }} : {{ attribute.name }}"
data-value="{{ attribute.id }}"
data-group-id="{{ attribute_group.id }}"
type="checkbox"
>
<label class="attribute-label" for="attribute-{{ attribute.id }}">
<span
class="pretty-checkbox {% if attribute.color is empty %} not-color {% endif %}"
{% if attribute.color is not empty %} style="background-color: {{ attribute.color }}" {% endif %}
<div class="collapse {% if loop.index <= 3 %} in {% endif %} attributes " id="attribute-group-{{ attribute_group.id }}">
<div class="attributes-overflow {% if attribute_group.attributes|length > 7 %} two-columns {% endif %}">
{% for attribute in attribute_group.attributes %}
<div class="attribute">
<input
class="js-attribute-checkbox"
id="attribute-{{ attribute.id }}"
data-label="{{ attribute_group.name }} : {{ attribute.name }}"
data-value="{{ attribute.id }}"
data-group-id="{{ attribute_group.id }}"
type="checkbox"
>
</span>
{{ attribute.name }}
</label>
</div>
{% endfor %}
<label class="attribute-label" for="attribute-{{ attribute.id }}">
<span
class="pretty-checkbox {% if attribute.color is empty %} not-color {% endif %}"
{% if attribute.color is not empty %} style="background-color: {{ attribute.color }}" {% endif %}
>
</span>
{{ attribute.name }}
</label>
</div>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit e6a2a57

Please sign in to comment.