{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}

{% if isModal|default(null) %}

<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
      <h4 class="modal-title">评价课程</h4>
    </div>
    <div class="modal-body">

{% endif %}



<ul class="media-list">
	{% for review in reviews %}
	  {% set user = users[review.userId] %}
    <li class="media">
    	{{ web_macro.user_avatar(user, 'pull-left') }}
    	<div class="media-body">
    		<div class="media-heading">
    			{{ web_macro.user_link(user) }}
    			<span class="bullet">•</span>
    			<span class="text-muted">{{ review.createdTime|date('Y-m-d') }}</span>
    		</div>

    		<div class="media-content">
    			<div><span class="stars-{{ review.rating }}"></span></div>

    			{{ review.content }}

    		</div>
    	</div>
    </li>
  {% endfor %}
</ul>

{% if paginator|default(null) %}
	{{ web_macro.paginator(paginator) }}
{% endif  %}


{% if isModal|default(null) %}

</div>
<div class="modal-footer">
    <button class="btn btn-link" data-dismiss="modal">取消</button>
    <button class="btn btn-primary" data-url="{{ path('course_review_create', {id:course.id}) }}" id="back_to_create">返回</button>
  
</div>
      </div>
</div>

{% endif %}