{% extends "AppBundle::layout.html.twig" %}
{% block body%}
	<div class="container-fluid">
		<div class="row">
			{% if user.media != null %}
				{% if user.media.type =="link" %}
					{% set image = user.media.url%}
				{% else %}
					{% set image = asset(user.media.link)|imagine_filter('actor_thumb') %}
				{% endif %}
			{% else %}
				{% set image = asset("img/avatar.jpg")|imagine_filter('actor_thumb') %}
			{% endif %}
			<div class="col-md-12" style=" height: auto; text-align:center;background-image:url({{image}});background-position: center;background-size: 100%;text-align: center;">
				{% if user.media != null %}
					{% if user.media.type =="link" %}
						<img  style="border-radius:300px;margin:10px;height:100px;width:100px;border: 5px solid rgb(255, 247, 247);" src="{{user.media.url}}" >
					{% else %}
						<img  style="border-radius:300px;margin:10px;height:100px;width:100px;border: 5px solid rgb(255, 247, 247);" src="{{asset(user.media.link)|imagine_filter('actor_thumb')}}" >
					{% endif %}
				{% else %}
					<img class="avatar-char palette-Red-400 bg"  style="border-radius: 100px;    border: 0.5px solid #ccc;" src="{{asset("img/avatar.jpg")|imagine_filter('actor_thumb')}}" alt="">
				{% endif %}
				<h3 style=" color: white; font-weight: bold">{{user.name}}</h3>
			</div>
			<div  class="col-md-12" style="border:1px solid #ccc;height:70px;background:white">
                <div class="row">
                    <div  class="col-md-3" style="border-right:1px solid #ccc;height:70px;background:white">
                        <a href="{{path("user_user_edit",{"id":user.id})}}" style="color:black;font-size:20px;line-height: 70px;font-weight: bold;">Edit infos</a>
                    </div>
                    <div  class="col-md-3" style="border-right:1px solid #ccc;height:70px;background:white">
                        <a href="{{path("user_user_comments",{"id":user.id})}}" style="color:black;font-size:20px;line-height: 70px;font-weight: bold;">Comments </a>
                    </div>
                    <div  class="col-md-3" style="border-right:1px solid #ccc;height:70px;background:white">
                        <a href="{{path("user_user_ratings",{"id":user.id})}}" style="color:black;font-size:20px;line-height: 70px;font-weight: bold;">Ratings </a>
                    </div>
                    <div  class="col-md-3" style="border-right:1px solid #ccc;height:70px;background:white">
                        <a href="{{path("user_admin_user_subscriptions",{"id":user.id})}}" style="color:black;font-size:20px;line-height: 70px;font-weight: bold;">Subscriptions </a>
                    </div>
                </div>
				
			</div>
			<div  class="col-md-12" >
				<br>
				<br>
				<div class="row">
					{% for rate in pagination %}
						<div class="col-md-6">
							<ul class="timeline timeline-simple">
								<li class="timeline-inverted">
									<div class="timeline-badge info">
										{% if rate.user.media != null %}
											{% if rate.user.media.type =="link" %}
												<img class="avatar-char palette-Red-400 bg"  style="border-radius: 100px;    border: 0.5px solid #ccc;" src="{{rate.user.media.url}}" alt="">
											{% else %}
												<img class="avatar-char palette-Red-400 bg"  style="border-radius: 100px;    border: 0.5px solid #ccc;" src="{{asset(rate.user.media.link)|imagine_filter('actor_thumb')}}" alt="">
											{% endif %}
										{% else %}
											<img class="avatar-char palette-Red-400 bg"  style="border-radius: 100px;    border: 0.5px solid #ccc;" src="{{asset("img/avatar.jpg")|imagine_filter('actor_thumb')}}" alt="">
										{% endif %}
									</div>
									<div class="timeline-panel">
										<div class="timeline-heading">
											<a href="{{path("user_user_edit",{id:rate.user.id})}}" title="">
												<span class="label label-danger">{{rate.user.name}}</span>
											</a>
										</div>
										<div class="timeline-body">
											<p>
												<div style="float: left;">
													{% set rate_value = rate.value %}
													{% for i in 1..5 %}
														{% if rate_value >= 1 %}
															<img src="{{asset("img/star.png")}}" style="height:50px;width:50px">
														{% endif %}
														{% if rate_value >= 0.25 and  rate_value < 0.75 %}
															<img src="{{asset("img/star_h.png")}}" style="height:50px;width:50px">
														{% endif %}
														{% if rate_value >= 0.75 and  rate_value < 1 %}
															<img src="{{asset("img/star.png")}}" style="height:50px;width:50px">
														{% endif %}
														{% if rate_value < 0.25 %}
															<img src="{{asset("img/star_e.png")}}" style="height:50px;width:50px">
														{% endif %}
														{% set rate_value  =  rate_value - 1 %}
													{% endfor %}
												</div>
												<span style="line-height: 50px;display: inline-block;font-size: 56pt;font-weight: bold;padding-left: 20px;">{{rate.value}}</span>
												<br>
											</p>
										</div>
										<hr>
										{% if rate.channel != null  %}
											<a href="{{path("app_channel_ratings",{id:rate.channel.id})}}" title="">
												<small class="label label-rose">
												<span>{{rate.channel}}</span>
												</small>
											</a>
										{% elseif rate.poster != null  %}
											{% if rate.poster.type == "serie" %}
												<a href="{{path("app_serie_ratings",{id:rate.poster.id})}}" title="">
													<small class="label label-rose">
													<span>{{rate.poster}}</span>
													</small>
												</a>
											{% elseif rate.poster.type == "movie"   %}
												<a href="{{path("app_movie_ratings",{id:rate.poster.id})}}" title="">
													<small class="label label-rose">
													<span>{{rate.poster}}</span>
													</small>
												</a>
											{% endif %}
										{% endif %}
										<small class="pull-right label label-rose">
										<span>{{rate.created|ago}}</span>
										</small>
									</div>
								</li>
								
							</ul>
						</div>
					{% else %}
						<div class="card"  style="text-align: center;" >
							<br>
							<br>
							<img src="{{asset("img/bg_empty.png")}}"  style="width: auto !important;" ="">
							<br>
							<br>
						</div>
					{% endfor %}
					<div class=" pull-right">
						{{ knp_pagination_render(pagination) }}
					</div>
				</div>
			</div>
		</div>
	</div>
{% endblock%}