settings.blade.php 6.58 KB
@inject('webpackAssets', 'FootyRoom\Support\WebpackAssets')

@extends('layouts.profile')

@section('title', 'Profile Settings')

@section('profileLeftColumn')
	<div id="plc">
		<div class="plc-wrap text-center">
			<div class="photo-box">
				<img id="profileImage" src="{{ $avatar . '?' . time() }}">
				@if ($isVisitorProfile)
					<center>
						<div id="changePhoto">
							<form id="changePhotoForm" method="post" action="/profile/settings/upload-avatar" enctype="multipart/form-data">
								<input type="hidden" name="_csrf_token" value="{{ FootyRoom\Support\Utils\Helpers::csrfToken() }}">
								<div id="changePhotoContainer">
									<a id="changePhoto_label" class="btn btn-primary">change photo</a>
									<input type="file" name="avatar" id="inputChangePhoto">
								</div>
							</form>
						</div>
					</center>
				@endif
			</div>
		</div>
	</div>
@endsection

@section('profile')
	<div ng-controller="ProfileSettingsController"
	ng-init="user = { nationalTeam: '{{ $nationalTeam }}', clubTeam: '{{ $clubTeam }}' }">
		<div id="errorBox" class="error mb10 displayno">
			<ul>
				@if (isset($errors))
					@foreach ($errors as $error)
						{{ $error }}
					@endforeach
				@endif
			</ul>
		</div>

		@if ($isPasswordUpdated)
			<div class="success mb10">Your password has been updated successfully.</div>
		@endif
		
		<form action="/profile/settings" method="post" class="form-horizontal settings" name="userForm" ng-submit="submitForm($event)" novalidate>
			<input type="hidden" name="_csrf_token" value="{{ FootyRoom\Support\Utils\Helpers::csrfToken() }}">
			<div class="form-group">
				<label class="col-xs-3 control-label">Full Name</label>
				<div class="col-xs-9 col-md-6">
					<input type="text" name="fullname" value="{{ $fullname }}" class="form-control">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-xs-3 control-label">Birthday</label>
				
				<div class="col-xs-9 col-md-8">
					{!! FootyRoom\Support\Utils\Helpers::dateSelect() !!}
				</div>
				
				<script>
				$("#dobDay option:econtains('{{ @$dobDay }}')").attr('selected','selected');
				$("#dobMonth option:contains('{{ @$dobMonth }}')").attr('selected','selected');
				$("#dobYear option:contains('{{ @$dobYear }}')").attr('selected','selected');
				</script>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">Gender </label>
				<div class="col-xs-9 col-md-6">
					<select id="gender" name="gender" class="form-control">
						<option>Unspecified</option>
						<option>Male</option>
						<option>Female</option>
						<option>Guy</option>
						<option>Girl</option>
						<option>Dude</option>
						<option>Chick</option>
					</select>
				</div>
				<script>$("#gender option:contains('{{ $gender }}')").attr('selected','selected');</script>
			</div>

			<hr>

			<div class="form-group" fr-has-error="userForm.clubTeam">
				<label class="col-xs-3 control-label">Club</label>
				<div class="col-xs-9 col-md-6">
					<div class="clearfix">
						<input id="clubTeam" ng-model="user.clubTeam" name="clubTeam" class="form-control" type="text" autocomplete="off" team-typeahead="club">
					</div>
					<p class="help-block if-has-error">You have to choose a team from the list or leave this field empty.</p>
				</div>
			</div>

			<div class="form-group" fr-has-error="userForm.nationalTeam">
				<label class="col-xs-3 control-label">Country</label>
				<div class="col-xs-9 col-md-6">
					<div class="clearfix">
						<input id="nationalTeam" ng-model="user.nationalTeam" name="nationalTeam" class="form-control" type="text" autocomplete="off" team-typeahead="national">
					</div>
					<p class="help-block if-has-error">You have to choose a team from the list or leave this field empty.</p>
				</div>
			</div>

			<hr>

			<div class="form-group" ng-cloak>
				<label class="col-xs-3 control-label">Facebook</label>
				<div class="col-xs-9 col-md-6">
					<div class="clearfix" ng-if="{{ ! @$isFacebookConnected }}">
						<label class="control-label">
							<b>Not connected:</b>
						</label>
						<a class="pointer" ng-click="fbConnect()">
							<b> Connect</b>
						</a>
					</div>
					<div class="clearfix" ng-if="{{ @$isFacebookConnected }}">
						<label class="control-label">
							<b>Connected:</b>
						</label>
						<a class="pointer" ng-click="fbDisconnect()">
							<b> Disconnect</b>
						</a>
					</div>
					<p class="help-block" ng-if="fbLoginError" ng-bind="fbLoginError" ng-cloak></p>
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">Location</label>
				<div class="col-xs-9 col-md-6">
					<input name="location" type="text" value="{{ $location }}" class="form-control">
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">Website URL</label>
				<div class="col-xs-9 col-md-6">
					<input name="website" type="text" value="{{ $website }}" class="form-control">
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">Bio/About</label>
				<div class="col-xs-9 col-md-6">
					<textarea cols="35" rows="3" name="bioAbout" class="form-control">{{ $bioAbout }}</textarea>
				</div>
			</div>

			<hr>

			<div class="form-group">
				<label class="col-xs-3 control-label">Current Password</label>
				<div class="col-xs-9 col-md-6">
					<input name="currentPassword" type="password" class="form-control">
				</div>
			</div>

			<div class="form-group" fr-has-error="userForm.newPassword">
				<label class="col-xs-3 control-label">New Password</label>
				<div class="col-xs-9 col-md-6">
					<input name="newPassword" type="password" ng-model="user.newPassword" class="form-control" ng-minlength="6">
					<p class="help-block">Minimum six characters.</p>
				</div>
			</div>

			<div class="form-group" fr-has-error="userForm.verifyPassword">
				<label class="col-xs-3 control-label">Verify Password</label>
				<div class="col-xs-9 col-md-6">
					<input name="verifyPassword" type="password" ng-model="user.verifyPassword" class="form-control">
					<p class="help-block if-has-error">Passwords don't match.</p>
				</div>
			</div>

			<hr>

			<div class="form-group">
				<div class="col-xs-offset-3 col-xs-9 col-md-6">
					<div class="checkbox">
						<label>
							<input type="checkbox" name="digest" {{ @$isSubscribedToDigest? 'checked' : '' }}> Subscribe to weekly digest. We'll email you the best content from FootyRoom once a week.
						</label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<div class="col-xs-9">
					<input type="submit" value="Save" class="btn btn-primary pull-right">
				</div>
			</div>
		</form>
	</div>
@endsection