@extends('hello')

@section('content')
    <div class="container" style="margin-top: 40px;">
        <div class="row">
            <div class="col-md-2">
                <ul class="nav nav-pills nav-stacked">
                    <li class="active"><a href="#avatar" data-toggle="pill">Avatar</a></li>
                    <li><a href="#password" data-toggle="pill">Passwort</a></li>
                    <li><a href="#email" data-toggle="pill">E-Mail</a></li>
                </ul>
            </div>
            <div class="col-md-8 tab-content">
                <div class="tab-pane active" id="avatar">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h2 class="panel-title">Avatar</h2>
                        </div>
                        <div class="panel-body">
                            <div class="media media-left">
                                <a href="#"><img class="media-object" src="{{ Auth::user()->getAvatar() }}" width="64"></a>
                            </div>
                            <div class="media-body">
                                <h4 class="media-heading">Aktueller Avatar</h4>
                                Du kannst unten einen neuen Avatar hochladen oder den Avatar zurücksetzen.
                            </div>
                            <p>
                                {{ Form::open(array('url' => 'settings/avatar-upload', 'files' => true)) }}
                                {{ $errors->first() }}
                                {{ Form::file('avatar'); }}
                                    <button type="submit" class="btn btn-primary">Absenden</button>
                                {{ Form::close() }}
                            </p>
                            <p>
                                {{ Form::open(array('url' => 'settings/avatar-reset')) }}
                                <button type="submit" class="btn btn-danger">Avatar zurücksetzen</button>
                                {{ Form::close() }}
                            </p>
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="password">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2 class="panel-title">Passwort ändern</h2></div>
                        <div class="panel-body">
                            {{ Form::open(array('url' => 'settings/password')) }}
                            {{ $errors->first() }}
                            <div class="input-group form-group <?php if ($errors->has('oldpw')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-lock"></span>
							</span>
                                <input type="password" class="form-control" name="oldpw" placeholder="Altes Passwort">
                            </div>
                            <div class="input-group form-group <?php if ($errors->has('newpw')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-lock"></span>
							</span>
                                <input type="password" class="form-control" name="newpw" placeholder="Neues Passwort">
                            </div>
                            <div class="input-group form-group <?php if ($errors->has('newpw')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-lock"></span>
							</span>
                                <input type="password" class="form-control" name="newpw2"
                                       placeholder="Neues Passwort bestätigen">
                            </div>
                            <button type="submit" class="btn btn-primary">Absenden</button>
                            {{ Form::close() }}
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="email">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2 class="panel-title">E-Mail ändern</h2></div>
                        <div class="panel-body">
                            <dl class="dl-horizontal">
                                <dt>Aktuelle E-Mail</dt>
                                <dd>{{Auth::user()->email}}</dd>
                            </dl>
                            {{ Form::open(array('url' => 'settings/email')) }}
                            <div class="input-group form-group <?php if ($errors->has('pw')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-lock"></span>
							</span>
                                <input type="password" class="form-control" name="pw" placeholder="Passwort">
                            </div>
                            <div class="input-group form-group <?php if ($errors->has('email')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-envelope"></span>
							</span>
                                <input type="email" class="form-control" name="email" placeholder="Neue E-Mail">
                            </div>
                            <div class="input-group form-group <?php if ($errors->has('email')) echo "has-error" ?>">
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-envelope"></span>
							</span>
                                <input type="email" class="form-control" name="email2"
                                       placeholder="Neue E-Mail bestätigen">
                            </div>
                            <button type="submit" class="btn btn-primary">Absenden</button>
                            {{ Form::close() }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop

@section('title')
    Einstellungen ~
@stop
