<div class="container page-content clearfix">
    
    <div class="left-column">
		{!! Theme::section('experience.menu',['page'=>'lists']) !!}
		
        <div class="lists-experience-box">
		
			<span class="exp-sort-by-cat-box">
                <select name="sort-tasks" id="sort-tasks" class="sort-tasks" data-url="{{\URL::route('experience-list')}}">
                    <option value="" @if($type=="") selected="selected" @endif>List All</option>
					@foreach($categories as $ct)
						<option value="{{$ct->id}}" @if($type==$ct->id) selected="selected" @endif>	
							{{$ct->category_title}}
						</option>
                    @endforeach
                </select>
			</span>
		
			@if(count($sharedLists)>0)
				<div class="shared-exp-outer-box">
					<?php
						$i=0;
					?>
					@foreach($sharedLists as $exp)
						<div class="shared-exp-box @if($i%2==0) even @else odd @endif">
							@if($exp->description)
								<div class="row">
									<div class="col-sm-12">
										<div class="exp-description">
											@if(strlen($exp->description) > 300)
												
												<div class="business-product-list-desc-short" id="business-product-list-desc-short-{{$exp->id}}">
													{{strip_tags(Str::limit($exp->description, 300))}}
													 <a class="business-product-list-desc-more" data-id="{{$exp->id}}"
													   data-content="">{{trans('businessecommerce.read-more')}}</a>
												</div>
												
												<div class="business-product-list-desc-full" id="business-product-list-desc-full-{{$exp->id}}">
													{{$exp->description}}
													<a class="business-product-list-desc-less" data-id="{{$exp->id}}"
													   data-content="">{{trans('businessecommerce.read-less')}}</a>
												</div>
											
											@else
												{{$exp->description}}  
											@endif 
										</div>	
									</div>
								</div>		
							@endif

							<div class="row exp-title-row">
								<div class="col-sm-8">								
									<strong>Title:</strong> {{$exp->title}}								
								</div>

								<div class="col-sm-4">
									<div class="exp-category">
										#{{$exp->expcategory->category_title}}
									</div>	
								</div>	
							</div>	
							
							@if($exp->file_path)
								<div class="row exp-title-row">
									<div class="col-sm-12">
										<a target="_blank" title="View Document" href="{{$community->present()->getDocumentUrl($exp->file_path)}}">
											<img  data-original="{{Theme::asset()->get('theme/images/doc-icons')}}/{{$exp->file_ext}}.png" class="exp-document-image lazy" />
										</a>	
									</div>
								</div>		
							@endif
							
							<?php										
								//$expTags=$exp->exptags;
								$getMatchingsAll=\Auth::user()->present()->getMatchingExperience($community->id,$exp);
								$countMatching=count($getMatchingsAll);
							?>	
							
							<div class="exp-generated-tags">
								<strong>Generated tags for matching:</strong> 
								
								<?php 
									$expTg="";
								?>
								@if($exp->exptags)
									@foreach($exp->exptags as $tg)									
										<?php
											if($expTg==""){
												$expTg=$tg->keyword;
											}else{	
												$expTg=$expTg.", ".$tg->keyword;
											}	
										?>										
									@endforeach
								@endif
								
								{{$expTg}}
							</div>
							
							<div class="exp-footer-menu-box">
								<ul class="exp-footer-menu">
																	
									<li>
										<span class="exp-footer-menu-item">
											<i class="fa fa-connectdevelop exp-footer-menu-icon" aria-hidden="true"></i>
											<span data-id="{{$exp->id}}" class="exp-footer-menu-name @if($countMatching > 0) open-exp-footer-menu-matching @endif">
												Matching Found <span class="brand-colored-texts">({{$countMatching}})</span>
											</span>
										</span>	
									</li>
								</ul>

								@if($countMatching > 0)
									<?php 
										$mtch=1;
									?>	
									@foreach($getMatchingsAll as $match)	
										<div class="exp-footer-menu-matching exp-footer-menu-matching-{{$exp->id}}">
											<ul class="exp-footer-menu">
												<li>#Match {{$mtch}}</li>
												
												<!--<li>
													<span class="exp-footer-menu-item">
														<i class="fa fa-hand-paper-o exp-footer-menu-icon" aria-hidden="true"></i>
														<span class="exp-footer-menu-name">Say Hello</span>
													</span>	
												</li>-->
												
												@if($resume=\Auth::user()->present()->isResumeCreated($match->user_id))
													<li>												
														<a target="_blank" href="{{$resume->present()->url('book')}}" class="exp-footer-menu-item">
															<i class="fa fa-calendar exp-footer-menu-icon" aria-hidden="true"></i>
															<span class="exp-footer-menu-name">Appointment</span>
														</a>		
													</li>
												@endif
												
												<?php 
													$user=$match->user;											
												?>
												<li>
													<a style="background-color:transparent;" data-userid = "{{$user->id}}"
						data-link = "#"
						data-name = "Identity Hidden"
						href="javascript:register_popup('{{$user->username}}', 'Identity Hidden',{{$user->id}},'{{Theme::asset()->get('theme/images/identity-hidden.png')}}','experience',{{$exp->id}});" class="exp-footer-menu-item one-to-one-chat one-to-one-chat-{{$user->id}} single-chat-date-view">
														<i class="fa fa-comments-o exp-footer-menu-icon" aria-hidden="true"></i>
														<span class="exp-footer-menu-name">Start Conversation</span>
													</a>	
												</li>											
											</ul>
										</div>	
									
										<?php 
											$mtch++;
										?>	
									@endforeach	
								@endif
								
								<div style="clear:both"></div>
							</div>
						</div>
						<?php $i++;?>
					@endforeach
					
					{!! $sharedLists->appends(request()->except('page'))->render() !!}
				</div>	
			@else
				<div class="no-experience-found">
					No experience found.
				</div>	
			@endif
		</div>  
	</div>
    
    <div class="right-column">
        {!! Theme::section('user.side-info') !!}
        {!! Theme::widget()->get('notifications') !!}
    </div>
</div>

