Skip to content

Commit

Permalink
Merge branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gengar-i committed May 24, 2023
2 parents b33fca5 + 9c0b230 commit 89e6154
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 31 deletions.
6 changes: 6 additions & 0 deletions src/bundle/Resources/public/scss/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
position: relative;
display: inline-block;
cursor: pointer;

&:disabled {
&.form-check-input {
opacity: 1;
}
}
}

&--checkbox {
Expand Down
1 change: 0 additions & 1 deletion src/bundle/Resources/public/scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
height: calculateRem(68px);

.form-check {
display: flex;
margin-bottom: 0;
min-height: calculateRem(16px);
margin-top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,47 @@
{% set global_properties_headline_items %}
{% if languages|length > 1 %}
<form class="form-inline justify-content-end mb-4">
<select class="form-control ibexa-location-language-change">
{% for language in languages %}
<option
value="{{ path('ibexa.content_type.view', {
'contentTypeId': content_type.id,
'contentTypeGroupId': content_type_group.id,
'languageCode': language.languageCode,
'_fragment': constant('Ibexa\\AdminUi\\Tab\\ContentType\\ViewTab::URI_FRAGMENT'),
}) }}"
{% if current_language == language.languageCode %} selected="selected" {% endif %}
>
{{ language.name }}
</option>
{% endfor %}
</select>
{% set choices = languages|map((language) => {
value: path('ibexa.content_type.view', {
'contentTypeId': content_type.id,
'contentTypeGroupId': content_type_group.id,
'languageCode': language.languageCode,
'_fragment': constant('Ibexa\\AdminUi\\Tab\\ContentType\\ViewTab::URI_FRAGMENT'),
}),
label: language.name
}) %}
{% set value = '' %}

{% for language in languages %}
{% if current_language == language.languageCode %}
{% set value = path('ibexa.content_type.view', {
'contentTypeId': content_type.id,
'contentTypeGroupId': content_type_group.id,
'languageCode': language.languageCode,
'_fragment': constant('Ibexa\\AdminUi\\Tab\\ContentType\\ViewTab::URI_FRAGMENT'),
}) %}
{% endif %}
{% endfor %}

{% set source %}
<select class="form-control ibexa-input ibexa-location-language-change">
{% for choice in choices %}
<option
value="{{ choice.value }}"
{% if value == choice.value %}selected="selected"{% endif %}
>
{{ choice.label }}
</option>
{% endfor %}
</select>
{% endset %}

{% include '@ibexadesign/ui/component/dropdown/dropdown.html.twig' with {
source: source,
choices: choices,
value: value,
is_small: true,
} %}
</form>
{% endif %}
{% endset %}
Expand Down
16 changes: 9 additions & 7 deletions src/bundle/Resources/views/themes/admin/language/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@

{% block content %}
{% set enable_checkbox_raw %}
<input
type="checkbox"
title="{{ language.enabled ? 'language.enabled'|trans|desc('Enabled') : 'language.disabled'|trans|desc('Disabled') }}"
class="ibexa-input ibexa-input--checkbox"
disabled
{% if language.enabled %}checked{% endif %}
>
<div class="form-check">
<input
type="checkbox"
title="{{ language.enabled ? 'language.enabled'|trans|desc('Enabled') : 'language.disabled'|trans|desc('Disabled') }}"
class="ibexa-input ibexa-input--checkbox form-check-input"
disabled
{% if language.enabled %}checked{% endif %}
>
</div>
{% endset %}
{% set language_items = [
{
Expand Down
16 changes: 9 additions & 7 deletions src/bundle/Resources/views/themes/admin/language/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@
]) %}

{% set col_raw %}
<input
type="checkbox"
title="{{ language.enabled ? 'language.enabled'|trans|desc('Enabled') : 'language.disabled'|trans|desc('Disabled') }}"
class="ibexa-input ibexa-input--checkbox"
disabled
{% if language.enabled %}checked{% endif %}
>
<div class="form-check">
<input
type="checkbox"
title="{{ language.enabled ? 'language.enabled'|trans|desc('Enabled') : 'language.disabled'|trans|desc('Disabled') }}"
class="ibexa-input ibexa-input--checkbox form-check-input"
disabled
{% if language.enabled %}checked{% endif %}
>
</div>
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
content: col_raw,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export const createCssClassNames = (classes) => {

return Object.entries(classes)
.reduce((total, [name, condition]) => {
return `${total} ${condition ? name : ''}`;
if (condition) {
return `${total} ${name}`;
}

return total;
}, '')
.trim();
};

0 comments on commit 89e6154

Please sign in to comment.