{% extends 'MDS/EventsBundle/base-events.html.twig' %}
{% block pagetitleinterno %}
<div class="page-title">
<h4><i class="icon-calendar3 position-left"></i> <span class="text-semibold">{% trans %}Events{% endtrans %}</span> - {% trans %}Proposal{% endtrans %}</h4>
</div>
{% endblock %}
{% block breadcrumbs %}
<ul class="breadcrumb">
<li><a href="/"><i class="icon-home2 position-left"></i>{% trans %}Home{% endtrans %}</a></li>
<li><a href="/events/proposal/list"><i class="icon-calendar3 position-left"></i>{% trans %}Proposal List{% endtrans %}</a></li>
<li><a href="/events/proposal/edit/{{ id }}"><i class="icon-calendar3 position-left"></i>{% trans %}Proposal{% endtrans %}</a></li>
<li class="active"><i class="icon-file-text2 position-left"></i>{% trans %}Destination Proposal{% endtrans %}</li>
</ul>
{% endblock %}
{% block contentProposal %}
{% for flashMessage in app.session.flashbag.get('mensajeproposaldestination') %}
<div class="hidden alertFlashMensaje" data-mensaje="{{ flashMessage }}"></div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('mensajeproposaldestinationerror') %}
<div class="hidden alertFlashMensajeError" data-mensajeerror="{{ flashMessage }}"></div>
{% endfor %}
<div class="row proposals" id="">
<div class="row">
{% if destinations is not empty %}
{% for key, destination in destinations %}
{% if destination.disabledPresentation == '0' %}
{% set boton_disable_presentation = "<i class='icon-display text-success-800'></i>" %}
{% set mensaje_disable_presentation = "Disabled Destination presentation"|trans %}
{% else %}
{% set boton_disable_presentation = "<i class='icon-display text-danger-800'></i>" %}
{% set mensaje_disable_presentation = "Activated Destination resentation"|trans %}
{% endif %}
{% if destination.disabled == '0' %}
{% set boton_disable = "<i class='icon-switch text-success-800'></i>" %}
{% set mensaje_disable = "Disabled Destination"|trans %}
{% else %}
{% set boton_disable = "<i class='icon-switch text-danger-800'></i>" %}
{% set mensaje_disable = "Activated Destination"|trans %}
{% endif %}
{% set boton_play = "<i class='icon-play3 text-success-800'></i>" %}
<div class="col-sm-4">
<div class="panel">
<div class="panel-heading bg-green">
<h5 class="panel-title text-center"><b>{{ destination.title }}</b></h5>
<div class="heading-elements">
<ul class="icons-list">
<li>
<a class="sweet_warning text-white" href="/events/proposal/destination/deleted/{{ destination.idcontrol }}"><i class="icon-trash"></i></a>
</li>
</ul>
</div>
</div>
<div class="panel-body">
<div class="col-sm-7 text-center">
<h5>
<i class="icon-checkmark2 position-left"></i>{% trans %}Country{% endtrans %}: <b>{{ destination.country }}</b><br>
<i class="icon-checkmark2 position-left"></i>{% trans %}Province{% endtrans %}: <b>{{ destination.province }}</b><br>
<i class="icon-checkmark2 position-left"></i>{% trans %}Population{% endtrans %}: <b>{{ destination.population }}</b>
</h5>
</div>
<div class="col-sm-5">
{% if destination.image is not null %}
<div class="thumbnail">
<div class="thumb">
<img class="img-responsive" src="/assets/images/destinations/gallery/{{ destination.image }}" alt="">
</div>
</div>
{% endif %}
</div>
</div>
<div class="panel-footer">
<div class="col-sm-1"></div>
<div class="col-sm-11 text-left" style="padding-top: 5px">
<a type="button" data-popup="tooltip-custom" title="{{ mensaje_disable }}" class="btn btn-default" href="/events/proposal/destination/services/add/{{ destination.idcontrol }}">{% autoescape %}{{ boton_play|raw }}{% endautoescape %}
<label class="text-green-800 btn" style="min-width: 200px;">{% trans %}Add Suppliers and Services{% endtrans %}</label></a>
</div>
<div class="col-sm-12"><hr/></div>
<div class="col-sm-1"></div>
<div class="col-sm-11 text-left">
<a type="button" data-popup="tooltip-custom" title="{{ mensaje_disable_presentation }}" class="btn btn-default" href="/events/proposal/destination/disabledpresentation/{{ destination.idcontrol }}">{% autoescape %}{{ boton_disable_presentation|raw }}{% endautoescape %}
<label class="text-green-800 btn" style="min-width: 200px;">{% trans %}Activate/Deactivate Presentation{% endtrans %}</label></a>
</div>
<div class="col-sm-1"></div>
<div class="col-sm-11 text-left" style="padding-top: 5px">
<a type="button" data-popup="tooltip-custom" title="{{ mensaje_disable }}" class="btn btn-default" href="/events/proposal/destination/disabled/{{ destination.idcontrol }}">{% autoescape %}{{ boton_disable|raw }}{% endautoescape %}
<label class="text-green-800 btn" style="min-width: 210px;">{% trans %}Activate/Deactivate Destination{% endtrans %}</label></a>
</div>
<div class="col-sm-12"><hr/></div>
<div class="col-sm-1"></div>
<form name="destination_proposal_duplicate" method="post" action="/events/proposal/duplicatedestination/{{ id }}/{{ destinations[key].idcontrol }}">
<div class="col-sm-10 text-left" style="padding-top: 5px">
{#<a type="button" type="submit" data-popup="tooltip-custom" title="{{ mensaje_disable }}" class="btn btn-default">{% autoescape %}{{ boton_play|raw }}{% endautoescape %}#}
{#<label class="text-green-800 btn" style="min-width: 200px;">{% trans %}Duplicar en Otro Destino{% endtrans %}</label>#}
{#</a>#}
<select class="form-control col-xs-12" name="destinationList" id="destinationList">
<option value="">{% trans %}Select{% endtrans %}</option>
{#<option value="1">1</option>#}
{#<option value="2">2</option>#}
{% for destination in destinationList %}
<option value="{{ destination.id }}">{{ destination.title }}</option>
{% endfor %}
</select>
<div class="col-sm-10 text-left">
<br>
</div>
<button type="submit" name="save" class="btn btn-success btn-block text-white font-weight-bold">{% trans %}Duplicar en Otro Destino{% endtrans %}</button>
<div class="col-sm-12">
<br>
</div>
</div>
</form>
<div class="col-sm-12"><hr/></div>
<div class="col-sm-1"></div>
<div class="col-sm-10 text-left" style="padding-top: 5px">
<a class="btn bg-success btn-block" href="/events/proposal/destination/editdstsuppliers/{{ destination.idcontrol }}">{% trans %}Modificar Proveedores del Destino{% endtrans %}</a>
</div>
<div class="col-sm-12">
<br>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
<div class="col-sm-12">
{{ form_start(form, { 'attr' : {'class': 'form-horizontal', 'novalidate': 'novalidate', 'role' : 'form', 'autocomplete': 'off'}}) }}
<div class="panel">
{{ form_widget(form.proposalId, { 'attr' : {'class' : 'form-control hidden' } }) }}
<div class="panel-heading border-info">
<h6 class="panel-title">{% trans %}Add Destination Proposals{% endtrans %}<a class="heading-elements-toggle"><i class="icon-more"></i></a></h6>
</div>
<div class="panel-body">
<div class="col-md-9" style="padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material{% if form_errors(form.destinationId)|length > 0 %} has-error{% endif %}">
<label class="control-label is-visible">
{{ form_label(form.destinationId, 'Destination Title', {'label_attr': {'class': 'control-label is-visible'}}) }}
</label>
{{ form_widget(form.destinationId, { 'attr' : {'class' : 'form-control', 'placeholder' : 'Name'} }) }}
<span class="help-block">{{ form_errors(form.destinationId) }}</span>
</div>
</div>
<div class="col-md-3" style="padding-top: 35px; padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material">
{{ form_widget(form.save, {'label' : 'Load Destination', 'attr': {'class': 'btn btn-info btn-block'}}) }}
</div>
</div>
</div>
</div>
{{ form_end(form) }}
{#<form name="destination_proposal_add" method="post" action="/">#}
{#<div class="col-sm-10 text-left" style="padding-top: 5px">#}
{#<button type="submit" name="save" class="btn btn-success btn-block text-white font-weight-bold">{% trans %}Destino{% endtrans %}</button>#}
{#<select class="form-control col-xs-12" name="proposalcontrol_destinationId2" id="proposalcontrol_destinationId2">#}
{#<option value="none">{% trans %}Select{% endtrans %}</option>#}
{#{% for destination in destinationList %}#}
{#<option value="{{ destination.id }}">{{ destination.title }}</option>#}
{#{% endfor %}#}
{#</select>#}
{#</div>#}
{#</form>#}
</div>
<div class="col-sm-12">
<div class="panel">
<div class="panel-heading border-orange">
<h6 class="panel-title">{% trans %}Proposals Briefing{% endtrans %}</h6>
</div>
<div class="panel-body">
{% if briefing is not null and briefing is not empty%}
<div class="col-md-12 margen-20">
<table class="margen-10" style="width: 100%">
<tr class="bg-grey-300">
<td class="text-center" style="width: 10%">{% trans %}User{% endtrans %}</td>
<td class="text-center" style="width: 20%">{% trans %}Date{% endtrans %}</td>
<td class="" style="width: 70%">{% trans %}Briefing{% endtrans %}</td>
</tr>
{% set contador = 1 %}
{% for element in briefing %}
<tr class="margen-15" {% if contador % 2 == 0 %} style="background: #abfdd5" {% endif %}>
<td class="text-center" style="width: 10%">
{{ element.userName }}
</td>
<td class="text-center" style="width: 20%">
{{ element.addedAt|date ("d/m/Y H:i:s") }}
</td>
<td style="width: 20%">
{% autoescape %}
{{ element.briefing|raw }}
{% endautoescape %}
</td>
</tr>
{% set contador = contador + 1 %}
{% endfor %}
</table>
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel">
<div class="panel-heading border-orange">
<h6 class="panel-title">{% trans %}Observation Proposals{% endtrans %}</h6>
</div>
<div class="panel-body">
<div class="col-sm-12">
{% autoescape %}
{{ proposal.observation|raw }}
{% endautoescape %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('assets/js/plugins/editors/summernote/summernote.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/styling/switchery.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/proposal/add-proposal.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/selects/select2.min.js') }}"></script>
<script type="application/javascript">
$("select#proposalcontrol_destinationId").select2();
$("select#destinationList").select2();
</script>
{% endblock %}