{% extends '@OroUI/actions/update.html.twig' %}
{% import '@OroUI/macros.html.twig' as UI %}
{% oro_title_set({params : {"%entity.subject%": entity.subject, "%entityName%": 'oro.task.entity_label'|trans }}) %}
{% set entityId = entity.id %}
{% block navButtons %}
{% import '@OroUI/macros.html.twig' as UI %}
{% set html = UI.saveAndCloseButton({
'route': 'oro_task_view',
'params': {'id': '$id'}
}) %}
{% if is_granted('oro_task_create') %}
{% set html = html ~ UI.saveAndNewButton({
'route': 'oro_task_create'
}) %}
{% endif %}
{% if is_granted('oro_task_update') %}
{% set html = html ~ UI.saveAndStayButton({
'route': 'oro_task_update',
'params': {'id': '$id'}
}) %}
{% endif %}
{{ UI.dropdownSaveButton({'html': html}) }}
{{ UI.cancelButton(path('oro_task_index')) }}
{% endblock navButtons %}
{% block pageHeader %}
{% if entityId %}
{% set breadcrumbs = {
'entity': entity,
'indexPath': path('oro_task_index'),
'indexLabel': 'oro.task.entity_plural_label'|trans,
'entityTitle': entity.subject
} %}
{{ parent() }}
{% else %}
{% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.task.entity_label'|trans}) %}
{% include '@OroUI/page_title_block.html.twig' with { title: title } %}
{% endif %}
{% endblock pageHeader %}
{% block breadcrumbs %}
{% import '@OroUI/macros.html.twig' as UI %}
{{ parent() }}
{% set status = {
'open': 'enabled',
'in_progress': 'tentatively',
'closed': 'disabled'
} %}
{% if entity.status is not null %}
{{ UI.badge(entity.status.name, status[entity.status.id] ? status[entity.status.id] : 'disabled') }}
{% endif %}
{% endblock breadcrumbs %}
{% block content_data %}
{% set id = 'task-form' %}
{% set dataBlocks = [{
'title': 'General Information'|trans,
'subblocks': [
{
'title': '',
'data': [
form_row(form.subject),
form_row(form.description),
form_row(form.dueDate),
form_row(form.status),
form_row(form.taskPriority),
form.owner is defined ? form_row(form.owner) : '',
form_row(form.reminders)
]
}
]
}] %}
{% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'Additional'|trans)) %}
{% set data = {
'formErrors': form_errors(form)? form_errors(form) : null,
'dataBlocks': dataBlocks,
} %}
{{ parent() }}
{% endblock content_data %}