{% set is_product_owner = product.owner == app.user %}
{{ title }}

{{ 'templates.components.product.calendar.clarifying_sentence'|trans }}

{% if is_product_owner and form is not defined %} {# user product page #}
{% else %} {% if form is defined %} {# new service request and product availabilities page #}
{{ form_label(form.startAt, null, {label_attr: {class: 'order-2 mt-4'}}) }} {{ form_errors(form.startAt) }} {{ form_widget(form.startAt, {id: 'calendar-start-day', attr: {class: 'order-3'}}) }}
{{ form_label(form.endAt, null, {label_attr: {class: 'mt-3'}}) }} {{ form_errors(form.endAt) }} {{ form_widget(form.endAt, {id: 'calendar-end-day', type: 'text'}) }}
{% else %} {# product page #}
{% endif %}
{% if actionNeeded %}
{% if app.user is null or is_granted('borrow', product) %} {% if app.user and app.user.address is null %} {% include 'components/product/_modal.html.twig' with { menu_action: false, page_type: 'article', button: 'templates.components.product.calendar.service_request'|trans, title: 'templates.pages.account.index.no-address-title'|trans, message: 'templates.pages.account.index.no-address-message'|trans({ '%product%': product.type.isObject ? 'objet' : 'service' }), action: 'templates.pages.account.product.list.no-address-add'|trans } %} {% else %} {% endif %} {% else %} {{ form_widget(form.submit) }} {% endif %}
{% endif %} {% endif %}