-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-1802: Update design for location swap and table locations #146
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.ibexa-content-locations { | ||
&__visibility-toggler-label { | ||
color: $ibexa-color-dark-400; | ||
font-size: $ibexa-text-font-size-small; | ||
|
||
.ibexa-icon { | ||
fill: $ibexa-color-dark-400; | ||
} | ||
|
||
&--hidden { | ||
display: none; | ||
} | ||
} | ||
|
||
.ibexa-table { | ||
&__header-cell { | ||
&--visibility-toggler { | ||
width: calculateRem(300px); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.ibexa-form-location-swap { | ||
max-width: calculateRem(700px); | ||
margin-top: calculateRem(24px); | ||
padding: calculateRem(34px) calculateRem(21px); | ||
border-radius: $ibexa-border-radius; | ||
border: calculateRem(1px) solid $ibexa-color-dark-200; | ||
|
||
&__label { | ||
font-size: $ibexa-text-font-size-medium; | ||
margin-bottom: calculateRem(42px); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,107 +3,116 @@ | |||||
{% form_theme form_content_location_add '@ibexadesign/ui/form/flat_widgets.html.twig' %} | ||||||
{% form_theme form_content_location_remove with ['@ibexadesign/ui/form/flat_widgets.html.twig', '@ibexadesign/ui/form_fields.html.twig'] %} | ||||||
|
||||||
<section> | ||||||
<section class="ibexa-content-locations"> | ||||||
{{ form(form_content_location_add, {'action': path('ezplatform.location.add')}) }} | ||||||
{% set body_rows = [] %} | ||||||
{% if locations is not empty %} | ||||||
{% for location in locations %} | ||||||
{% set body_row_cols = [] %} | ||||||
|
||||||
{% set col_raw %} | ||||||
{{ form_widget(form_content_location_remove.locations[location.id], {'attr': {'disabled': not location.canDelete}}) }} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
has_checkbox: true, | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set col_raw %} | ||||||
{% include '@ibexadesign/ui/location_path.html.twig' with {'locations': location.pathLocations, 'link_last_element': true} %} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set body_row_cols = body_row_cols|merge([ | ||||||
{ content: location.childCount }, | ||||||
]) %} | ||||||
|
||||||
{% set col_raw %} | ||||||
<label | ||||||
class="ibexa-checkbox-icon {{ not location.explicitlyHidden ? 'is-checked' }}{{ not can_hide[location.id] ? 'disabled' }}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we delete |
||||||
title="{{ 'tab.locations.visibility'|trans|desc('Visibility') }}" | ||||||
> | ||||||
<svg class="ibexa-icon ibexa-icon--view"> | ||||||
<use xlink:href="{{ ibexa_icon_path('view') }}"></use> | ||||||
</svg> | ||||||
<svg class="ibexa-icon ibexa-icon--view-hide"> | ||||||
<use xlink:href="{{ ibexa_icon_path('view-hide') }}"></use> | ||||||
</svg> | ||||||
{% set body_rows = [] %} | ||||||
{% if locations is not empty %} | ||||||
{% for location in locations %} | ||||||
{% set body_row_cols = [] %} | ||||||
|
||||||
{% set col_raw %} | ||||||
{{ form_widget(form_content_location_remove.locations[location.id], {'attr': {'disabled': not location.canDelete}}) }} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
has_checkbox: true, | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set col_raw %} | ||||||
{% include '@ibexadesign/ui/location_path.html.twig' with {'locations': location.pathLocations, 'link_last_element': true} %} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set body_row_cols = body_row_cols|merge([ | ||||||
{ content: '' }, | ||||||
]) %} | ||||||
|
||||||
{% set col_raw %} | ||||||
<input | ||||||
class="ibexa-checkbox-icon__checkbox" | ||||||
{{ not location.explicitlyHidden ? 'checked' }} | ||||||
type="checkbox" | ||||||
name="updateVisibility" | ||||||
{{ not can_hide[location.id] ? 'disabled' }} | ||||||
class="ibexa-input ibexa-input--radio" | ||||||
type="radio" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure? I think that the old type (
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the invsion project, there should be a radio here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, you are right, I was confused because the order of the columns has been changed. :) |
||||||
{{ location.main ? 'checked' }} | ||||||
{{ not location.canEdit ? 'disabled' }} | ||||||
name="updateMainLocation" | ||||||
value="{{ location.id }}" | ||||||
> | ||||||
</label> | ||||||
{% if location.invisible %} | ||||||
<span class="ml-2"> | ||||||
{{ 'tab.locations.hidden_content_or_superior'|trans|desc('Content or its ancestor is hidden') }} | ||||||
</span> | ||||||
{% endif %} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set body_row_cols = body_row_cols|merge([ | ||||||
{ content: '' }, | ||||||
]) %} | ||||||
|
||||||
{% set col_raw %} | ||||||
<input | ||||||
class="ibexa-input ibexa-input--radio" | ||||||
type="radio" | ||||||
{{ location.main ? 'checked' }} | ||||||
{{ not location.canEdit ? 'disabled' }} | ||||||
name="updateMainLocation" | ||||||
value="{{ location.id }}" | ||||||
> | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %} | ||||||
{% endfor %} | ||||||
{% endif %} | ||||||
{% endset %} | ||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% embed '@ibexadesign/ui/component/table/table.html.twig' with { | ||||||
headline: 'tab.locations.content_locations'|trans|desc('Content Locations'), | ||||||
head_cols: [ | ||||||
{ has_checkbox: true }, | ||||||
{ content: 'tab.locations.path'|trans|desc('Path') }, | ||||||
{ content: 'tab.locations.subitems'|trans|desc('Sub-items') }, | ||||||
{ content: 'tab.locations.visibility'|trans|desc('Visibility'), attr: { colspan: 2 } }, | ||||||
{ content: 'tab.locations.main'|trans|desc('Main') }, | ||||||
], | ||||||
body_rows, | ||||||
actions: tab.table_header_tools(form_content_location_add, form_content_location_remove, can_add), | ||||||
} %} | ||||||
{% block between_header_and_table %} | ||||||
{{ form_start(form_content_location_remove, { | ||||||
'action': path('ezplatform.location.remove'), | ||||||
'attr': { 'class': 'ibexa-toggle-btn-state', 'data-toggle-button-id': '#delete-locations' } | ||||||
}) }} | ||||||
{% endblock %} | ||||||
{% endembed %} | ||||||
{% set col_raw %} | ||||||
<div class="ibexa-content-locations__visibility-toggler"> | ||||||
<div class="ibexa-toggle ibexa-toggle--checkbox {{ not can_hide[location.id] ? 'ibexa-toggle--is-disabled' }} {{ not location.explicitlyHidden ? 'ibexa-toggle--is-checked' }}"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we import There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I can't use the toggle widget here because it is a block There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in private: for now, it is not possible to include |
||||||
<label class="ibexa-toggle__switcher"> | ||||||
<span class="ibexa-toggle__indicator"></span> | ||||||
<input | ||||||
type="checkbox" | ||||||
class="ibexa-toggle__input ibexa-content-locations__visibility-checkbox" | ||||||
{{ not location.explicitlyHidden ? 'checked' }} | ||||||
type="checkbox" | ||||||
name="updateVisibility" | ||||||
{{ not can_hide[location.id] ? 'disabled' }} | ||||||
value="{{ location.id }}" | ||||||
/> | ||||||
</label> | ||||||
<span class="ibexa-toggle__label ibexa-toggle__label--on"> | ||||||
{{ 'toggle_widget.label.on'|trans|desc('On') }} | ||||||
</span> | ||||||
<span class="ibexa-toggle__label ibexa-toggle__label--off mr-2"> | ||||||
{{ 'toggle_widget.label.off'|trans|desc('Off') }} | ||||||
</span> | ||||||
</div> | ||||||
<label class="ibexa-content-locations__visibility-toggler-label {{ not location.invisible ? 'ibexa-content-locations__visibility-toggler-label--hidden' }}"> | ||||||
<svg class="ibexa-icon ibexa-icon--small "> | ||||||
<use xlink:href="{{ ibexa_icon_path('system-information') }}"></use> | ||||||
</svg> | ||||||
{{ 'tab.locations.hidden_content_or_superior'|trans|desc('Content or its ancestor is hidden') }} | ||||||
</label> | ||||||
</div> | ||||||
{% endset %} | ||||||
|
||||||
{% set body_row_cols = body_row_cols|merge([{ | ||||||
content: col_raw, | ||||||
raw: true, | ||||||
}]) %} | ||||||
|
||||||
{% set body_row_cols = body_row_cols|merge([ | ||||||
{ content: location.childCount }, | ||||||
]) %} | ||||||
|
||||||
{% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %} | ||||||
{% endfor %} | ||||||
{% endif %} | ||||||
|
||||||
{% embed '@ibexadesign/ui/component/table/table.html.twig' with { | ||||||
headline: 'tab.locations.content_locations'|trans|desc('Content Locations'), | ||||||
head_cols: [ | ||||||
{ has_checkbox: true }, | ||||||
{ content: 'tab.locations.path'|trans|desc('Path'), | ||||||
attr: { colspan: 2 } | ||||||
}, | ||||||
{ content: 'tab.locations.main'|trans|desc('Main') }, | ||||||
{ content: 'tab.locations.visibility'|trans|desc('Visibility'), | ||||||
class: 'ibexa-table__header-cell--visibility-toggler' | ||||||
}, | ||||||
{ content: 'tab.locations.subitems'|trans|desc('Sub-items') }, | ||||||
], | ||||||
body_rows, | ||||||
actions: tab.table_header_tools(form_content_location_add, form_content_location_remove, can_add), | ||||||
} %} | ||||||
{% block between_header_and_table %} | ||||||
{{ form_start(form_content_location_remove, { | ||||||
'action': path('ezplatform.location.remove'), | ||||||
'attr': { 'class': 'ibexa-toggle-btn-state', 'data-toggle-button-id': '#delete-locations' } | ||||||
}) }} | ||||||
{% endblock %} | ||||||
{% endembed %} | ||||||
{{ form_end(form_content_location_remove) }} | ||||||
|
||||||
{% if pager is defined and pager.haveToPaginate %} | ||||||
|
@@ -123,9 +132,15 @@ | |||||
</div> | ||||||
{% endif %} | ||||||
|
||||||
{{ form(form_content_location_update_visibility, {'action': path('ezplatform.location.update_visibility')}) }} | ||||||
{{ form(form_content_location_main_update, {'action': path('ezplatform.content.update_main_location')}) }} | ||||||
{{ form_start(form_content_location_update_visibility, {'action': path('ezplatform.location.update_visibility')}) }} | ||||||
{{ form_row(form_content_location_update_visibility.location) }} | ||||||
{{ form_row(form_content_location_update_visibility.hidden, { | ||||||
label_attr: { hidden: true } | ||||||
}) }} | ||||||
{{ form_row(form_content_location_update_visibility.set) }} | ||||||
{{ form_end(form_content_location_update_visibility) }} | ||||||
|
||||||
{{ form(form_content_location_main_update, {'action': path('ezplatform.content.update_main_location')}) }} | ||||||
</section> | ||||||
|
||||||
{% include '@ibexadesign/content/tab/locations/panel_swap.html.twig' with { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.