{'!Profile' | snippet : ['prefix' => 'usr.']}
{'!UpdateProfile' | snippet : [
    'validate' => 'fullname:required',
    'preHooks'=> 'loadUserPhoto'
]}
<div id="content">
    <div class="container" style="width: auto; max-width: 1170px;">
        <div class="row" style="margin-left: 0px; margin-right: 0px;">
            <div class="col-md-12 col-lg-12">
                <div style="border: 1px solid #e7e7e7; border-radius: 6px;" class="row">
                    <div class="panel panel-primary">
                        <div class="panel-heading">Редактирование данных</div>
                        <div class="col-md-8 col-lg-12">
                            <div class="panel-body" style="background-image: none;padding-left: 0px;padding-right: 0px;">
                                <div class="col-md-6 col-lg-4">
                                    <div class="updprof-error">[[+error.message]]</div>
                                    [[+login.update_success:is=`1`:then=`[[%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]
                                    <form id="updateProfile" action="[[~[[*id]]]]" method="post" class="form-horizontal" enctype="multipart/form-data">
                                        <input type="hidden" name="nospam" value="">
                                        <!-- Блок, содержащий фото и имя пользователя -->
                                        <div id="crop" class="img-rounded center-block" style="height: 100px; width: 100px; overflow: hidden;">
                                            <img id="img-photo" style="height: 100px; width: 100px;" src="[[+photo]]">
                                        </div>
                                        <p class="lead text-center">[[+fullname]]</p>
                                        <hr>
                                </div>
                                <div class="col-md-6 col-lg-8">
                                    <div class="form-group">
                                        <label for="fullname" class="col-sm-4 control-label">[[!%login.fullname? &namespace=`login` &topic=`updateprofile`]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="fullname" class="form-control" id="fullname" value="[[+fullname]]">
                                            <span class="help-block text-error">
                                                [[+error.fullname]]
                                            </span>
                                        </div>
                                    </div>
                                    <!-- Input для загрузки фото пользователя -->
                                    <div class="form-group">
                                        <label for="photo" class="col-sm-4 control-label" style="padding-top: 0px; padding-bottom: 6px;">Фото</label>
                                        <div class="col-sm-8" style="padding-top: 0px; padding-bottom: 6px;">
                                            <input type="file" id="photo" name="photo" value="[[+photo]]">
                                            <span id="img-error" class="help-block text-error"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="mobilephone" class="col-sm-4 control-label">[[!%login.mobilephone]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="mobilephone" class="form-control" id="mobilephone" value="[[+mobilephone]]">
                                            <span class="help-block text-error">
                                                [[+error.mobilephone]]
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6 col-lg-12">
                                    <div class="form-group">
                                        <label for="phone" class="col-sm-4 control-label">Дополнительный номер</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="phone" class="form-control" id="phone" value="[[+phone]]">
                                            <span class="help-block text-error">
                                                [[+error.phone]]
                                            </span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="address" class="col-sm-4 control-label">[[!%login.address]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="address" class="form-control" id="address" value="[[+address]]">
                                            <span class="help-block text-error">
                                                [[+error.address]]
                                            </span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="country" class="col-sm-4 control-label">[[!%login.country]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="country" class="form-control" id="country" value="[[+country]]">
                                            <span class="help-block text-error">
                                                [[+error.country]]
                                            </span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="city" class="col-sm-4 control-label">[[!%login.city]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="city" class="form-control" id="city" value="[[+city]]">
                                            <span class="help-block text-error">
                                                [[+error.city]]
                                            </span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="website" class="col-sm-4 control-label">[[!%login.website]]</label>
                                        <div class="col-sm-8">
                                            <input type="text" name="website" class="form-control" id="website" value="[[+website]]">
                                            <span class="help-block text-error">
                                                [[+error.website]]
                                            </span>
                                        </div>
                                    </div>
                                    <!-- Кнопка "Удалить фото" -->
                                    <input type="submit" value="Удалить фото" name="delete-photo-btn" id="login-updprof-btn" class="btn btn-primary pull-left">
                                    <!-- Кнопка "Обновить данные" -->
                                    <input type="submit" value="Обновить данные" name="login-updprof-btn" id="login-updprof-btn" class="btn btn-primary pull-right">
                                    <input type="button" value="Отмена" class="btn btn-primary pull-right" onclick="location.href='/profile/';" style="margin-right: 10px;width: 139px;">

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .navbar-collapse.collapse{
        display: block!important;
        margin-top: 0px !important;
        border: none;
    }
</style>
