{% extends '@DWGinger/crud/form/edit.html.twig' %}
{% import _self as macros %}
{% set duplicate = person.duplicates.0 %}
{% set actionsMenu = knp_menu_get('actions', [], { 'actions': {
'Index': {
'route': 'dw_ginger_duplicate_index',
'label': 'action.back_to_list',
'btnClass': 'btn-success',
'btnIcon': 'fas fa-chevron-left',
}
} }) %}
{% macro takeover(field_name, orig_value, duplicate_value) %}
{% if duplicate_value is not empty and duplicate_value is not same as (orig_value) %}
{{ duplicate_value }}
{% elseif duplicate_value is not empty %}
(ident) {{ duplicate_value }}
{% endif %}
{% endmacro %}
{% macro takeover_tags(form_id, field_name, orig_value, duplicate_value) %}
{% if duplicate_value is not empty %}
{% for tag in duplicate_value %}
{% if tag not in orig_value %}
{{ tag }}
{% endif %}
{% endfor %}
{% for tag in duplicate_value %}
{% if tag in orig_value %}
{% if loop.first %}Ident: {% endif %}
{{ tag -}}
{%- if not loop.last %}, {% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endmacro %}
{% macro takeover_gender(field_name, orig_value, duplicate_value) %}
{% if duplicate_value is not empty and duplicate_value is not same as (orig_value) %}
{{ ('gender.'~duplicate_value)|trans }}
{% elseif duplicate_value is not empty %}
(ident) {{ ('gender.'~duplicate_value)|trans }}
{% endif %}
{% endmacro %}
{% macro takeover_bdate(field_name, orig_value, duplicate_value) %}
{% if duplicate_value is not empty and duplicate_value|date('d.m.Y') is not same as (orig_value|date('d.m.Y')) %}
{{ duplicate_value|date('d.m.Y') }}
{% elseif duplicate_value is not empty %}
(ident) {{ duplicate_value|date('d.m.Y') }}
{% endif %}
{% endmacro %}
{% block javascripts %}
{{ parent() }}
{% endblock %}
{% block heading %}
{{ 'title.deduplicate_person'|trans({'%object%': person.email}) }} (1/{{ person.duplicates|length }})
{% endblock %}
{% block actions %}
{% endblock %}
{% block content %}
{% form_theme form '@DWGinger/form/jquery.collection.html.twig' %}
{{ form_start(form) }}