<?php $__env->startSection('content'); ?>
<div class="headbar">
	<div class="container">
		<div class="row">
			<h2 class="col-xs-6" id="page-title"><?php echo $user->username; ?>'s Profile</h2>	
		</div>
	</div>
</div>
<div class="body">
	<div class="container">
		<div class="profile clearfix">
			<div class="menu pull-left">
				<ul class="nav nav-pills nav-stacked">
				  	<li class="active"><a href="<?php echo URL::to('profile'); ?>">Profile</a></li>
				  	<li><a href="<?php echo URL::to('my/questions'); ?>">Questions</a></li>
				  	<li><a href="<?php echo URL::to('my/answers'); ?>">Answers</a></li>
				  	<li><a href="<?php echo URL::to('my/favorites'); ?>">Favorites</a></li>
				</ul>
			
			</div>
			
			<div class="content pull-left">
				<div class="inner">
					<div class="block clearfix">
						<div class="profile-image pull-left">
							<img src="<?php echo Cauth::getAvatar(); ?>?<?php echo rand(4,9); ?>" alt="" class="img-thumbnail" />
							<a href="<?php echo URL::action('SettingsController@getPicture'); ?>">Change</a>
						</div>
						<div class="details">
							<h4><?php echo $user->fullname; ?> <span class="label label-default">Newbie</span>	 <a href="<?php echo URL::action('SettingsController@getUpdate'); ?>">Edit</a></h4>
							<?php if($user->location!=''): ?> <p class="location"><i class="fa fa-map-marker"></i> <?php echo $user->location; ?></p> <?php endif; ?>
							<?php if($user->website!=''): ?> <p class="levle"><a href="<?php echo $user->website; ?>" rel="nofollow" target="_blank"><?php echo $user->website; ?></a></p> <?php endif; ?>
							<p><a href="<?php echo URL::to('profile', $user->username); ?>">View public profile</a></p>
						</div>
					</div>
					<?php if($user->about!=''): ?>
					<div class="block">
						<h4>About me <a href="<?php echo URL::action('SettingsController@getUpdate'); ?>">Edit</a></h4>
						<p><?php echo $user->about; ?></p>
					</div>
					<?php endif; ?>
					<div class="block questions-content">
						<h4>My Latest Questions <?php if($questions->count() > 5): ?><a href="<?php echo URL::action('SettingsController@getUpdate'); ?>">View all</a><?php endif; ?></h4>
						<?php if(!$questions->isEmpty()): ?>
							<?php foreach($questions as $question): ?>
							<div class="item">
								<a href="<?php echo Link::to('question', $question->question_id); ?>">
									<span class="meta"><em>Asked</em> <?php echo Date::ago($question->created_at); ?> <em>ago</em> with <?php echo $question->answers()->count(); ?> answer(s).</span>
									<strong><?php echo $question->question; ?></strong><br />
									<small><?php echo $question->description; ?></small>
								</a>
							</div>
							<?php endforeach; ?>
						<?php else: ?>
						<p>No items yet.</p>
						<?php endif; ?>
					</div>
					<div class="block questions-content">
						<h4>My Latest Answers <?php if($answers->count() > 5): ?><a href="<?php echo URL::action('ProfileController@getSettings'); ?>">View all</a><?php endif; ?></h4>
						<?php if( !$answers->isEmpty() ): ?>
							<?php foreach($answers as $answer): ?>
							<div class="item">
								<a href="<?php echo Link::to('question', $answer->question->question_id); ?>#<?php echo $answer->answer_id; ?>">
									<span class="meta"><em>Answered</em> <?php echo Date::ago($answer->created_at); ?> <em>ago</em></span>
									<strong>Question:</strong> <?php echo $answer->question->question; ?><br />
									<strong>Answer:</strong> <?php echo $answer->answer; ?>
								</a>
							</div>
							<?php endforeach; ?>
						<?php else: ?>
						<p>No items yet.</p>
						<?php endif; ?>
					</div>
				</div>	
			</div>
			
			<div class="sidebar pull-left">
				<div class="inner">
					<div class="buttons">
						<a href="<?php echo URL::action('QuestionsController@getAsk'); ?>" class="btn btn-red"><i class="fa fa-plus"></i> Ask a Question</a>
					</div>
					<hr />
					<ul class="stat-menu clearfix">
  						<li>
  							<strong>Questions</strong>
  							<b class="fa fa-question-circle"></b><br />
  							<span><?php echo $questions->count(); ?></span>
  						</li>
  						<li>
  							<strong>Answers</strong>
  							<b class="fa fa-comments"></b><br />
  							<span><?php echo $answers->count(); ?></span>
  						</li>
  						<li>
  							<strong>Favorites</strong>
  							<b class="fa fa-star"></b><br />
  							<span>0</span>
  						</li>
					</ul>
					<hr />
					<p class="text-muted">Lorem ipsum dol amet..</p>
					<hr />
					<div class="text-center">
						<img src="http://placehold.it/200x150" alt="" />
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>