Fixes #36
This commit is contained in:
@@ -5,6 +5,7 @@ use Input;
|
||||
use Redirect;
|
||||
use Sentry;
|
||||
use Validator;
|
||||
use Location;
|
||||
use View;
|
||||
|
||||
class ProfileController extends AuthorizedController {
|
||||
@@ -20,7 +21,11 @@ class ProfileController extends AuthorizedController {
|
||||
$user = Sentry::getUser();
|
||||
|
||||
// Show the page
|
||||
return View::make('frontend/account/profile', compact('user'));
|
||||
|
||||
$location_list = array('' => 'Select One') + Location::lists('name', 'id');
|
||||
|
||||
// Show the page
|
||||
return View::make('frontend/account/profile', compact('user'))->with('location_list',$location_list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,6 +39,7 @@ class ProfileController extends AuthorizedController {
|
||||
$rules = array(
|
||||
'first_name' => 'required|min:3',
|
||||
'last_name' => 'required|min:3',
|
||||
'location_id' => 'required',
|
||||
'website' => 'url',
|
||||
'gravatar' => 'email',
|
||||
);
|
||||
@@ -55,7 +61,7 @@ class ProfileController extends AuthorizedController {
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->website = Input::get('website');
|
||||
$user->country = Input::get('country');
|
||||
$user->location_id = Input::get('location_id');
|
||||
$user->gravatar = Input::get('gravatar');
|
||||
$user->save();
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ Update User {{ $user->fullName() }} ::
|
||||
|
||||
<button type="reset" class="btn">Reset</button>
|
||||
|
||||
<button type="submit" class="btn-flat success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
<button type="submit" class="btn btn-success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -7,10 +7,15 @@ Change your Email
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('account-content')
|
||||
<div class="page-header">
|
||||
<h4>Change your Email</h4>
|
||||
<div class="row header">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3>Change Your Email</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-wrapper">
|
||||
|
||||
<form method="post" action="" class="form-horizontal" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
@@ -19,32 +24,32 @@ Change your Email
|
||||
<input type="hidden" name="formType" value="change-email" />
|
||||
|
||||
<!-- New Email -->
|
||||
<div class="form-group{{ $errors->first('email', ' error') }}">
|
||||
<label class="control-label" for="email">New Email</label>
|
||||
<div class="controls">
|
||||
<input type="email" name="email" id="email" value="" />
|
||||
{{ $errors->first('email', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('email') ? ' has-error' : '' }}">
|
||||
<label for="email" class="col-md-2 control-label">New Email</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="email" name="email" id="email" value="{{ Input::old('email', $user->email) }}" />
|
||||
{{ $errors->first('email', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Confirm New Email -->
|
||||
<div class="form-group{{ $errors->first('email_confirm', ' error') }}">
|
||||
<label class="control-label" for="email_confirm">Confirm New Email</label>
|
||||
<div class="controls">
|
||||
<input type="email" name="email_confirm" id="email_confirm" value="" />
|
||||
{{ $errors->first('email_confirm', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('email_confirm') ? ' has-error' : '' }}">
|
||||
<label for="email_confirm" class="col-md-2 control-label">New Email</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="email" name="email_confirm" id="email_confirm" />
|
||||
{{ $errors->first('email_confirm', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Current Password -->
|
||||
<div class="form-group{{ $errors->first('current_password', ' error') }}">
|
||||
<label class="control-label" for="current_password">Current Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="current_password" id="current_password" value="" />
|
||||
{{ $errors->first('current_password', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('current_password') ? ' has-error' : '' }}">
|
||||
<label for="current_password" class="col-md-2 control-label">Current Password</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="password" name="current_password" id="current_password" />
|
||||
{{ $errors->first('current_password', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- Form actions -->
|
||||
|
||||
@@ -7,36 +7,41 @@ Change your Password
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('account-content')
|
||||
<div class="page-header">
|
||||
<h4>Change your Password</h4>
|
||||
<div class="row header">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3>Change Your Password</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-wrapper">
|
||||
<form method="post" action="" class="form-horizontal" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<!-- Old Password -->
|
||||
<div class="form-group{{ $errors->first('old_password', ' error') }}">
|
||||
<label class="control-label" for="old_password">Old Password</label>
|
||||
<input type="password" name="old_password" id="old_password" class="form-control" value="" />
|
||||
{{ $errors->first('old_password', '<span class="help-block">:message</span>') }}
|
||||
</div>
|
||||
|
||||
<!-- New Password -->
|
||||
<div class="form-group{{ $errors->first('password', ' error') }}">
|
||||
<label class="control-label" for="password">New Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password" id="password" class="form-control" value="" />
|
||||
{{ $errors->first('password', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('old_password') ? ' has-error' : '' }}">
|
||||
<label for="old_password" class="col-md-2 control-label">Old Password</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text" name="old_password" id="old_password" />
|
||||
{{ $errors->first('old_password', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Confirm New Password -->
|
||||
<div class="form-group{{ $errors->first('password_confirm', ' error') }}">
|
||||
<label class="control-label" for="password_confirm">Confirm New Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password_confirm" id="password_confirm" class="form-control" value="" />
|
||||
{{ $errors->first('password_confirm', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label for="password" class="col-md-2 control-label">New Password</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="password" name="password" id="password" />
|
||||
{{ $errors->first('password', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group {{ $errors->has('password_confirm') ? ' has-error' : '' }}">
|
||||
<label for="password_confirm" class="col-md-2 control-label">New Password</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="password" name="password_confirm" id="password_confirm" />
|
||||
{{ $errors->first('password_confirm', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -102,14 +107,15 @@ Change your Password
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form actions -->
|
||||
<!-- Form Actions -->
|
||||
<div class="form-group">
|
||||
<div class="controls">
|
||||
<a class="btn" href="{{ route('home') }}">Cancel</a>
|
||||
|
||||
<button type="submit" class="btn btn-info">Update</button>
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-7">
|
||||
<a class="btn btn-link" href="{{ route('home') }}">@lang('general.cancel')</a>
|
||||
<button type="submit" class="btn btn-success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,71 +7,80 @@ Your Profile
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('account-content')
|
||||
<div class="page-header">
|
||||
<h4>Update your Profile</h4>
|
||||
<div class="row header">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3>Update Profile</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="" class="form-vertical" autocomplete="off">
|
||||
<div class="row form-wrapper">
|
||||
|
||||
<form method="post" class="form-horizontal" action="" class="form-vertical" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<!-- First Name -->
|
||||
<div class="form-group{{ $errors->first('first_name', ' error') }}">
|
||||
<label class="control-label" for="first_name">First Name</label>
|
||||
<div class="controls">
|
||||
<input class="col-md-4" type="text" name="first_name" id="first_name" value="{{ Input::old('first_name', $user->first_name) }}" />
|
||||
{{ $errors->first('first_name', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('first_name') ? ' has-error' : '' }}">
|
||||
<label for="first_name" class="col-md-2 control-label">First Name</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ Input::old('first_name', $user->first_name) }}" />
|
||||
{{ $errors->first('first_name', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Last Name -->
|
||||
<div class="form-group{{ $errors->first('last_name', ' error') }}">
|
||||
<label class="control-label" for="last_name">Last Name</label>
|
||||
<div class="controls">
|
||||
<input class="col-md-4" type="text" name="last_name" id="last_name" value="{{ Input::old('last_name', $user->last_name) }}" />
|
||||
{{ $errors->first('last_name', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('last_name') ? ' has-error' : '' }}">
|
||||
<label for="last_name" class="col-md-2 control-label">Last Name</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text" name="last_name" id="last_name" value="{{ Input::old('last_name', $user->last_name) }}" />
|
||||
{{ $errors->first('last_name', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Website URL -->
|
||||
<div class="form-group{{ $errors->first('website', ' error') }}">
|
||||
<label class="control-label" for="website">Website URL</label>
|
||||
<div class="controls">
|
||||
<input class="col-md-4" type="text" name="website" id="website" value="{{ Input::old('website', $user->website) }}" />
|
||||
{{ $errors->first('website', '<span class="help-block">:message</span>') }}
|
||||
<div class="form-group {{ $errors->has('website') ? ' has-error' : '' }}">
|
||||
<label for="website" class="col-md-2 control-label">Website</label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text" name="website" id="website" value="{{ Input::old('website', $user->website) }}" />
|
||||
{{ $errors->first('website', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Country -->
|
||||
<div class="form-group{{ $errors->first('country', ' error') }}">
|
||||
<label class="control-label" for="country">Country</label>
|
||||
<div class="controls">
|
||||
<input class="col-md-4" type="text" name="country" id="country" value="{{ Input::old('country', $user->country) }}" />
|
||||
{{ $errors->first('country', '<span class="help-block">:message</span>') }}
|
||||
<!-- Location -->
|
||||
<div class="form-group {{ $errors->has('phone') ? 'error' : '' }}">
|
||||
<label class="col-md-2 control-label" for="location_id">Location</label>
|
||||
<div class="col-md-5">
|
||||
<div class="field-box">
|
||||
{{ Form::select('location_id', $location_list , Input::old('location_id', $user->location_id), array('class'=>'select2', 'style'=>'width:300px')) }}
|
||||
{{ $errors->first('location_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Gravatar Email -->
|
||||
<div class="form-group{{ $errors->first('gravatar', ' error') }}">
|
||||
<label class="control-label" for="gravatar">Gravatar Email <small>(Private)</small></label>
|
||||
<div class="controls">
|
||||
<input class="col-md-4" type="text" name="gravatar" id="gravatar" value="{{ Input::old('gravatar', $user->gravatar) }}" />
|
||||
{{ $errors->first('gravatar', '<span class="help-block">:message</span>') }}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<img src="//secure.gravatar.com/avatar/{{ md5(strtolower(trim($user->gravatar))) }}" width="30" height="30" />
|
||||
<a href="http://gravatar.com">Change your avatar at Gravatar.com</a>.
|
||||
<div class="form-group {{ $errors->has('gravatar') ? ' has-error' : '' }}">
|
||||
<label for="gravatar" class="col-md-2 control-label">Gravatar Email <small>(Private)</small></label>
|
||||
<div class="col-md-5">
|
||||
<input class="form-control" type="text" name="gravatar" id="gravatar" value="{{ Input::old('gravatar', $user->gravatar) }}" />
|
||||
{{ $errors->first('gravatar', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
<p><img src="//secure.gravatar.com/avatar/{{ md5(strtolower(trim($user->gravatar))) }}" width="30" height="30" />
|
||||
<a href="http://gravatar.com"><small>Change your avatar at Gravatar.com</small></a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- Form actions -->
|
||||
<div class="form-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn">Update your Profile</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-7">
|
||||
<a class="btn btn-link" href="{{ route('home') }}">@lang('general.cancel')</a>
|
||||
<button type="submit" class="btn btn-success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Main Menu</li>
|
||||
<li{{ Request::is('account/profile') ? ' class="active"' : '' }}><a href="{{ URL::route('profile') }}">Profile</a></li>
|
||||
<li{{ Request::is('account/change-password') ? ' class="active"' : '' }}><a href="{{ URL::route('change-password') }}">Change Password</a></li>
|
||||
<li{{ Request::is('account/change-email') ? ' class="active"' : '' }}><a href="{{ URL::route('change-email') }}">Change Email</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
Reference in New Issue
Block a user