|
13 | 13 | {{ form_start(form, {'action': path('ibexa.custom_url.add')}) }} |
14 | 14 | {% endblock %} |
15 | 15 | {% block body_content %} |
| 16 | + {% macro info_text(message, modifier = '') %} |
| 17 | + <div class="ibexa-custom-url-from__info-text{{ modifier ? ' ibexa-custom-url-from__info-text--' ~ modifier : '' }}"> |
| 18 | + <svg class="ibexa-icon ibexa-icon--small"> |
| 19 | + <use xlink:href="{{ ibexa_icon_path('system-information') }}"></use> |
| 20 | + </svg> |
| 21 | + {{ message }} |
| 22 | + </div> |
| 23 | + {% endmacro %} |
| 24 | + |
| 25 | + {% import _self as component %} |
| 26 | + |
16 | 27 | <div class="ibexa-custom-url-from"> |
17 | 28 | <div class="ibexa-custom-url-from__item"> |
18 | 29 | <label class="ibexa-label required">{{ 'tab.urls.add.path'|trans|desc('URL') }}</label> |
|
25 | 36 | <div class="ibexa-custom-url-from__item"> |
26 | 37 | <label class="ibexa-label">{{ 'tab.urls.add.redirect'|trans|desc('Redirect to alias destination') }}</label> |
27 | 38 | {{ form_widget(form.redirect) }} |
28 | | - <div class="ibexa-custom-url-from__info-text ibexa-custom-url-from__info-text--checked">{{ 'tab.urls.add.redirect.helper.checked'|trans|desc('The alias will redirect to the destination using an HTTP 301 response.') }}</div> |
29 | | - <div class="ibexa-custom-url-from__info-text ibexa-custom-url-from__info-text--unchecked">{{ 'tab.urls.add.redirect.helper.unchecked'|trans|desc('The alias will not redirect to the destination and the URL will stay the same.') }}</div> |
| 39 | + {{ component.info_text('tab.urls.add.redirect.helper.checked'|trans|desc('The alias will redirect to the destination using an HTTP 301 response.'), 'checked') }} |
| 40 | + {{ component.info_text('tab.urls.add.redirect.helper.unchecked'|trans|desc('The alias will not redirect to the destination and the URL will stay the same.'), 'unchecked') }} |
30 | 41 | </div> |
31 | 42 | <div class="ibexa-custom-url-from__item"> |
32 | 43 | <label class="ibexa-label">{{ 'tab.urls.add.site_root'|trans|desc('Place at the site root') }}</label> |
33 | 44 | {{ form_widget(form.site_root) }} |
34 | | - <div class="ibexa-custom-url-from__info-text ibexa-custom-url-from__info-text--checked">{{ 'tab.urls.add.site_root.helper.checked'|trans|desc('The alias will be placed at the site root.') }}</div> |
35 | | - <div class="ibexa-custom-url-from__info-text ibexa-custom-url-from__info-text--unchecked"> |
36 | | - {% if parent_name is not null %} |
37 | | - {{ 'tab.urls.add.site_root.helper.unchecked'|trans({'%parent_name%': parent_name})|desc('The alias will be placed under %parent_name%') }} |
38 | | - {% else %} |
39 | | - {{ 'tab.urls.add.site_root.helper.no_parent_name'|trans|desc('The alias will be placed under the parent of this Location') }} |
40 | | - {% endif %} |
41 | | - </div> |
| 45 | + {{ component.info_text('tab.urls.add.site_root.helper.checked'|trans|desc('The alias will be placed at the site root.'), 'checked') }} |
| 46 | + {{ component.info_text( |
| 47 | + parent_name is not null |
| 48 | + ? 'tab.urls.add.site_root.helper.unchecked'|trans({'%parent_name%': parent_name})|desc('The alias will be placed under %parent_name%') |
| 49 | + : 'tab.urls.add.site_root.helper.no_parent_name'|trans|desc('The alias will be placed under the parent of this Location'), |
| 50 | + 'unchecked' |
| 51 | + ) }} |
42 | 52 | </div> |
43 | 53 | <div class="ibexa-custom-url-from__item ibexa-custom-url-from__item--siteacces"> |
44 | 54 | <label class="ibexa-label">{{ 'tab.urls.add.site_access'|trans|desc('SiteAccess') }}</label> |
45 | 55 | {{ form_widget(form.site_access) }} |
46 | | - <div class="ibexa-custom-url-from__info-text"> |
47 | | - {{ 'tab.urls.add.root_location_id.helper_secondary'|trans|desc( |
48 | | - "If no SiteAccess selected, the alias will be placed at main root Location." |
49 | | - ) }} |
50 | | - </div> |
| 56 | + {{ component.info_text('tab.urls.add.root_location_id.helper_secondary'|trans|desc( |
| 57 | + "If no SiteAccess selected, the alias will be placed at main root Location." |
| 58 | + )) }} |
51 | 59 | </div> |
52 | 60 | </div> |
53 | 61 | {% endblock %} |
|
0 commit comments