@layout('layouts.main')

@section('content')
<?php 
$rules = array('first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|unique:users', 'birthdate' => 'required', 'password' => 'required|between:8,30');
echo Former::horizontal_open()->id('MyForm')->secure()->rules($rules)->method('POST');
?>
{{Former::token();}}
{{Former::text("first_name", 'user.first_name')->appendIcon('aw_user')}}
{{Former::text("last_name", 'user.last_name')->appendIcon('aw_group')}}
{{Former::text("email", "Email")->appendIcon('envelope')}}

<?php 
$fmt = new LocalizedDate(new DateTime(), null, IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
//dd($fmt->getPattern());
$jsfmt = $fmt->getDatepickerPattern();
echo $fmt->datepicker_format . '<br>';
//$fmt->setPattern($jsfmt);
$dpicker_attr = Bootstrapper\Datepicker::create('birthdate')->with_language(Session::get('language'))->with_options("startView:2, autoclose:1")->with_format($jsfmt)->with_date($fmt->getDatepickerDate())->get_attributes();
echo Former::append("birthdate", 'user.birth_date', $dpicker_attr['data-date'], $dpicker_attr)->with_labeled_icon('birthdate', 'icon-calendar');
?>
{{Former::hidden("birthdate_format", $fmt->getDatePattern())}}
{{Former::password("password", 'Password')->appendIcon('aw_key')}}
<?php 
echo \Former::actions(Former::primary_submit('Signup'), Former::reset('Reset'));
?>
{{Former::close()}}
@endsection

@section('addstyles')
{{ Asset::container('bootstrapper-datepicker')->styles() }}
@layout('layouts.main')
@section('content')
<?php 
//echo __('user.user_not_activated');
if ($errors->has('user_alert')) {
    $alert_message = $errors->first('user_alert');
    $alert_type = $errors->has('alert_type') ? $errors->first('alert_type') : Alert::INFO;
    echo Alert::show($alert_type, $alert_message)->block();
}
echo Former::horizontal_open()->id('resetPasswordForm')->secure()->rules(array('password' => 'required', 'repeat_password' => 'required|same:password'))->method('POST');
?>
{{Former::token();}}
{{Former::hidden("hash64", $hash64)}}
{{Former::password("password", "Password")->appendIcon('aw_key')}}
{{Former::password("repeat_password", "Repeat Password")->appendIcon('aw_key')}}
<?php 
echo \Former::actions(Former::primary_submit('Reset Password'));
?>
{{Former::close()}}
@endsection
@layout('layouts.main')
@section('content')
<?php 
//echo __('user.user_not_activated');
if ($errors->has('user_alert')) {
    $alert_message = $errors->first('user_alert');
    $alert_type = $errors->has('alert_type') ? $errors->first('alert_type') : Alert::INFO;
    echo Alert::show($alert_type, $alert_message)->block();
}
echo Former::horizontal_open()->id('MyForm')->secure()->rules(array('email' => 'required|email', 'password' => 'required'))->method('POST');
?>
{{Former::token();}}
{{Former::text("email", "Email")->appendIcon('envelope')}}
@if (isset($is_forgotten))
{{\Former::actions (Former::primary_submit('Reset Password'))}}
@else
{{Former::password("password", "Password")->appendIcon('aw_key')}}
<?php 
echo \Former::actions(Former::primary_submit('Login'), HTML::link('/login/forgotten', 'Forgot your password?', array('style' => 'padding:20px')));
?>
@endif
{{Former::close()}}
@endsection