<style>
    .etroit { width: 80px !important; }
    .large { width: 250px !important; }

    .custom-map-control-button {
        appearance: button;
        background-color: #fff;
        border: 0;
        border-radius: 2px;
        box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        margin: 10px;
        padding: 0 0.5em;
        height: 40px;
        font: 400 18px Roboto, Arial, sans-serif;
        overflow: hidden;
    }
    .custom-map-control-button:hover {
        background: #ebebeb;
    }

    .locationMap {
        height:600px;
        width:100%;
        margin-top: 20px;
    }

    .city-remove {
        height: 30px !important;
    }

    .pin {
        height: 25px;
        margin-left: 12px;
    }

    .legende {
        margin-top: 25px;
        text-align: center;
        font-style: italic;
    }

</style>

{form name='pdr-place-main-update'}
<div class="form-container">

    {if $form_error}
    <div class="alert alert-danger">{$form_error_message}</div>
    {/if}

    {loop name="places" type="pdr_places" id="$place_id"}
    <form action="{url path='/admin/module/PointRetrait/edit' place_id={$place_id}}" method="POST" class="clearfix"  {form_enctype form=$form}>
        {form_hidden_fields form=$form}

        {include
        file = "includes/inner-form-toolbar.html"
        hide_flags = true
        hide_submit_buttons = false
        page_url     = "{url path='/admin/module/PointRetrait/edit' place_id=$place_id}"
        close_url    = "{url path='/admin/module/PointRetrait'}"
        current_tab = "main"
        }

        {form_field form=$form field="place_id"}
        <input type="hidden" name="{$name}" value="{$place_id}"/>
        {/form_field}

        <div class="row form-inline">

            <div class="row">
                <div class="col-md-3">
                    {form_field form=$form field="title"}
                    <div class="form-group">
                        <label class="control-label" for="{$label_attr.for}">
                            {intl l=$label d='pointretrait'}
                        </label>
                        <input type="text" id="{$label_attr.for}" class="form-control large" name="{$name}" value="{$TITLE}" {if $required}required{/if} />&nbsp
                    </div>
                    {form_error form=$form field="title"}{$message}{/form_error}
                    {/form_field}
                </div>

                <div class="col-md-2">
                    {form_field form=$form field="active"}
                    <div class="form-group">
                        <label class="control-label" for="{$label_attr.for}">
                            {intl l=$label d="pointretrait"}
                        </label>

                        <div class="make-switch switch-small toggle-active" data-id="{$ID}" data-on="success"
                             data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>"
                             data-off-label="<i class='glyphicon glyphicon-remove'></i>">
                            <input type="checkbox" class="link" {if $ACTIVE == 1}checked="checked"{/if}>
                        </div>
                        <input type="hidden" id="{$label_attr.for}" name="{$name}" value="{$ACTIVE}"/>
                    </div>
                    {/form_field}
                </div>

                <div class="col-md-2">
                    {form_field form=$form field="price"}
                    <div class="form-group form-inline">
                        <label class="control-label" for="{$label_attr.for}">
                            {intl l=$label d="pointretrait"}
                            {if $required}<span class="required">*</span>{/if}
                        </label>

                        <input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$PRICE}" {if $required}required{/if} />&nbsp;€
                    </div>
                    {form_error form=$form field="price"}{$message}{/form_error}
                    {/form_field}
                </div>

                <div class="col-md-3">
                    {form_field form=$form field="minimum_amount"}
                    <div class="form-group form-inline">
                        <label class="control-label" for="{$label_attr.for}">
                            {intl l=$label d="pointretrait"}
                            {if $required}<span class="required">*</span>{/if}
                        </label>

                        <input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$MINIMUM_AMOUNT}" {if $required}required{/if} />&nbsp;€
                    </div>
                    {form_error form=$form field="minimum_amount"}{$message}{/form_error}
                    {/form_field}
                </div>

                <div class="col-md-2">
                    {form_field form=$form field="latitude"}
                    <input type="hidden" value="{$LATITUDE}" id="{$label_attr.for}" name="{$name}">
                    {/form_field}
                    {form_field form=$form field="longitude"}
                    <input type="hidden" value="{$LONGITUDE}" id="{$label_attr.for}" name="{$name}">
                    {/form_field}
                </div>

            </div>

            <div class="row">
                <div class="col-md-12">
                    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBb07YA_unrh5w821I1xHxbeYb5KCF_WaM&callback=initMap&libraries=&v=weekly" async></script>
                    <div id="map" class="locationMap"></div>
                </div>
            </div>

        </div>
    </form>
    {/loop}
</div>
{/form}
