{% if gift is not empty %} {% set inv_accepted_count = 0 %} {% set hash = 'hash' %} {% for inv in gift.invitation %} {% if inv.vUser.id == vUser.id and inv.confirmedAt is not empty %} {% set inv_accepted_count = inv_accepted_count+1 %} {% set hash = inv.hash %} {% endif %} {% endfor %} {% include 'partials/_subheader.html.twig' with { giftId: gift.id } %} {% include 'partials/_steps.html.twig' with { giftId: gift.id, vUser: vUser } %}
Suggest new ideas!
{{ render(controller('AppBundle:ImnuuIdea:newIdeaFormPartial', { giftId: gift.id, hash: hash })) }}
{% include 'partials/_alert.html.twig' %} {% if ideas is empty %} {% else %} {% set interval = date().diff(gift.validUntil) %} {% for idea in ideas %} {% set chosen_icon = '' %} {% set use_hash = hash is not empty %} {% set edit_path = use_hash ? path('imnuu_idea_hash_edit', {'hash': hash, 'ideaId':idea.id }) : path('imnuu_idea_edit', {'giftId': gift.id, 'ideaId':idea.id }) %} {% if not interval.invert and inv_accepted_count > 0 %} {% endif %} {% endfor %}
{% if (is_granted("IS_AUTHENTICATED_REMEMBERED") and idea.invitation.vUser.id == app.user.vUser.id) or (idea.invitation.hash == app.request.get('hash')) %} {{ idea.title }} {% else %} {{ idea.title }} {% endif %} {% if (is_granted("IS_AUTHENTICATED_REMEMBERED") and idea.invitation.vUser.id == app.user.vUser.id) or (idea.invitation.hash == app.request.get('hash')) %} {{ idea.price|price_format }} {% else %} {{ idea.price|price_format }} {% endif %} {% set votes = 0 %} {% for vote in idea.ideaVote %} {% if vote.invitation.vUser.id == vUser.id %} {% set votes = votes+1 %} {% endif %} {% endfor %} {% if votes == 0 %} {{ render(controller('AppBundle:ImnuuIdeaVote:voteIdeaFormPartial', { giftId: gift.id, ideaId: idea.id, hash: hash, votes: idea.ideaVote|length })) }} {% else %} {{ render(controller('AppBundle:ImnuuIdeaVote:unvoteIdeaFormPartial', { giftId: gift.id, ideaId: idea.id, hash: hash, votes: idea.ideaVote|length })) }} {% endif %} {% if gift.vUser.id == vUser.id %} {% if not interval.invert %} {% if idea.chosen == 0 %} {{ render(controller('AppBundle:ImnuuIdea:chooseIdeaFormPartial', { giftId: gift.id, ideaId: idea.id })) }} {% else %} {{ render(controller('AppBundle:ImnuuIdea:unchooseIdeaFormPartial', { giftId: gift.id, ideaId: idea.id })) }} {% endif %} {% else %} {% if idea.chosen > 0 %} {{ chosen_icon|raw }} {% endif %} {% endif %} {% else %} {% if idea.chosen > 0 %} {{ chosen_icon|raw }} {% endif %} {% endif %}
Idea from: {{ idea.invitation.vUser.user is empty ? is_granted("IS_AUTHENTICATED_REMEMBERED") ? idea.invitation.vUser.email : idea.invitation.hash == app.request.get('hash') ? idea.invitation.vUser.email : idea.invitation.vUser.email|obfuscate_email : idea.invitation.vUser.user.username }}
{% endif %}
{% else %}
{% include 'partials/_alert.html.twig' %}
{% endif %}